wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 18498
    
  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: 18498
    
  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: 37884
    
  22
Well done sorting it out and welcome to the Ranch.
 
Don't get me started about those stupid light bulbs.
 
subject: specify multiple classpath
 
Similar Threads
Head First Servlets and JSP
Having Classpath trouble on my new iMac
urgent help in running examples from hf jsp servlets
package com.example.model ERROR
Servlet in Package Issue