Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple compiling problem

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic