Hi

Thank you for your mail.
I  had already confirmed PATH and set CLASSPATH before I compiled and executed.

thanks
Alex



----- Original Message -----
From: Noel O'Boyle <baoille...@gmail.com>
To: BLizzard R <blizzard...@yahoo.com>
Cc: "openbabel-discuss@lists.sourceforge.net" 
<openbabel-discuss@lists.sourceforge.net>
Sent: Wednesday, December 21, 2011 3:49 PM
Subject: Re: [Open Babel] Problem call Open Babel C++ library from Java

Works on me on Win7. The Open Babel install directory should already
be on the PATH (test by typing "obabel" at a command prompt):

C:\Temp>echo %PATH%
C:\Windows;;C:\Program Files (x86)\OpenBabel-2.3.1;etc. etc. etc.

C:\Temp>set CLASSPATH=C:\Program Files (x86)\OpenBabel-2.3.1\openbabel.jar

C:\Temp>"C:\Program Files (x86)\Java\jdk1.6.0_17\bin\javac.exe" Test.java

C:\Temp>set CLASSPATH=C:\Program Files (x86)\OpenBabel-2.3.1\openbabel.jar;.

C:\Temp>"C:\Program Files (x86)\Java\jdk1.6.0_17\bin\java.exe" Test
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
Their C atoms have indices: 1 6
C:\Temp>

- Noel

On 21 December 2011 20:12, BLizzard R <blizzard...@yahoo.com> wrote:
>
>
>
> Hello
>
> I just installed OpenBabel 2.3.1 on my windows vista and tried to
> call OpenBabel 2.3.1 from a java project.
>
> When I tested OpenBabel's java sample: OBTest.java, I met the following 
> problem.
>
> If I put OBTest.class in a same directory with openbabel.jar and DLL 
> files, the sample worked well.
>
> But if they were not in same directory, it failed to call OpenBabel, output 
> is "Benzene has 0 atoms.".
>
> I already set PATH and CLASSPATH which included DLL and jar's path.
>
> Do I need set any other environment variables?
> Is there anyone has experience on this problem?
>
> BTW: I failed to call OpenBabel in Eclipse, got same results.
> I would appreciate your advice.
>
> Best regards
> Alex
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to