No class found.

When trying to run or compile some of the demo programs I get the error NoclassDeffound.  These are the lines that I added to my autoexec.bat file (win98):
set CLASSPATH=.;c:\jdk1.2.2\classes;c:\JavaAI\class

I added the classes directory, and unzipped all the classes zip files that I found into it.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


You shouldn't need to unzip the classes zip files.  You can even specify the *.zip files in your CLASSPATH.  This is in my CLASSPATH:


Also, did you restart your computer after changing autoexec and check the settings with the "set" command?  Sounds silly, but that actually burned me once.  Make sure that the CLASSPATH is found.  The NoClassDefFound should tell you what class is missing as well.  That may help you find what *.jar, *.zip or *.class file your classpath is not pointing to.

Good luck!


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
scottd1978Author Commented:
Ok, where do I run this set command from??  Also, is this path setting recursive?  

You can type it at the command line like this:

C:\>set CLASSPATH=.;c:\jdk1.2.2\classes;c:\JavaAI\class

It will override whatever your current CLASSPATH setting is.

To prepend something to the existing CLASSPATH:

set c:\new\path;%CLASSPATH%

To append:

set %CLASSPATH%;c:\new\path

This has the advantage of setting your classes for the DOS session you are using, but once you reboot, they are lost.  That is why using the ControlPanel System settings or the autoexec.bat file is better in the long run.  You can set it in a DOS session at frist until you get it right, then copy the listing into your autoexec.bat or whatever for when you reboot.

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Is the system able to find your compiler . Are you having a problem trying to compile stuff then In addition to your existing class path you need ,
c:\jdk1.2.2\bin; add this line  to your autoexec and see

I'm using JDK1.2.2 This is my path in autoexec.bat.

SET PATH=%PATH%;C:\jdk1.2.2\bin;
scottd1978Author Commented:
ok ... kewl, I got that error out of the way, but now when I try to run the demo's I get another error.
Exception in thread "main" java.lang.NoSuchMethodError: main


First off, the NoSuchMethodError is caused when you call a method that isn't defined in one of your classes.
You will have to go back and check
that your zip/class files are current.  Is there more information with that error?  You can post it as a separate question if you still are stuck.

Second, if you think one of us answered
your initial question, please accept the appropriate comment as an answer. That way it will end up in the database for others to see...

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.