Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

NoClassDefFoundError

Thread view: 
Eli Luong - 30 Apr 2006 06:14 GMT
I was wondering what the reason is behind this. I recently installed
the Java 5.0 SDK. Compiling *.java files seems to work fine, but
whenever I try to run something, it gives me that NoClassDefFoundError.
I've seen a solution is to run it as java -classpath . ClassName, but
that's some strange workaround I don't like. Why is this happening? Do
I have to install the SDK in a directory that contains no spaces? By
default it ended up in Program Files\Java.

Thanks,
- Eli
Knute Johnson - 30 Apr 2006 06:20 GMT
> I was wondering what the reason is behind this. I recently installed
> the Java 5.0 SDK. Compiling *.java files seems to work fine, but
[quoted text clipped - 6 lines]
> Thanks,
> - Eli

You shouldn't need a classpath to run a class in the current directory
if it has no package.  Check to make sure that you don't have a
classpath specified in the environment.  If you do, it could be that it
doesn't have . in it like it should.

Signature

Knute Johnson
email s/nospam/knute/

aywang31@gmail.com - 30 Apr 2006 06:26 GMT
I got that error too when I re-installed a newer SDK version.  I
believe that you should check your system's environment variables.  On
Windows XP, go to My Computer, View System Information.  Then go to the
advanced tab and click on Environment Variables.  Under System
Variables, make sure that C:\Program Files\Java\bin (or wherever your
bin folder is) is in that variable's value.  I'm pretty sure the error
is because your new SDK is in a different directory from your old one.
Eli Luong - 30 Apr 2006 06:35 GMT
Thank you to both who replied. I checked out the environment variables.
I'm not sure what I'm looking at. There is a variable called CLASSPATH
: C:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip. It's pointing
to the old java runtime environment. I'm wondering what I should change
that to, because it's pointing to QTJava.zip.

In addition, another variable called QTJava : C:\Program
Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip is displayed, and I'm not
sure what to do with that.

What I did was just install the SDK (the compiler and the private JRE)
and not the public JRE, so that means I"m using the old JRE. Should I
install the new JRE and uninstall the old JRE?

Thank you,
- Eli
Knute Johnson - 30 Apr 2006 16:43 GMT
> Thank you to both who replied. I checked out the environment variables.
> I'm not sure what I'm looking at. There is a variable called CLASSPATH
[quoted text clipped - 12 lines]
> Thank you,
> - Eli

Eli:

Probably the simplest thing to do now would be to unistall both the JDK
and JRE, delete the old folders and reinstall the JDK.

Signature

Knute Johnson
email s/nospam/knute/

Eli Luong - 01 May 2006 01:16 GMT
Thanks. I had to do that and then set CLASSPATH to a "." and that
finally made it work. Whew.
Oliver Wong - 01 May 2006 20:47 GMT
>> Thank you to both who replied. I checked out the environment variables.
>> I'm not sure what I'm looking at. There is a variable called CLASSPATH
[quoted text clipped - 17 lines]
> Probably the simplest thing to do now would be to unistall both the JDK
> and JRE, delete the old folders and reinstall the JDK.

   Sounds like Eli has some extensions related to QuickTime installed in
his/her JRE's extension folder. Perhaps it was bundled in with another Java
app (s)he had downloaded and installed earlier? If the applications suddenly
stop working, you might want to redownload the QTJava.zip, put it in your
new JRE's extension folder, and reconfigure your classpath and QTJava
environment variable to point to the new location:

http://developer.apple.com/quicktime/qtjava/

   - Oliver
Eli Luong - 05 May 2006 04:28 GMT
Thanks, I'll keep that in mind if something strange happens. So far
nothing seems to be broken, so that's a good sign.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.