This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes specify multiple classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "specify multiple classpath" Watch "specify multiple classpath" New topic
Author

specify multiple classpath

Pongsakorn Semsuwan
Ranch Hand

Joined: May 15, 2011
Posts: 34

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


A web application developer wannabe from Thailand
My StartUp : http://www.dreamlog.co
Blog : http://pongsakornsemsuwan.wordpress.com
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18876
    
  40


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

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Pongsakorn Semsuwan
Ranch Hand

Joined: May 15, 2011
Posts: 34

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
Sheriff

Joined: Sep 28, 2004
Posts: 18876
    
  40

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

Joined: May 15, 2011
Posts: 34

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

Joined: Oct 13, 2005
Posts: 39079
    
  23
Well done sorting it out and welcome to the Ranch.
 
GeeCON Prague 2014
 
subject: specify multiple classpath