I use OS X Yosemite (10.10.2) and I have to use JDK 1.5 for legacy application development. I found this post which refers to this script to install JDK 4,5,6 in Lion and Mavericks. In comments I found this two lines
/usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumFrameworkVersion 14.*.*" ./Resources/Info.plist
/usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumSystemVersion "$osx_version".*" ./Resources/Info.plist
have to be changed by
/usr/libexec/PlistBuddy -c "Delete :JavaVM:JVMMaximumFrameworkVersion" ./Resources/Info.plist
/usr/libexec/PlistBuddy -c "Delete :JavaVM:JVMMaximumSystemVersion" ./Resources/Info.plist
to achieve compatibility with Yosemite. I ran this script and this is content of my /System/Library/Frameworks/JavaVM.framework/Versions
directory
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 9 apr 11:01 1.5 -> ./1.5.0_30
lrwxr-xr-x 1 root wheel 10 9 apr 11:01 1.5.0 -> ./1.5.0_30
drwxr-xr-x 9 root wheel 306 9 apr 11:01 1.5.0_30
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.6.0 -> CurrentJDK
drwxr-xr-x 7 root wheel 238 8 apr 14:36 A
lrwxr-xr-x 1 root wheel 1 8 apr 14:36 Current -> A
In Eclipse preferences Java->Installed JREs->Execution Environments, there is not any JRE 1.5
and probably this is the reason why I cannot build projects in Java 5, because I get errors:
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
In Eclipse preferences Installed JREs - JSE-1.5 refers to correct path
In project preferences Java Build Path contains J2SE-1.5
and Java Compiler in project preferences is set correctly as well.
This is content of /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0_30
directory
This thread refers to my previous post.