This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Classpath

 
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
 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What machine are you using?
 
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
 
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!