• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

classpath

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have been doing a java course and up until now all my programs have compile and worked fine. No I have started getting the noclassdeffound error.
The following is in the autoexec.bat where I put it.

set path=%path%;c:\jdk1.5.0_06\bin\
set classpath=%classpath%;.\

When I compile a java file it compiles fine and puts the class in the current directory, they just wont execute.

I have just recently installed nestcape v8.1. It may be just a coincedence.
 
Ranch Hand
Posts: 399
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Richard,

I too encountered a similar problem today. NoClassDefFoundError message is related to the CLASSPATH Environment variable. I resolved it by adding a semicolon at the end of the variable value.

add ; to whatever is there in the classpath variable in the autoexec.bat file and check. If this does not work, try the below procedure..

say you would like to add c:\MyWorkingDir to call CLASSPATH... which has c:\olddir

I did not edit the autoexec.bat file. In Windows it is recommended to use the following procedure: (on XP) Right Click MyComputer > Properties > Advanced Tab > Environment Variables > under System Variables section, select CLASSPATH > EDIT.

Change the CLASSPATH to c:\oldir;c:\MyWorkingDir;

Click Ok. OK.

Open a new DOS session and try to check if everything is working...

All the best !!
[ April 11, 2006: Message edited by: Ayub ali khan ]
 
richard stockman
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for that. I have just edited the path in the system variables rather than using autoexec.bat which apparently is the way to do it in older versions of windows and everything is working again. I think it was the quicktime installation which seemed to have changed everything. Goodbye quicktime!!
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just do one thing............
go to your directory where the java file are stored through command prompt.
then type
javac -classpath "."*.java

Thats it.

Your code will execute
 
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic