Become a MacRumors Supporter for $25/year with no ads, private forums, and more!
  • Did you order new AirTags? We've opened a dedicated AirTags forum.

Plauto

macrumors newbie
Nov 14, 2019
1
0
Here is a simpler way, an AppleScript that removes the installation limits from Java for macOS 2017-001.
Code:
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}
The script asks you to select the dmg file, opens the file, unpacks JavaForOSX.pkg, modifies the Distribution file and saves a new pkg file on Desktop, Java.pkg, that can be installed on Catalina.
It worked!
Thank you very match (from Spain)
 
Comment

Vikas gaur

macrumors newbie
Nov 14, 2019
3
0
Screenshot 2019-11-15 at 11.01.18 AM.png
Screenshot 2019-11-15 at 11.01.18 AM.png

[automerge]1573797510[/automerge]
from Last night its Showing Running but nothing happening Plz Help. My Movie magic is not working showing Legacy java 6 runtime
 
Comment

bogdanw

macrumors 65816
Mar 10, 2009
1,054
548
from Last night its Showing Running but nothing happening Plz Help. My Movie magic is not working showing Legacy java 6 runtime
You are supposed to select javaforosx.dmg from your Downloads folder or from where you saved it.
From the images, it looks like javaforosx.dmg it's already mounted, so you can use the commands in Terminal from post 23 https://forums.macrumors.com/thread...sion-for-macos-catalina.2195954/post-27865244
Or you can delete the first two lines of the script you have in Script Editor and run it again.
 
Comment

Vikas gaur

macrumors newbie
Nov 14, 2019
3
0
Open javaforosx.dmg, open the Terminal and run the following commands one by one:
Code:
pkgutil --expand /Volumes/Java\ for\ macOS\ 2017-001/JavaForOSX.pkg ~/tmp

sed -i '' 's/return false/return true/g' ~/tmp/Distribution

pkgutil --flatten ~/tmp ~/Desktop/Java.pkg
[automerge]1573920513[/automerge]
You are supposed to select javaforosx.dmg from your Downloads folder or from where you saved it.
From the images, it looks like javaforosx.dmg it's already mounted, so you can use the commands in Terminal from post 23 https://forums.macrumors.com/thread...sion-for-macos-catalina.2195954/post-27865244
Or you can delete the first two lines of the script you have in Script Editor and run it again.
its showing this when i deleted first two line
 

Attachments

  • Screenshot 2019-11-16 at 9.37.30 PM.png
    Screenshot 2019-11-16 at 9.37.30 PM.png
    144.4 KB · Views: 239
Comment

Vikas gaur

macrumors newbie
Nov 14, 2019
3
0
Comment

sezerkose

macrumors newbie
Nov 18, 2019
1
0
Here is a simpler way, an AppleScript that removes the installation limits from Java for macOS 2017-001.
Code:
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}
The script asks you to select the dmg file, opens the file, unpacks JavaForOSX.pkg, modifies the Distribution file and saves a new pkg file on Desktop, Java.pkg, that can be installed on Catalina.
Thanks a lot
 
Comment

percy37

macrumors newbie
Nov 22, 2019
1
0
Here is a simpler way, an AppleScript that removes the installation limits from Java for macOS 2017-001.
Code:
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}
The script asks you to select the dmg file, opens the file, unpacks JavaForOSX.pkg, modifies the Distribution file and saves a new pkg file on Desktop, Java.pkg, that can be installed on Catalina.

LEGEND. Thank you so much for this. I literally registered to the forum just to say thanks. Life saver.
 
Comment

MusicManG

macrumors newbie
Nov 24, 2019
1
0
(( excellent instructions ))

Just wanted to send you a quick thanks -- that worked perfectly and has just saved me the colossal hassle I was embarking upon of creating a VM of some older version of OS X just so I could run two very old but critical pieces of software. Really appreciated.
 
Comment

ibt

macrumors newbie
Nov 25, 2019
2
0
It was probably created on a previous unsuccessful attempt, rename or delete the /Users/colincarr/tmp folder.
Could anyone tell me how I can find the "/Users/firstname/tmp folder" on my macbook, so I can then delete / rename it? I tried searching in Finder; couldn't find it. A thousand thanks in advance
 
