Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 29th, 2004, 06:03 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help (Java) !....

Always when I try to run a Java Program a get this error:

<center>Exception in thread "main" java.lang.NoClassDefFoundError: <the class Name></center>

Thanks Gika

Reply With Quote
  #2 (permalink)  
Old March 29th, 2004, 06:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This error means that your classpath is not set up correctly.

Cheers

Martyn
Reply With Quote
  #3 (permalink)  
Old April 2nd, 2004, 12:07 PM
Authorized User
 
Join Date: Apr 2004
Location: Redmond, WA, USA.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to partho_choudhury Send a message via Yahoo to partho_choudhury
Default

ya, check with running the java/javac commands (without arguments) in the command line from an arbitrary path. If these commands are not recognized from all the paths, then your path variables have not been correctly set, and need to be done so.

Partho
Reply With Quote
  #4 (permalink)  
Old April 10th, 2004, 02:25 AM
Registered User
 
Join Date: Apr 2004
Location: , , China.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If your program has not got the right 'main' method or has no the
'main' method this error will occur though you compile it well.

cheers

wujie

Reply With Quote
  #5 (permalink)  
Old June 14th, 2004, 02:35 AM
Registered User
 
Join Date: Jun 2004
Location: seremban, negri sembilan, Malaysia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do sent some piece of code if u can. i believe a lot of member can help look into it.

Reply With Quote
  #6 (permalink)  
Old July 29th, 2004, 07:17 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

Check the mismatch of case between the java program/class name and in the command prompt invoking name

like "HelloWorld.class" is the class name and java file name should be "HelloWorld.java"

and command line parameters of execution should be "java HelloWorld"

ext. java to Java may also produce this error


Reply With Quote
  #7 (permalink)  
Old August 27th, 2004, 10:23 AM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you don't set your classpath and path collectly ,in windows ,if your jdk is instanlled in c:\j2sdk1.4.0.you can set your path c:\j2sdk1.4.\bin;.
don't forget .it means your computer will find command in your
currently path .
then you set classpath refer to the class file you make .
Reply With Quote
  #8 (permalink)  
Old September 24th, 2004, 12:08 PM
Authorized User
 
Join Date: Aug 2004
Location: cluj, romania, Romania.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to olupas
Default



Watch out for the package....of course after set your classpath and path collectly in autoexec.bat or under windows XP in Envoirement Variables
(wright click MyComputer\Properties\Advanced)


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
java.lang.OutOfMemoryError: Java heap space meetkotresh J2EE 1 February 2nd, 2008 01:52 AM
Java Media Framework(I am new to java) amirdiwan4eva Pro Java 4 July 12th, 2006 04:50 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM
Java vs Java Script functions joemorrison74 J2EE 0 July 6th, 2005 04:28 PM



All times are GMT -4. The time now is 09:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.