From: Noel O'B. <bao...@gm...> - 2008-12-16 14:40:37
|
Forwarding to list... ---------- Forwarded message ---------- From: Nathan Rice <exn...@gm...> Date: 2008/12/16 Subject: java bindings installation question To: bao...@gm... Hello, I went through the entire installation process described in the README file for the installation of the java bindings as a non root user, and successfully ran the test program (after extracting the jar file into the classpath to solve some classdefnotfound errors). A libopenbabel.so file was created in the script directory with a filesize of about 2 megabytes. I would like the bindings to be available to all users on the system, are there additional installation steps that I can do so that users only have to call the library from within java without having to copy/move/etc anything? Thank you for any help you can provide, Nathan Rice |
From: Noel O'B. <bao...@gm...> - 2008-12-16 23:29:34
|
(please cc to the list - I may need help :-) ) 2008/12/16 Nathan Rice <exn...@gm...>: > Thanks so much for the fast reply Noel. > > Everything works for other users if they point their classpath to the > uncompressed contents of openbabel.jar and copy the compiled libopenbabel.so > file to the directory that contains the OBTest program. So if you're busy I > should be ok now :) It shouldn't be necessary to to copy libopenbabel.so anywhere. Don't the instructions in the readme describe how to set LD_LIBRARY_PATH to point to the directory containing libopenbabel.so? Have you tried this? > If the classpath is set to point to either the directory which contains > openbabel.jar, and the archive itself (as in the directions) or both, a > classdefnotfound error occurs: > > nathan@acelot2:~/test$ ls > libopenbabel.so OBTest.java openbabel.jar > nathan@acelot2:~/test$ pwd > /home/nathan/test > nathan@acelot2:~/test$ echo $CLASSPATH > /home/nathan/test/openbabel.jar:/home/nathan/test > nathan@acelot2:~/test$ LD_PRELOAD=$OB_LIBDIR/libopenbabel.so $JAVA/bin/java > OBTest > Exception in thread "main" java.lang.NoClassDefFoundError: OBTest > Caused by: java.lang.ClassNotFoundException: OBTest > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) If you've sent me the correct commands and output, the problem is that Java cannot find OBTest.class. You need to compile the OBTest.java file first. > If I change the classpath to point to the extracted contents of the jar, it > works perfectly. I imagine that is probably an issue on my end, just seemed > a little strange. I am using ubuntu (hardy) x86, for reference if that is > helpful. I still cannot figure this part out...maybe I've included OBTest.class by accident in the jar file...? > Happy Holidays, > Nathan > > On Tue, Dec 16, 2008 at 6:50 AM, Noel O'Boyle <bao...@gm...> wrote: >> >> Hello Nathan, >> >> If I understand you correctly, you are using the OpenBabel Java >> bindings available from Cinfony along with OpenBabel 2.2.0 (the next >> release of OpenBabel will include the Jar file directly). It shouldn't >> be necessary to extract the jar file. Just add it to your CLASSPATH >> and it should work. >> >> Regarding making it all available to all users on the system, it is >> just a question of setting the environment variables as described in >> the README. If it works for you, it should work for other users in the >> same way. The best way to test is to copy the test program to a new >> directory, and see whether you can compile and run it there. >> >> If it doesn't work for you, please describe exactly what OS you're >> using, what commands you used, and where it failed. >> >> Regards, >> Noel >> >> 2008/12/16 Noel O'Boyle <bao...@gm...>: >> > Forwarding to list... >> > >> > ---------- Forwarded message ---------- >> > From: Nathan Rice <exn...@gm...> >> > Date: 2008/12/16 >> > Subject: java bindings installation question >> > To: bao...@gm... >> > >> > >> > Hello, >> > >> > I went through the entire installation process described in the README >> > file for the installation of the java bindings as a non root user, and >> > successfully ran the test program (after extracting the jar file into >> > the classpath to solve some classdefnotfound errors). A >> > libopenbabel.so file was created in the script directory with a >> > filesize of about 2 megabytes. I would like the bindings to be >> > available to all users on the system, are there additional >> > installation steps that I can do so that users only have to call the >> > library from within java without having to copy/move/etc anything? >> > >> > Thank you for any help you can provide, >> > >> > Nathan Rice >> > > > |
From: Nathan R. <exn...@gm...> - 2008-12-16 22:38:08
|
I had some other issues which I posted to the openbabel-discussion list, I hope that wasn't the wrong place to post them - some java bindings stuff on nabble archives came up there so I went ahead and posted it. On Tue, Dec 16, 2008 at 1:30 PM, Noel O'Boyle <bao...@gm...> wrote: > (please cc to the list - I may need help :-) ) > > 2008/12/16 Nathan Rice <exn...@gm...>: > > Thanks so much for the fast reply Noel. > > > > Everything works for other users if they point their classpath to the > > uncompressed contents of openbabel.jar and copy the compiled > libopenbabel.so > > file to the directory that contains the OBTest program. So if you're > busy I > > should be ok now :) > > It shouldn't be necessary to to copy libopenbabel.so anywhere. Don't > the instructions in the readme describe how to set LD_LIBRARY_PATH to > point to the directory containing libopenbabel.so? Have you tried > this? > I did try that, I have two copies of libopenbabel.so, one which was created and installed on initial make install of the core package (filesize ~12M), and a second one which was in my scripts/java/ directory (filesize ~2M). The one that is in my scripts/java directory is the one that has to be in the same directory as OBTest. The LD_LIBRARY_PATH points to the other one. Is this incorrect? > > If the classpath is set to point to either the directory which contains > > openbabel.jar, and the archive itself (as in the directions) or both, a > > classdefnotfound error occurs: > > > > nathan@acelot2:~/test$ ls > > libopenbabel.so OBTest.java openbabel.jar > > nathan@acelot2:~/test$ pwd > > /home/nathan/test > > nathan@acelot2:~/test$ echo $CLASSPATH > > /home/nathan/test/openbabel.jar:/home/nathan/test > > nathan@acelot2:~/test$ LD_PRELOAD=$OB_LIBDIR/libopenbabel.so > $JAVA/bin/java > > OBTest > > Exception in thread "main" java.lang.NoClassDefFoundError: OBTest > > Caused by: java.lang.ClassNotFoundException: OBTest > > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > > If you've sent me the correct commands and output, the problem is that > Java cannot find OBTest.class. You need to compile the OBTest.java > file first. > > > If I change the classpath to point to the extracted contents of the jar, > it > > works perfectly. I imagine that is probably an issue on my end, just > seemed > > a little strange. I am using ubuntu (hardy) x86, for reference if that > is > > helpful. > > I still cannot figure this part out...maybe I've included OBTest.class > by accident in the jar file...? > I went back and checked this, since you are totally right about that error, and it looks like I probably copied the OBTest.class there accidentally at some point. Glad I'm just being a tard on that account. > > > Happy Holidays, > > > Nathan > > > > On Tue, Dec 16, 2008 at 6:50 AM, Noel O'Boyle <bao...@gm...> > wrote: > >> > >> Hello Nathan, > >> > >> If I understand you correctly, you are using the OpenBabel Java > >> bindings available from Cinfony along with OpenBabel 2.2.0 (the next > >> release of OpenBabel will include the Jar file directly). It shouldn't > >> be necessary to extract the jar file. Just add it to your CLASSPATH > >> and it should work. > >> > >> Regarding making it all available to all users on the system, it is > >> just a question of setting the environment variables as described in > >> the README. If it works for you, it should work for other users in the > >> same way. The best way to test is to copy the test program to a new > >> directory, and see whether you can compile and run it there. > >> > >> If it doesn't work for you, please describe exactly what OS you're > >> using, what commands you used, and where it failed. > >> > >> Regards, > >> Noel > >> > >> 2008/12/16 Noel O'Boyle <bao...@gm...>: > >> > Forwarding to list... > >> > > >> > ---------- Forwarded message ---------- > >> > From: Nathan Rice <exn...@gm...> > >> > Date: 2008/12/16 > >> > Subject: java bindings installation question > >> > To: bao...@gm... > >> > > >> > > >> > Hello, > >> > > >> > I went through the entire installation process described in the README > >> > file for the installation of the java bindings as a non root user, and > >> > successfully ran the test program (after extracting the jar file into > >> > the classpath to solve some classdefnotfound errors). A > >> > libopenbabel.so file was created in the script directory with a > >> > filesize of about 2 megabytes. I would like the bindings to be > >> > available to all users on the system, are there additional > >> > installation steps that I can do so that users only have to call the > >> > library from within java without having to copy/move/etc anything? > >> > > >> > Thank you for any help you can provide, > >> > > >> > Nathan Rice > >> > > > > > > |
From: Noel O'B. <bao...@gm...> - 2008-12-17 09:24:57
|
2008/12/16 Nathan Rice <exn...@gm...>: >> It shouldn't be necessary to to copy libopenbabel.so anywhere. Don't >> the instructions in the readme describe how to set LD_LIBRARY_PATH to >> point to the directory containing libopenbabel.so? Have you tried >> this? > > I did try that, I have two copies of libopenbabel.so, one which was created > and installed on initial make install of the core package (filesize ~12M), > and a second one which was in my scripts/java/ directory (filesize ~2M). > The one that is in my scripts/java directory is the one that has to be in > the same directory as OBTest. The LD_LIBRARY_PATH points to the other one. > Is this incorrect? The two libopenbabel.so files are different (we should probably rename the small one). As described in the README, the PATHs to both should be added to LD_LIBRARY_PATH (in the order shown in the README - this is important). It shouldn't be necessary to use LD_PRELOAD if these are set correctly. If this is done, it might help solve your problems with Eclipse also. BTW, you are unlikely to get a useful response over at openbabel-discuss, as very few people will be using the Java bindings, which were only released in an experimental form in the last OB release. - Noel |
From: Noel O'B. <bao...@gm...> - 2008-12-16 14:53:57
|
Hello Nathan, If I understand you correctly, you are using the OpenBabel Java bindings available from Cinfony along with OpenBabel 2.2.0 (the next release of OpenBabel will include the Jar file directly). It shouldn't be necessary to extract the jar file. Just add it to your CLASSPATH and it should work. Regarding making it all available to all users on the system, it is just a question of setting the environment variables as described in the README. If it works for you, it should work for other users in the same way. The best way to test is to copy the test program to a new directory, and see whether you can compile and run it there. If it doesn't work for you, please describe exactly what OS you're using, what commands you used, and where it failed. Regards, Noel 2008/12/16 Noel O'Boyle <bao...@gm...>: > Forwarding to list... > > ---------- Forwarded message ---------- > From: Nathan Rice <exn...@gm...> > Date: 2008/12/16 > Subject: java bindings installation question > To: bao...@gm... > > > Hello, > > I went through the entire installation process described in the README > file for the installation of the java bindings as a non root user, and > successfully ran the test program (after extracting the jar file into > the classpath to solve some classdefnotfound errors). A > libopenbabel.so file was created in the script directory with a > filesize of about 2 megabytes. I would like the bindings to be > available to all users on the system, are there additional > installation steps that I can do so that users only have to call the > library from within java without having to copy/move/etc anything? > > Thank you for any help you can provide, > > Nathan Rice > |