Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting package classpath in cmd line - how?

 
Charles Chikito
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20880
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Charles Chikito
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic