• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

specify multiple classpath

 
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 = =
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done sorting it out and welcome to the Ranch.
 
reply
    Bookmark Topic Watch Topic
  • New Topic