I have access to a 64-bit Centos 6.3 (Final) and have just compiled OB 2.3.2 and the Java bindings. I'm using the java/c in /usr/bin (I guess this comes with Centos? - it's Java 1.7). I've just run the example Java in the docs (http://openbabel.org/docs/current/UseTheLibrary/Java.html) and it outputs: Canonical SMILES: ClC(=O)CCC(=O)Cl The molecular weight is 154.97935999999999 Atom 1: atomic number = 6, hybridisation = 2 Atom 2: atomic number = 17, hybridisation = 0 Atom 3: atomic number = 8, hybridisation = 2 Atom 4: atomic number = 6, hybridisation = 3 Atom 5: atomic number = 6, hybridisation = 3 Atom 6: atomic number = 6, hybridisation = 2 Atom 7: atomic number = 8, hybridisation = 2 Atom 8: atomic number = 17, hybridisation = 0 There are 2 acid chloride groups
I didn't need any LD_PRELOAD. After running "make install" which installed into a local folder, I went there and typed: javac -cp openbabel.jar Test.java export LD_LIBRARY_PATH=/usr/java/jdk1.7.0_25/jre/lib/amd64/xawt:`pwd` java -cp openbabel.jar:. Test I'm not sure why it's not working for you. You may have permissions problems for example (I note that you are running as root). - Noel On 21 November 2013 17:59, Craig James <cja...@emolecules.com> wrote: > > On Thu, Nov 21, 2013 at 6:26 AM, Rajesh <h_raj...@jubilantbiosys.com> wrote: >> >> Thanks James and Dimitri for your quick reply. >> >> Upon installation, I have compiled and executed OBTest.java to validate >> java >> binding. Unfortunately, it said "Benzene has 0 atoms" even after >> preloading >> libopenbabel.so >> >> [root@localhost lib]# LD_PRELOAD=libopenbabel.so java OBTest >> Running OBTest... >> Benzene has 0 atoms. >> >> This shows even though both these versions generates babel binaries, none >> of >> them produces valid java binding file ( libopenbabel_java.so / >> libopenbabel_java.so ), atleast in my case. > > > This sounds similar to problems that I had with Swig and Perl. Everything > would compile, but something went wrong with the dynamic loader at run time. > It seemed as though it wasn't calling the C++ initializer code when it > loaded the OpenBabel libraries, resulting in symptoms that made no sense. > > Sorry I have no better answer. > > Craig > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss