Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Path in Windows xp

 
gordon wilcox
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have just updated my environment variables pat,classpath,derby_install so that i can experiment with derby the apache sql java database.

now i cant run even the simplest java class - hello world get the error message

Exception in thread "main" java.lang.NoClassDefFoundError -MyFirstApp

I can only assume i have upset one of my environment variables can anyone help

from a complete java novice
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For ease of use you may want your CLASSPATH environment variable to include . (period), to include the current directory. Alternately, you can enter:

>java -cp . YourClass

If you are using Ant or an IDE, this wouldn't be a problem.
 
gordon wilcox
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeff Albertson:
For ease of use you may want your CLASSPATH environment variable to include . (period), to include the current directory. Alternately, you can enter:

>java -cp . YourClass

If you are using Ant or an IDE, this wouldn't be a problem.
 
gordon wilcox
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that solved my problem with the classpath

they say 'ignorance is bliss' but it dont feel that way
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic