File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes simple compiling problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "simple compiling problem" Watch "simple compiling problem" New topic
Author

simple compiling problem

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
It's been awhile since I've compiled at the command line. My file Demo.java is in the same directory as the jar (spsswdemo.jar) it depends on. So I type:

javac -classpath ".;spsswdemo.jar" Demo.java

But this doesn't work. Demo cannot find classes in the jar (I checked, they are there)

Somebody please straighten me out on this matter!

Thanks

Eic
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
I had a look at the java tool website where it tells you about the -classpath option, and this link about classpaths. I don't think you need to specify . when adding to the classpath, and I don't think you are supposed to use quotes.

Try missing out the .; bit or the "s and if that doesn't work try the absolute classpath for spsswdemo.jar, ie starting with C:\
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Thanks. The problem turned out to be the lack import statements in the Demo class. I love to download demos of a product that are broken!

Eric
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simple compiling problem
 
Similar Threads
two public classes in a file
ON THREADS
How do you get the text field value from another java file
Problem with drawing shapes on canvas
How to include jars in command line classpath?