Comment

bogdanw

macrumors 65816
Mar 10, 2009
1,054
548
Could anyone tell me how I can find the "/Users/firstname/tmp folder" on my macbook, so I can then delete / rename it? I tried searching in Finder; couldn't find it. A thousand thanks in advance

From Finder - Go - Go to Folder and ~/ to open your home folder (/Users/firstname/)
1.jpg

2.jpg


From Terminal use open ~/ to open the home folder, rm ~/tmp to delete the tmp folder or mv ~/tmp ~/tmp2 to rename it tmp2
 
  • Like
Reactions: ibt
Comment

hanny1910

macrumors newbie
Dec 2, 2019
1
0
hi..

I already follow the instruction in here.. but it still did not work. Maybe because the first time I instal Java 2007-001 then it said I already have newer version I delete all Java and then I download and install jdk-13.0.1_osx-x64_bin.dmg and then I tried download JavaForOSX.dmg for java 2007-001 but still the same.

I found this forum and I tried all in here.. but still can't manage to install java 2007-001. and got this
Screen Shot 2019-12-02 at 18.30.17.png

any suggestion what should I do? thanks
 
Comment

Prophetsnake

macrumors newbie
Dec 6, 2019
1
0
Here is a simpler way, an AppleScript that removes the installation limits from Java for macOS 2017-001.
Code:
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}
The script asks you to select the dmg file, opens the file, unpacks JavaForOSX.pkg, modifies the Distribution file and saves a new pkg file on Desktop
 
Last edited:
Comment

nidostar

macrumors newbie
Sep 29, 2019
4
2
Here is a simpler way, an AppleScript that removes the installation limits from Java for macOS 2017-001.
Code:
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}
The script asks you to select the dmg file, opens the file, unpacks JavaForOSX.pkg, modifies the Distribution file and saves a new pkg file on Desktop, Java.pkg, that can be installed on Catalina.
Bought a replacement Mac running Catalina. Tried to run ClickRepair but failed. Tried to install legacy Java but failed. Then tried this script. It worked first time! Bogdanw you're a star, thank you.
 
Comment

lina_mart

macrumors newbie
Dec 16, 2019
1
0
I hope this will help, here is a video of how the script is supposed to work
Code:
https://imgur.com/a/t1p3XNP

Edit: A small change made to the script should keep the Script Editor in front of Finder

Code:
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG & " -noverify -nobrowse"
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}

I ran the script and keep getting an error message...any idea how to solve?
 
Comment

haideruzair

macrumors newbie
Jan 3, 2020
1
0
While running script as mentioned above:
Error encountered while creating /Users/Uzair/tmp. Error 17: File exists

Please help
 
Comment

Catness

macrumors newbie
So, after I did this and installed the converted package, when I try to close Script Editor, I get the following (shown in screenshot). It wants me to save or delete the code as a document. Can I delete it or do I have to save it? If I have to save it, where should I save it to?
 

Attachments

  • Screen Shot 2020-01-06 at 10.55.42 AM.png
    Screen Shot 2020-01-06 at 10.55.42 AM.png
    339.3 KB · Views: 138
Comment

bogdanw

macrumors 65816
Mar 10, 2009
1,054
548
So, after I did this and installed the converted package, when I try to close Script Editor, I get the following (shown in screenshot). It wants me to save or delete the code as a document. Can I delete it or do I have to save it? If I have to save it, where should I save it to?
You can delete it. Save Java.pkg, maybe you will need it for another Mac or if you make a clean install of Catalina.
 
Comment

Karyn Knight Detering

macrumors newbie
Jan 30, 2020
1
0
I've tried the solution and I'm still getting the message that my Mac has a more updated version of Java installed. I've uninstalled all versions. Is there anything else I can try?
 

Attachments

  • Screenshot 2020-01-30 17.05.22.png
    Screenshot 2020-01-30 17.05.22.png
    1.8 MB · Views: 102
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.