Java For El Capitan

1

Mac OS X and Apple Java 6 End of Life Apple has posted notice that Mac OS X 10.11 (El Capitan) will be the last OS X release that supports Java 6, and as such, recommends developers whose applications depend on Java 6 to migrate their apps to a newer Java version provided by Oracle. » More info (apple.com).

How do you downgrade Java version on MacOSX El Capitan? Right now when I run java -version I get:

java version '9.0.1' Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

  1. What java did you install? And what version of eclipse. And what exactly happens – mmmmmm Jul 23 '15 at 23:05 Actually, just an update has come up on OS X El Capitan, I have installed it seems to working fine except I had issues with the workspace which I think I can fix them.
  2. Java Download And Mac Os 10.11 El Capitan 11 El Capitan; Mac OS EL Capitan is one of the best-operating systems and twelfth major release of Apple. Although Apple has major new releases for macOS. However, in the case of Mac computers, Mac OS EL Capitan still has it all to be in the category of best Mac operating system.
  3. It is worth to mention, Apple still providing JDK6for this newest release (El Capitan), Apple recommend user to use the latest Java from java.com.

I need to have it say:

Java for el capitan download

java version '1.8.0_25' Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

So I can run a specific npm java based package.

I tried following instructions on Java website for uninstall/re-install with no luck. They suggest to run these 3 commands:

Doing this seems to do nothing. When I run java -version I still get the same result.

I watched this video But I cannot find the JavaAppletPlugin.plugin referenced in video.

What am I doing wrong? How do you change Java version on El Capitan Mac OS?

1 answers

2

Look at SDKMAN - http://sdkman.io/

You install it, then do sdk list java

You can install any or all of these, and select whichever one you want to use and set a default, as well:

See the docs here:

OS X El Capitan and Java: No Fun (till now!)

There's been a bunch of stuff on the interwebs lately about El Capitan and Java issues... here's the simple simple, condensed version of the fix:

Quick prereq to the post:

Install java for el capitan
I have, for some time, had the following line in ~/.bash_profile under my login on my machine:
I see it this way... /System/Library/Frameworks/JavaVM.framework/ relies on a set of symlinks that, in turn, rely on /Library/Java/Home being another symlink that points to the Home directory of an installed JVM. Changing the /Library/Java/Home symlink ensures that all of that other machinery (legacy or otherwise) continues to work correctly.
At the very least with this setup typing 'java -version' at the command line gives me the version I'm looking for. And swapping symlinks to point to real disk locations is fairly easy... it makes it MUCH easier to change JVM versions. Just repoint the symlink to
/Library/Java/JavaVirtualMachines/{jvm_folder}/Contents/Home
and Bob's your uncle... it's done. And no other changes necessary.
So I selected to base this all on /Library/Java/Home being The Correct Location For The Current JVM.

Java For Os X 2015 El Capitan

As I said... the above line is in a file called .bash_profile under /Users/{username}. If you have to create it be sure that afterward you open terminal and run
cd ~
chmod u+x .bash_profile
and then restart terminal. That will ensure that JAVA_HOME is always set when you hit Terminal. This makes many things lots easier, but most of all, since most Java packages will check for JAVA_HOME and only go looking for a JVM if not set, it gives you control over the Java version being used to run whatever it is you are trying to run.

So...

That's why I chose to set JAVA_HOME to /Library/Java/Home and proceed as I have.

Download and install Legacy Java 6SE from Apple:

https://support.apple.com/kb/DL1572?locale=en_US

Download and install Java 8 JDK from Oracle:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.htmlJava for el capitan 10.11.6

Change a system symlink to make the Java 8 JVM the command line default:

cd `echo $JAVA_HOME`
sudo rm Home
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home ./Home

Java For El Capitan 10.11.6

Once done, test with the following command on the command line:

Java Se 6 For El Capitan

java -version
If you've done the above correctly your Java apps will launch and your command-line tools (oh, like launching Tomcat) will automatically use the latest JVM.

OH, also... once you've installed the Java 8 JDK you may have to do two other things:

Edit the Java JDK PLIST

Edit the file at /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Info.plist to be:
<key>JVMCapabilities</key>
<array>
<string>CommandLine</string>
<string>JNI</string>
<string>BundledApp</string>
</array>

Java For Os X El Capitan

Add a symlink to point to libserver.dylib

Java_se_6_for_el_capitan

It seems the Oracle installer doesn't create a necessary symlink for the JDK, so you'll need to copy/paste the following commands (there's 2 of them, btw):

Install Java For El Capitan

Java
sudo mkdir -p /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bundle/Libraries
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/server/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bundle/Libraries/libserver.dylib

Give thanks to Oliver from Australia!

Dude is my hero and this wouldn't have happened without his blog post. However he's missing the J2SE 6 install and download and has a bunch of other stuff in there that isn't really relevant anymore.
So, dude... here's your linkback:

Java For El Capitan Download


https://oliverdowling.com.au/2014/03/28/java-se-8-on-mac-os-x/