Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 29th, 2004, 06:03 PM
Registered User
 
Join Date: Mar 2004
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

 
Old March 29th, 2004, 06:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Cheers

Martyn
 
Old April 2nd, 2004, 12:07 PM
Authorized User
 
Join Date: Apr 2004
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
 
Old April 10th, 2004, 02:25 AM
Registered User
 
Join Date: Apr 2004
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

 
Old June 14th, 2004, 02:35 AM
Registered User
 
Join Date: Jun 2004
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.

 
Old July 29th, 2004, 07:17 AM
Friend of Wrox
 
Join Date: Jul 2004
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


 
Old August 27th, 2004, 10:23 AM
Registered User
 
Join Date: Feb 2004
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 .
 
Old September 24th, 2004, 12:08 PM
Authorized User
 
Join Date: Aug 2004
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)







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





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