Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 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 May 20th, 2005, 03:26 AM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nitinnishi Send a message via Yahoo to nitinnishi
Default ERROR "Exception in thread "main" java.lang.NoClas

I have downloaded j2sdk1.4.2_08 and installed on my computer. The installtion run succesfuly and dir name j2sdk1.4.2_08 is created on c drive. I had written simple java program and compile, It cmpile but when I run using "java Program_name" at dos prompot it give error "Exception in thread "main" java.lang.NoClassDefFoundError: "
what is prob.

and also tell what is difference between j2sdk and jdk installation

thanks

 
Old May 31st, 2005, 07:15 AM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:java.lang.NoClassDefFoundError
Probably because you are compiling source code which requires a library that does not come with the JDK. Try searching Google for the particular class you are missing and download the library that contains it. To include a library during compilation use the -classpath argument:

Code:
javac -classpath /mylibs/somelib.jar Program.java
Quote:
quote:and also tell what is difference between j2sdk and jdk installation
The J2SDK is the same thing as JDK. Sun Microsystems uses the two names interchangably. J2SDK = Java2 Software Development Kit. JDK = Java Development Kit.
 
Old June 7th, 2005, 04:36 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

It could also be that you haven't got your classpath environment variable set.

If you run:
 java -cp . YourClassname
In the directory in which YourClassname.class is stored and that makes it work then this is the problem. See the section on setting CLASSPATH here:

http://www.gscit.monash.edu.au/stude...env_space.html

(assuming you're using windows)

Cheers,
Charlie

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
 
Old June 17th, 2006, 07:07 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to bugtook
Default

where can i find somelib.jar so that i can put this file to my java lib.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception in thread "main" javax.xml.transform.Tra XSLTUser XSLT 1 December 29th, 2007 04:59 AM
"java.lang.classNotFound Exception:org.gjt.mm.mysq anwarraja Java Databases 4 September 12th, 2007 11:04 PM
"Exception in thread main java.lang.Noclass Def Fo anwarraja Java Databases 1 September 4th, 2007 07:19 AM
error:exception in thread main java.lang.noclassde sara.j JSP Basics 0 December 13th, 2006 12:35 AM
Exception : java.lang.NoClassDefFoundError haifriends J2EE 1 July 26th, 2006 07:22 PM





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