• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

specify multiple classpath

 
Pongsakorn Semsuwan
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a trouble compiling my .java file using more than one classpath on my macbook.

here's my command


Compiler can find my servlet-api and it's content. But cannot find my classes

I have a feeling that this has something to do with classpath. If i switch my -classpath to

Compiler will be able to find my classes, but cannot find servlet-api.jar

I have tried using semi colon as a separator and that doesn't work either.

Thanks in advance

 
Henry Wong
author
Marshal
Pie
Posts: 21190
80
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Try it without using the ~ character. Use the full home directory instead.

Henry
 
Pongsakorn Semsuwan
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your quick reply.

I just tried


and



and the result is the same as using ~/Libra.. which is cannot find my classes.


 
Henry Wong
author
Marshal
Pie
Posts: 21190
80
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pongsakorn Semsuwan wrote:
and the result is the same as using ~/Libra.. which is cannot find my classes.


You are going to have to give us more info -- my last suggestion was already a shot in the dark. Perhaps giving us the exact error messages? the directory structures? the classes being imported? etc.

Henry
 
Pongsakorn Semsuwan
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my bad, I just try

javac -classpath /Users/dolphin/Library/Tomcat/lib/servlet-api.jar:/Users/dolphin/Library/Tomcat/webapps/ROOT/classes SearchSinger.java

and it works!

Thanks a lot !!

I have been trying like 2 hours to solve this damn problem = =
 
Campbell Ritchie
Sheriff
Pie
Posts: 49370
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done sorting it out and welcome to the Ranch.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic