• Post Reply Bookmark Topic Watch Topic
  • New Topic

Classpath  RSS feed

 
Jesse Walker
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im trying to work with packages, and keep them organized in different directories but I get a nodefclass error, I believe, meaning that it wont like in the directory that I placed itin. I have tried to set the Classpath but it still doesnt work
I used the following at the directory where javac and java are both stored(Using JSDK1.3.1)

set Classpath = C:\Mypackages\package1; C:\jsdk1.3.1/bin

What am I doing wrong?
Any help will be appreciated, Im just a begingin been working on my own for about two weeks.
Thank you
Jesse
 
Sania Marsh
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What machine are you using?
 
Inuka Vincit
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jesse Walker:
Im trying to work with packages, and keep them organized in different directories but I get a nodefclass error, I believe, meaning that it wont like in the directory that I placed itin. I have tried to set the Classpath but it still doesnt work
I used the following at the directory where javac and java are both stored(Using JSDK1.3.1)

set Classpath = C:\Mypackages\package1; C:\jsdk1.3.1/bin

What am I doing wrong?
Any help will be appreciated, Im just a begingin been working on my own for about two weeks.
Thank you
Jesse



well firstly your slash is wrong C:\jsdk1.3.1/bin but I assume its a typing mistake but your missing the . as well


set Classpath = .;C:\Mypackages\package1; C:\jsdk1.3.1\bin
path should also have the . set. Otherwise if you are running in the current directry nothing will be included. Try that out.

[ August 27, 2004: Message edited by: Benjamin Gunawardana ]
[ August 27, 2004: Message edited by: Benjamin Gunawardana ]
 
Jesse Walker
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that was a typing mistake sorry. I will try it with the .; before hand. I was also reading that if you type in the fully qualifed name, the package.class name it will run, is that true or not?
Thanks
Jesse
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jesse,

You get more help with your problem in the JavaRanch FAQ on how to set the classpath.

To run a Java class in a specific package you need to specify the fully qualified class name on the command line. So, if the class containing your main() method is called MyMainClass and your package is called com.mycompany.myapp.mypackage then your command line should look something like this:

Hope this helps.

Jules
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!