File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[SOLVED] javac -cp (multiple classpath)

 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends..

i'm wondering about how to set -cp in javac command for multiple classpath..

i'm working on windows, and assume that i've directory structure as bellow :

C:\MyDir\src //contains A.java, B.java, C.java
C:\MyDir\bin
C:\MyDir\bin2

this is the definition of each class :






I've compiled B.java and C.java and place it in its own bin directory..
I've placed B.class in C:\MyDir\bin
I've placed C.class in C:\MyDir\bin2

How to compile A.java and then place it in C:\MyDir\bin directory?..

Thanks in advance..
 
Travis Hein
Ranch Hand
Posts: 161
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in windows, use the delimiter for classpath is semicolin (;)

So specify each path to be used, maybe use quotes if the path has spaces in it.

And to have the javac placed into the output folder, the -d parameter to javac to have it output into the desired output folder



Or, you should be able to specify the -sourcepath "C:\MyDir\src" as well to have it know to look in the src folder.

It has been so long since I have done anything with javac, years ago I started using Ant, the XML build file makes sense as it saves a lot of time typing all that stuff in, it reduces the chances of me typing it in incorrectly, and it is cross platform .
 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

Thanks..
 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonardo Carreira wrote:



You have forget to import C class as well...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic