This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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: 20029
    
  44

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
 
Have you checked out Aspose?
 
subject: Setting package classpath in cmd line - how?
 
It's not a secret anymore!