Richie
Richie

Reputation: 5197

Java install on Mac vs Windows

I have a question about the way that the Java SDK install happens on a MAC vs Windows.

In Windows you put the JDK wherever you want and then add the bin directory to your system %PATH%. Then you add %JAVA_HOME% and everything seems to work.

I'm fairly new to a Mac and have just done a java install. I've noticed the following.

The JDK has been placed in the following directory...

/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home

But if I do a which java it shows me...

/usr/bin/java

And then an ls -ltr on /usr/bin/java shows...

lrwxr-xr-x  1 root  wheel  74 22 Jul 06:35 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

It also looks like the other java executables can also be found in /usr/bin.

I'm not used to this and a bit confused about how this all hangs together.

Could someone please help me with an explanation.

thanks

Upvotes: 0

Views: 618

Answers (2)

Sean Patrick Floyd
Sean Patrick Floyd

Reputation: 299178

This is not specific to macs, but actually a common theme in Unix-based systems. In order to make your $PATH simpler, symbolic links are created in one of the standard directories that are already on the path, instead of actually placing the program there.

Upvotes: 1

Jim Weaver
Jim Weaver

Reputation: 1043

Personally, I just download and install java myself into a directory of my own making, and then in the tools I use (Java IDE, etc.), I point to that directory. You can also edit your bash profile to point to your own directory for java home. Basically I take Apple's decision on when/where to put java out of the loop at least in terms of programming I am doing.

This question about where it will be placed if you go through mac installer is answered here, however:

Where is Java Installed on Mac OS X?

Upvotes: 0

Related Questions