Friday, July 22, 2011

Lion removes Java?

Yes it does! Java really isn't installed this time. So, just open up Terminal.app and type 'java'. It will automatically install from there.

My guess is that there is some sort of Oracle licensing agreement that prevents Apple from distributing Java with the release. You'd think that these two massive public companies would be able to work something out

Once you have done that, if you are a developer, you will need to fix where the source code is:
  1. Go to http://connect.apple.com and download: Java for Mac OS X 10.7 Developer Package
  2. Install it.
  3. Open a Terminal.app window
  4. cd /System/Library/Frameworks/JavaVM.framework/Home
  5. sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/src.jar .
  6. sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/docs.jar .
  7. sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/appledocs.jar .
p.s. The version number seems to have gone down (384 to 383) with 10.7 vs. 10.6.8 and there is now an appledocs.jar that I didn't notice before.

p.p.s. This fixes apps like 'Network Connect' which depend on Java being installed.

p.p.p.s. Check out Similarity.com. Developed on a Mac, using Java, running on Google App Engine.

17 comments:

RMK said...

Some time ago Apple said that they will stop to ship Java, they was saying also something about moving development effort to Oracle, because for now Oracle (earlier Sun) ships code to Apple, and Apple is adding theirs own changes, because of this Mac OS X is always behind rest of world with Java.

berta said...

these are much anticipated changes

kblue said...

Possibly just streamling downloads to save a few hundred mbs since Apple switched to download only model now? Stick to core product and let end user install what they want.

Unless you think it is a conspiracy and Jobs hates Oracle as much as Adobe. Maybe Jobs has a similar Cofee language to replace Java?

Neil said...

@kblue- I don't think a few hundred megabytes on top of the 4gb download that is Lion would make much of a difference!

chrisl said...

Apple used to modify their code to run on macs. This did complicate licensing. So, Java has moved back to Oracle for development and distribution. While one might say Apple is snubbing Java, you cannot run Filemaker Pro and a host of other Apple apps without it, so the omission must be other than purposeful exclusion.

Links said...

Shipping OS X with an outdated version of Java is a security issue more so then a tiff with Oracle as far as I've heard. Java updates all the time because of security holes, and the users who get new Macs not shipping with the latest updates are still prone to those issues. By prompting the user to download Java in Lion on demand, the user is guaranteed to get the latest update.

Jon Scott Stevens said...

Untrue. Apple's been pretty good about doing releases to update Java security holes for a while now.

Mike said...

Instead of symlinking the docs into the system JDK, why don't you just point your IDE at the developer JDK in /Library?

Eclipse has a handy "Search..." button that does detection in it's "Installed JREs" preference panel.

Jon Scott Stevens said...

That works too.

Martin said...

The reason for this "removal" and the apparent lowering in version number I believe is due to the fact that Apple for a long time maintained their own branch of the JVM. They used it to to be able to make some small stylistic changes so that Java applications would look more uniform alongside the rest of the OS. So instead of the default window stylings being the ugliness that you see on Windows and Linux, they changed the default to a Mac-esque theme. I know that's one major difference (along with breaking cross-platform object serialisation on many graphics objects as a result) that was made in their own version that was distributed by default, there was likely other changes, but I'm not aware of them.

It seems that now Apple may have decided to stop trying to maintain it themselves and will now just use the original Oracle versions.

Jon Scott Stevens said...

Maybe in the future, but the current version which is distributed when you type 'java' at the cli and have it automatically installed is still the Apple version of the JDK.

Even if Apple decides to stop maintaining their version of the JDK (which would be great because then we can get updates more quickly), there is no reason why they can't distribute someone else's with the OS unless there is some sort of licensing issue with that.

It isn't like Apple maintains their own version of python or ruby and both of those are distributed with Lion.

Daniel Serodio said...

How do I uninstall the "Java Developer Package for Mac OSX 10.6" that's leftover from the previous installation?

Jon Scott Stevens said...

No idea. Why would you want to do that anyway? Does it really matter?

Mike said...

Simply throw away the .jdk bundle from /Library/Java/JavaVirtualMachines. Everything else about the Developer package will be removed/replaced by installing Lion.

Daniel Serodio said...

The reason is simply housekeeping; removing something which I'll never use again.

Thanks Mike.

Dave said...

You have it backwards Daniel. What you want to do is remove OSX and download the Debian NetInst ISO.

Jakey said...

Thanks!