Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikzn

macrumors 68040
Original poster
Sep 2, 2013
3,005
2,293
North Vancouver
I have a few apps that require the apple legacy version of Java runtime

As per previous thread see this Catalina OS thread - I tried to install the legacy version of Java 6 runtime on Big Sur and the Java package seemed to install ok - /Library/Java/JavaVirtualMachines/1.6.0.jdk

After the install pkg "seemed to run fine" and reported "install sucessful" - checking with "java --version" in terminal - I get "operation could not be completed - unable to locate Java Runtime"

I am wondering if Apple has changed how Java runs in Big Sur and if the "calling home" for each app that runs on Big Sur has anything to do with it? Also I am cautious about changing any system files - perhaps this may break the Big Sur OS system "signing" and cause problems or break the OS Big Sur System?

Everything was working in Catalina perfectly and now does not work in Big Sur all the way up to 11.2 so far

Has anyone had any success installing Java 6 Run Time and any apps that require this legacy version of Java?

Any thoughts / Tips / updates?
 

jemcik

macrumors newbie
Dec 4, 2017
19
5
Kyiv, Ukraine
There is quite simple solution:
1. install brew (package Manager for macOS)
2. run in the terminal: brew install java6

As a result you will have jdk 1.6 on the path /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

One thing to note: jdk 1.6 will not work on Apple Silicon.
 

mikzn

macrumors 68040
Original poster
Sep 2, 2013
3,005
2,293
North Vancouver
There is quite simple solution:
1. install brew (package Manager for macOS)
2. run in the terminal: brew install java6

As a result you will have jdk 1.6 on the path /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

One thing to note: jdk 1.6 will not work on Apple Silicon.
Is this a suggestion ?

Or did you actually install it and verify that it works with a legacy app?
 

mateo_rocks

macrumors newbie
Feb 10, 2021
1
0
There is quite simple solution:
1. install brew (package Manager for macOS)
2. run in the terminal: brew install java6

As a result you will have jdk 1.6 on the path /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

One thing to note: jdk 1.6 will not work on Apple Silicon.
How come it doesn't work on Apple Silicon? Probably will need to run legacy apps on AS, is there anything I can do?
 

mikzn

macrumors 68040
Original poster
Sep 2, 2013
3,005
2,293
North Vancouver
How come it doesn't work on Apple Silicon? Probably will need to run legacy apps on AS, is there anything I can do?

As far as I can tell (so far) it may not work on Big Sur - I am able to install the files succesfully with the Catalina Link as per above - post #1 - the files are installed in the same location as in Catalina - but the JAVA_HOME does not work and is not recognized by macOS Big Sur

java-6-SE-lagacy-version~.png


java-not-recognized.png
 

harabai

macrumors newbie
Feb 16, 2021
2
1
instead of setting JAVA_HOME pre-Big Sur way.
use absolute path to your JDK6 install.
for me, my bash script for sourcing my env has JAVA_HOME=/Library/Java/JavaVirtualMachines/<JDK6>/Home
 
  • Like
Reactions: mikzn

harabai

macrumors newbie
Feb 16, 2021
2
1
forgot to add, i have to revert back to Catalina because i get some weird JNI error about creating JavaVM when i run Maven or Jboss with Big Sur. They still run, but slow as hell, compared to running them in Catalina
 

mikzn

macrumors 68040
Original poster
Sep 2, 2013
3,005
2,293
North Vancouver
instead of setting JAVA_HOME pre-Big Sur way.
use absolute path to your JDK6 install.
for me, my bash script for sourcing my env has JAVA_HOME=/Library/Java/JavaVirtualMachines/<JDK6>/Home

Thanks for the reply tried that and could not get that to work - I don't think you install the Mac "Legacy Version"? which some apps need specifically?

I did find this link - How to Set $JAVA_HOME environment variable on macOS - and was able to reset - $JAVA_HOME - by editing < ~/.zshrc >

Mikzn-MBP2015-BS ~ % echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/1.6.0

Unfortunately my app still crashes - so at this point am not sure if the Java "mac legacy version" does not work or if perhaps the application (iBackup) just won't work on Big Sur

All worked fine on Catalina - I may try a different app to see if the Java install is good - but need to find another app that needs the Mac legacy version of Java to test with
 

zionlion77

macrumors newbie
Jun 11, 2021
1
0
hey mikzn,

how did you actually manage to reset the $JAVA_HOME? What did you enter in ~/.zshrc?
I tried:
export JAVA_HOME=$(/usr/libexec/java_home)
which will always return the Java 8 location at
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

the other thing I tried was
export JAVA_HOME=$(/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home)
or
export JAVA_HOME=$(/Library/Java/JavaVirtualMachines/1.6.0.jdk/)
but both resulted in a permission denied error:
zsh: permission denied: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

I compared the folder permissions of the Java 6 and 8 directories and both were set to 755, so in theory everything should work.
I'd be happy for any feedback.
 

ewu

macrumors regular
Apr 14, 2020
113
74
the best way is to upgrade legacy app into new java 8.

the best OS for java 6 is mac os EI Capitan
 
Last edited:

mikzn

macrumors 68040
Original poster
Sep 2, 2013
3,005
2,293
North Vancouver
hey mikzn,

how did you actually manage to reset the $JAVA_HOME? What did you enter in ~/.zshrc?
I tried:
export JAVA_HOME=$(/usr/libexec/java_home)
which will always return the Java 8 location at
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

the other thing I tried was
export JAVA_HOME=$(/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home)
or
export JAVA_HOME=$(/Library/Java/JavaVirtualMachines/1.6.0.jdk/)
but both resulted in a permission denied error:
zsh: permission denied: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

I compared the folder permissions of the Java 6 and 8 directories and both were set to 755, so in theory everything should work.
I'd be happy for any feedback.

sorry I don't have any good news or updates - in fact after updating Big Sur several times since the above post - I have again lost the ability to set Java_Home to 1.6.0 - not that it worked even when I was able to get Java_Home set to 1.6.0 - I have not tried to get it working again - too much time and effort

I am not sure - but if it breaks every-time there is an BigSur update - I suspect it may be not worth the effort?

I do remember messing around with .zshrc and trying the alternative .zshenv files (Files paths to JAVA_HOME) and also the permissions to both files and also $HOME/.zshrc

I used "Text Edit" and "Nano" in terminal to create / edit files and added text edit to "full disk access" so I assumed that permissions were ok - you have a good point on the permissions 👍

I have not spent any time since the post above - 3 april 2021 - so no new thoughts

If you work on this and make any discoveries - I am sure everyone following this thread will appreciate any updates and solutions
 

rbarrow

macrumors newbie
Nov 3, 2021
1
0
Lyon, France
I tried all these solutions for several hours on MacOS 11.6 Big Sur, but none of them worked.
I have not been able to get Java 6 work.
 

bogdanw

macrumors 603
Mar 10, 2009
6,099
3,011
Here is how I got Angry IP Scanner 3.4.1 to run on Big Sur:
1. Download Java from Apple https://support.apple.com/kb/DL1572
2. Create a package that can be installed on Big Sur (same script as for Catalina)
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"}
3. Install the Java.pkg saved on your desktop
4. Open /bin/bash
5. Edit bash_profile with
Code:
nano ~/.bash_profile
copy-paste
Code:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
save the change when exiting.
6. Run the source command
Code:
source ~/.bash_profile
7. Test it with
Code:
echo $JAVA_HOME
The result shoud be /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
8. Drag and drop the executable file of the app, in this case /Applications/Angry\ IP\ Scanner.app/Contents/MacOS/ipscan
9. Press enter and good luck! :)
AngryIP.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.