View Single Post
  #4   (View Single Post)  
Old 29th July 2008
incripshin incripshin is offline
New User
 
Join Date: Jul 2008
Posts: 5
Default

Quote:
Originally Posted by ocicat View Post
I don't run 1.7, but creating symlinks in 1.6 has worked for me:
Code:
# ln -sf /usr/local/jdk-1.6.0/bin/java /usr/local/bin/java
# ln -sf /usr/local/jdk-1.6.0/bin/javac /usr/local/bin/javac
No dice. 1.5 and 1.6 behave nicely: when I have it in my PATH, it works fine. Also, this works regardless of PATH:

Code:
$ cd /usr/local/jdk-1.7.0/bin
$ ./java
[reams of output]
$ cd .. ; bin/java
[same]
$ cd .. ; jdk-1.7.0/bin/java
[same]
So, it seems like Java is finding the libraries by using getcwd() and argv[0]. This is clearly a horrible idea since it makes working with PATH impossible. I don't know how java 1.5 and 1.6 found the libraries, but it was definitely a different method.

The only solution besides changing the source code is messing with the linker. Currently, ldconfig does not see any of the libraries in /usr/local/jdk-1.7.0/jre/lib/i386 and I can't figure out why.

I also tried setting JAVA_HOME and JDK_HOME to /usr/local/jdk-1.7.0.

Last edited by incripshin; 29th July 2008 at 07:48 AM. Reason: /* extra note */
Reply With Quote