![]() |
|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
I just installed jdk-1.7, but it doesn't quite work. I have /usr/local/jdk-1.7.0/bin in my PATH. When I run java or javac, I get this:
Code:
$ javac Error: could not find libjava.so Error: Could not find Java SE Runtime Environment. Code:
$ sudo ldconfig /usr/X11R6/lib /usr/local/lib /usr/local/jdk-1.7.0/jre/lib/i386 $ ldconfig -r | grep jdk search directories: /usr/lib:/usr/X11R6/lib:/usr/local/lib:/usr/local/jdk-1.7.0/jre/lib/i386 Last edited by incripshin; 29th July 2008 at 04:46 AM. Reason: /* way better title */ |
|
|||
![]()
Also I'm running -current, and I really wish I gave this thread a better title. ... TITLE FIXED!
Last edited by incripshin; 29th July 2008 at 04:49 AM. Reason: /* totally figured out how to change the title -> awesome */ |
|
|||
![]()
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 |
|
|||
![]() Quote:
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] 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 */ |
|
|||
![]() Quote:
$ cd /usr/ports ; make search key=jdk Once you have resolution, it would be great if you would report here what was both the issue & solution. |
|
|||
![]()
So it was an issue with dladdr(), bug compatible with Solaris by the looks of it. Changing one line of the source code fixes it. The maintainer probably won't commit the change because of a ports soft-lock for 4.4, so in the meantime, you can either apply it yourself or make some shell scripts to do the work for you:
Code:
--- patch-jdk_src_solaris_bin_java_md_c.old 2008-07-31 20:34:09.000000000 -0500 +++ patch-jdk_src_solaris_bin_java_md_c 2008-07-31 20:34:19.000000000 -0500 @@ -41,15 +41,6 @@ /* * On linux, if a binary is running as sgid or suid, glibc sets * LD_LIBRARY_PATH to the empty string for security purposes. (In -@@ -841,7 +851,7 @@ static const char* - SetExecname(char **argv) - { - char* exec_path = NULL; --#if defined(__solaris__) -+#if defined(__solaris__) || defined(_ALLBSD_SOURCE) - { - Dl_info dlinfo; - int (*fptr)(); @@ -1209,6 +1219,20 @@ UnsetEnv(char *name) return(borrowed_unsetenv(name)); } Code:
#!/bin/sh exec /usr/local/jdk-1.7.0/bin/`basename $0` "$@" |
|
|||
![]() Quote:
|
|
|||
![]()
The change will make it in despite the lock, so it appears we will all get a working JDK/JRE in the next OpenBSD release without having to accept Sun's license agreements and spend half a day compiling.
|
|
|||
![]()
No, the above discussion is specific to the JDK 1.7 port only for current users who are not running what is presntly in the -current ports tree. I built -current as of yesterday & can say firsthand that the above fix was been checked in for JDK 1.7.
Last edited by ocicat; 9th August 2008 at 05:01 PM. |
![]() |
Tags |
java, jdk |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running as a WPA-RADIUS AP? | Sunnz | OpenBSD Security | 7 | 23rd September 2009 02:09 AM |
Problem getting php running | badguy | OpenBSD General | 7 | 22nd July 2009 03:34 PM |
Running your own web server | JMJ_coder | General software and network | 28 | 13th February 2009 01:15 AM |
compiling and running perl/tk | bsdnewbie999 | Programming | 4 | 10th August 2008 10:22 AM |
Cron running but not working | stukov | Other BSD and UNIX/UNIX-like | 26 | 24th July 2008 01:17 PM |