• Did you order new AirTags? We've opened a dedicated AirTags forum.

bogdanw

macrumors 65816
Mar 10, 2009
1,062
552
which macOS version are you running on? You didn't even have to modify your java 6?
After installing Java, on Catalina 10.15.3
java.jpg
 
  • Like
Reactions: maccaskaty
Comment

bogdanw

macrumors 65816
Mar 10, 2009
1,062
552
well... not sure why is it not working for me? What could be the reason? any last resort which I can try?
Temporary disable Gatekeeper: open the Terminal app (Applications/Utilities/Terminal.app) and run
Code:
sudo spctl --master-disable
Try to open the app.
Gatekeeper can be re-enabled with
Code:
sudo spctl --master-enable
 
Comment

maccaskaty

macrumors newbie
Apr 7, 2020
9
0
Temporary disable Gatekeeper: open the Terminal app (Applications/Utilities/Terminal.app) and run
Code:
sudo spctl --master-disable
Try to open the app.
Gatekeeper can be re-enabled with
Code:
sudo spctl --master-enable
no luck in getting it to run!!! I guess I might have to get windows or look for someone to physically help me solve this problem!!! appreciate your help!
 
Comment

katlemons

macrumors newbie
Apr 10, 2020
2
1
Download Java for OS X 2017-001 https://support.apple.com/kb/dl1572
Open AppleScript (/Applications/Utilities/Script Editor.app) and copy-paste the code
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"}
Run the script (⌘+R), select the javaforosx.dmg, wait for the script to finish and install the Java.pkg saved on your desktop.


This seemed to work perfectly, ran the script, Opened the Java.pkg file that was created to my desktop and was able to install Java. At least, it SAID the installation was successful. BUT I don't see Java in my system preferences and when I try to open a my Jar file I get the message
The Java JAR file “smart_launcher.jar” could not be launched.
Check the Console for possible error messages.

BUT, I can't find the Java Console to check for error messages since Java is not showing under system preferences. Anybody have any ideas?
 
  • Like
Reactions: maccaskaty
Comment

albero1

macrumors newbie
Sep 28, 2020
1
0
Hi there, I know this thread is quite old now, but I need your help!

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

I've done this and work perfectly, but then I needed to switch to Java 8 so I deleted the java6 pkg from JavaVirtualMachines.

The problem is now I need back Java6 and the same instructions won't work. The script gives me the following error:

"Error encountered while creating /Users/Alba/tmp. Error 17: File exists"

What can I do?
 
Comment

cdiaz

macrumors newbie
Nov 24, 2020
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.
Hello, I am trying to install the Legacy Java SE 6 on a macOS Catalina. I followed the instructions here, but it gives me the following error: error "Error encountered while creating /Users/cdiaz/tmp. Error 17: File exists" number 1.
Ok, a bit more detail of what I am doing:
I downloaded the Java version from here https://support.apple.com/kb/dl1572?locale=en_US, and I leave it in the downloads folder.
I run the script and when it prompts me for the file, I select the one in the downloads folder, then it gives me the error but the installer opens. I run the installer and find the same problems with the disks not being usable due to the other have version on them.
Any help would be greatly appreciated. Thanks!
 
Comment

leon-geyer

macrumors newbie
Oct 19, 2010
13
0
Hi there, I know this thread is quite old now, but I need your help!



I've done this and work perfectly, but then I needed to switch to Java 8 so I deleted the java6 pkg from JavaVirtualMachines.

The problem is now I need back Java6 and the same instructions won't work. The script gives me the following error:

"Error encountered while creating /Users/Alba/tmp. Error 17: File exists"

What can I do?
Hi albero1, that problem is quite easy to solve. I run into the same: another program had already created an temp-folder in my user folder. Simply go to your user (/Users/Alba in your case) and move the existing "temp" folder shortly to desktop, run the script and relocate the tmp folder back once it is done.
 
Comment

tomexsic

macrumors newbie
Jan 22, 2021
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.
I tried this but failed Can you give me a screenshot of the terminal window that makes this work? Thanks tomexsic
 
Comment

revpow

macrumors newbie
Mar 17, 2021
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.
What did I do wrong? I copied and pasted this code into my Terminal and got this response:

zsh: parse error near `do'
 
Comment

bogdanw

macrumors 65816
Mar 10, 2009
1,062
552
I’ve explained that the script is meat to be run in AppleScript (/Applications/Utilities/Script Editor.app)
https://forums.macrumors.com/thread...sion-for-macos-catalina.2195954/post-27855520
I’ve made a video of the whole process and posted an updated script
https://forums.macrumors.com/thread...sion-for-macos-catalina.2195954/post-27873682
I’ve posted the alternative way from Terminal
https://forums.macrumors.com/thread...sion-for-macos-catalina.2195954/post-27865244
I’ve explained several times that “Error 17: File exists” can be solved by renaming or deleting the tmp folder
https://forums.macrumors.com/thread...sion-for-macos-catalina.2195954/post-27876810
https://forums.macrumors.com/thread...sion-for-macos-catalina.2195954/post-28119095
 
  • Like
Reactions: mikzn
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.