New jre layout broke Maven and Ant

Mike Swingler swingler at apple.com
Fri Sep 30 08:08:22 PDT 2011


On Sep 30, 2011, at 5:16 AM, Henri Gomez wrote:

> Hi guys
> 
> I got various reports on openjdk-osx-build about failure to detect tools.jar :
> 
> http://code.google.com/p/openjdk-osx-build/issues/detail?id=22
> http://code.google.com/p/openjdk-osx-build/issues/detail?id=23
> 
> As a temporary fix, I'll add a symlink in package
> 
> ln -s lib/tools.jar 1.7.0.jre/Contents/Home/lib/tools.jar
> 
> tools.jar is under JAVA_HOME/lib for both OS/X and Linux version.
> 
> Could it be something related to JRE_HOME/JAVA_HOME ?

Yes. the assumption is that you can always walk up one directory and find the JDK, but that's no longer true, because the 1.7.0.jre bundle has to be an atomic Mac OS X bundle that can be placed inside of another app bundle. Ideally, and IDE which contains a 1.7.0.jdk bundle will contain all it needs inside of itself to generate .jre based app bundles, or whole new copy of itself with a .jdk bundle.

My usual trick would be to make a "jdk" symlink to ../../../ inside of 1.7.0.jre/Contents/Home, and have the tools just look for a "jdk" directory, but my experience with adding backwards pointing symlinks has not been popular with some folks that are dependent on zip-based archiving. So, is there a better alternative?

Any ideas?
Mike Swingler
Java Engineering
Apple Inc.



More information about the macosx-port-dev mailing list