aspose file tools
The moose likes Beginning Java and the fly likes Setting package classpath in cmd line - how? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Setting package classpath in cmd line - how?" Watch "Setting package classpath in cmd line - how?" New topic
Author

Setting package classpath in cmd line - how?

Charles Chikito
Ranch Hand

Joined: May 22, 2009
Posts: 76
I tried this but the folders were not created:

c:\>set classpath=%classpath%;c:\java\work

Wonder what is wrong here...

Please help
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16687
    
  19

Chikito Charles wrote:I tried this but the folders were not created:

c:\>set classpath=%classpath%;c:\java\work

Wonder what is wrong here...

Please help


The classpath environment variable is used by the Java compiler and JVM to find your packages. It doesn't create any directories or the packages themselves.

Henry


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

Joined: May 22, 2009
Posts: 76
i managed to solve it.

you are right.
The classpath environment variable is used by the Java compiler and JVM to find your packages. It doesn't create any directories or the packages themselves.


i should have compiled using the following command:

javac -d . filename.java

to automatically create directories ( as per the package abc.xyz; line of code in the filename.java file) and have filename.class file inside xyz folder.

Else I have to manually create the nested folders and put the filename.class file inside xyz folder.

tq
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Setting package classpath in cmd line - how?
 
Similar Threads
RMI and classpath prob
Problem compiling java class
executing rmid
I feel kinda dumb but...
Trouble loading the driver, "ClassNotFoundException".