Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Compiling, but not running !!!

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am facing problem in runningthe class file. I can able to compile the java files, but while compiling I am getting error.

I had successfully compiled and ran the java programs before I started learning Servlets and JSP. For Servlets and JSP, I included the CLASSPATH.

Now, I can't able to ran the class file and It's compiling. I am getting the following error:

Exception in thread "main" java.lang.NoclassDefFoundError: HelloWorld

In fact I tried ro run the simple program Hello World.

 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CLASSPATH=??
 
Niyas Ahmed Sheikh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my autoexec.bat file
----------------------------
SET PATH=C:\JDK1.5\bin;%PATH%
SET JAVA_HOME=C:\JDK1.5;
SET CATALINA_HOME=C:\Tomcat;
SET CLASSPATH = .;C:\Tomcat\common\lib\servlet-api.jar;C:\Tomcat\common\lib\jsp-api.jar%CLASSPATH%
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you running this from the same folder as the .class file? If not then you will need to specify the path of the file when you use javac.

Steve
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SET CLASSPATH = .;C:\Tomcat\common\lib\servlet-api.jar;C:\Tomcat\common\lib\jsp-api.jar%CLASSPATH%

Also (maybe a typo), you need a semicolon between "jsp-api.jar" and "%CLASSPATH%"
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic