This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Setting package classpath in cmd line - how? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
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: 19345
    
  41

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://aspose.com/file-tools
 
subject: Setting package classpath in cmd line - how?