stuipid java SDK/RE error (java.lang.NoClassDefFoundError: Classname)

boran

Golden Member
Jun 17, 2001
1,526
0
76
stuipid java SDK/RE error (java.lang.NoClassDefFoundError: Classname)

(with Classname being whatever application I want to run)

this thing is annoying the heck out of me, I got this project I need to work on, yet I cannot run a single application. applets all work fine, compiling all works fine, it's just running an application that's totally impossible.

I already tried the following to no avail:

- uninstalled SDK, reinstalled SDK
- uninstalled SDK, uninstalled RE, reinstalled SDK and let it use it's included RE as RE
- uninstalled EVERTHING java related (toghetersoft, magicdraw UML), uninstalled the SDK, uninstalled the RE, removed every trace of the SDK from my system (files, registry etc), removed every trace from the RE from my system (same) and then reinstalled just the SDK with it's RE.

I'm totally baffeled, I dont see another option than a format C, because I really really needd to get the SDK and RE working by christmas.

 

Kilrsat

Golden Member
Jul 16, 2001
1,072
0
0
java SDK/RE error (java.lang.NoClassDefFoundError: Classname)

That is a class path error.

open a command prompt
Goto the folder that has the java .class file you want to run
java -classpath . <classname>


what's that do?
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
hmmh, what should the classpath then be ? it wants a path argument, but giving it the dir to the bin of both SDK or RE (program files etc) does not help.

 

Mitzi

Diamond Member
Aug 22, 2001
3,775
1
76
I assume this is under Windows...

As Kilrsat said your CLASSPATH is incorrectly set or your JAVA_HOME variable is pointing to the wrong place.

Start->Run->cmd

Type echo %CLASSPATH%

Type echo %JAVA_HOME%

What is the output? Where is Java installed to? Where is the program you are trying to run?
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
it's the bloody quicktime fooling around with my java, what the hell does that thing do anyways with java, argh I hate programs that go outside their boundries.

echo %CLASSPATH% returns
C:\Program Files\Java\J2re1.4.0_02\lib\ext\QTJava.zip

whereas echo %JAVA_HOME% returns %JAVA_HOME% (nothing is bound to java home I assume)

now the question is, to what, and how, do I change my classpath.

thanks for getting me at least this far.
 

MrScott81

Golden Member
Aug 31, 2001
1,891
0
76
what os are you running?

win2k/NT/XP:
-Right click on my computer, properties, advanced, and click on environmental variables
-In System variables, edit the Path variable and add the path to your jdk installation in there (note the entries are seperated by semi-colons: Here's what mine looks like as an example:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\j2sdk1.4.2_03\bin;C:\Program Files\UltraEdit
-Make sure you include the \bin after your jdk directory.

win98\ME:
find your autoexec.bat file and add edit the path in there to add your java path.
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
I edited the path variable to include c:\j2sdk1.4.2_03\bin

and I changed the CLASSPATH variable from
C:\Program Files\Java\J2re1.4.0_02\lib\ext\QTJava.zip
to
C:\Program Files\Java\j2re1.4.2_03\bin

now this might be wrong or right, but I think the problem lies somewhere with the classpath and not in the path, thanks for any help.

Boran.
 

MrScott81

Golden Member
Aug 31, 2001
1,891
0
76
well i don't even have a classpath variable and mine works fine

BUT...

try changing your classpath to this:
"C:\Program Files\Java\j2re1.4.2_03\bin;." (without the quotes)....notice i just added a "." to denote the current path
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
/me hands scottdog81 a :beer:

:D

thanks man, that . as classpath worked :)

EDIT:
just as I tought, deleting the CLASSPATH variable did the same thing, so I just removed it :)


 

MrScott81

Golden Member
Aug 31, 2001
1,891
0
76
thanks for the :beer: :)
Yeah i had that problem before too, that's why I knew exactly what your problem was.