This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Exception at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Exception at runtime " Watch "Exception at runtime " New topic

Exception at runtime

sruthi laya

Joined: Oct 15, 2008
Posts: 7
Hi ,

I am trying to execute a java class , i am getting a run time exception saying "Error in Thread main : NoClassDefFoundException" . I had set my classpath as C:\jdk1.3\bin . I am working on Windows xp .

needed a solution , please help me out to sort this .

Thanks in advance ,
sruthi .
Thomas Thevis
Ranch Hand

Joined: Sep 02, 2008
Posts: 87
Hello Sruthi,

there were several people with similar problems in the last days. Try to search this forum for these threads first, as for instance Not able to run a class file. If all these threads do not help, come back here and post what you tried so far.

Someone will know how to help


SCJP 5.0, SCJD in progress
marc weber

Joined: Aug 31, 2004
Posts: 11343

Originally posted by sruthi laya:
... I had set my classpath as C:\jdk1.3\bin...

That's the problem. You should not set a classpath.

Was there anything in the classpath before you set it? If not, then you should remove the classpath variable entirely.

If there was something in the classpath before you set it, then you might need to keep it, but you should add a dot (.) for the current directory. For example...

(Note: It's the PATH -- not the CLASSPATH -- that should include your Java bin directory. These are different things.)

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45302
And why are you still using Java 1.3?
sruthi laya

Joined: Oct 15, 2008
Posts: 7
Hi ,

Thanks for the replies ,

Actually i was trying to have tomcat as well as java on my system.

i had set PATH :C:\jdk1.3\bin
JAVA_HOME : C:\jdk1.3\bin
CATALINA_HOME : C:\Tomcat4.1

and deleted CLASSPATH ;

Please guide me how can i run tomcat as well as my java programs .
CLASSPATH is needed for java right ?

please clear my doubts .

thanks ,
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45302
You only need a CLASSPATH set on some systems; on Windows it must contain . and doesn't have to contain anything else.

Get it working for ordinary Java first, then think about Tomcat.
sruthi laya

Joined: Oct 15, 2008
Posts: 7
Hey guys ,

I got my java program executed , but still facing a problem with tomcat.
it is not starting .

Anyway thanks a lot
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45302
Well done ( ) so far.

I think this is turning into a Tomcat-related question, so would sit better no the Tomcat forum . . . moving.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Your JAVA_HOME is still wrong - it should be without the 'bin' folder

Like this: JAVA_HOME=C:\jdk1.3

Regards, Rene Larsen
Dropbox Invite
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13025
How was tomcat installed - unzipping a zipped package or installing as a service?
How are you trying to start Tomcat?
What happens when you do?
What operating system is this? If you are stuck with Windows98 then you are probably running into the environment space problem.

Don't get me started about those stupid light bulbs.
subject: Exception at runtime
It's not a secret anymore!