Hi Ling,

Try using the classpath option on the compiler opposed to the environment 
variable. One problem could be the classpath could have been relative to where 
you were on the file system.

> javac -cp ~/workspace/github/johnmay/cdk/dist/jar/cdk-1.5.2.git.jar Main.java


where 'Main.java' is:

> import org.openscience.cdk.*;
> 
> public class Main { 
>     public static void main(String[] args) {
>        System.out.println("Using CDK");
>        Atom atom = new Atom("C");    
>     }
> }


You will also need to include other dependencies (see 'cdk/jar/') for certain 
tasks.

Now you probably already know this but it all gets very tedious so at some 
point you'll need to start using a build system (maven, gradle, ant etc.) or an 
IDE. Personally I use IntelliJ IDEA of which there is a also free community 
edition, Netbeans and Eclipse are other free options.

Hope this helps,
J

On 15 Apr 2013, at 04:45, S.L. Chan <[email protected]> wrote:

> Hello folks,
> 
> I have downloaded the CDK package onto my Windows 7 laptop.
> I have compiled it following instructions in the README file.
> I created one large .jar file using "ant dist-large". It
> seems to work and I can see the classes inside this 
> cdk-1.4.16.jar file using "jar -tf".
> 
> However, when I tried to compile my java program, javac
> crashed upon the line "import org.openscience.cdk.*;"
> because "the package org.openscience.cdk does not exist".
> I checked that I have set the CLASSPATH env variable to
> point to this cdk-1.4.16.jar file.
> 
> Alternatively, I noticed that there are java class files in
> %CDK_HOME%\dist\appjars\org\openscience\cdk. So I tried
> setting CLASSPATH to %CDK_HOME%\dist\appjars. But still,
> javac crashed, complaining that "the package 
> org.openscience.cdk does not exist.
> 
> So what have I missed?
> 
> Many thanks for your help.
> 
> Ling
> 
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service 
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! 
> http://p.sf.net/sfu/newrelic_d2d_apr_______________________________________________
> Cdk-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cdk-user

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to