Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics 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 November 6th, 2005, 09:05 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using SDK

Hello,

I am a Java beginner. I am running XP and have
downloaded J2SE SDK from the SUN web site.
The SDK is installed directly under my C-drive,
It looks like:
          C:\j2sdk1.4.2_10 with subdirectories
bin (containing java.exe) and lib (containing tools.jar).

I have included C:\j2sdk1.4.2_10\bin in the Path. I have
also created Classpath = C:\j2sdk1.4.2_10\bin.

I am now able to compile text files (.java) to .class files
using the command line (DOS window).

I have a very simple program called Hello and I keep Hello.java
and Hello.class in C:\Workspace.
However, when I try to run the .class file I get:

C:\Workspace>java Hello (return)
Exception in thread "main" java.lang.NoClassDefFoundError: Hello

C:\Workspace>_

I dont think there is anything wrong with the code in 'Hello' because
I have tried tried other demo .class files and I get the same error.

Anyone any idea what I could do about this? (I want to get down
to writing code!).

Thanks, Ernie



Reply With Quote
  #2 (permalink)  
Old November 6th, 2005, 11:08 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its either because you did not name the file Hello.java , you may mistakenly have used hello.java and java is case sensitive.

Reply With Quote
  #3 (permalink)  
Old November 6th, 2005, 11:10 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

or you have inside your code a class named "hello" instead of "Hello"

Reply With Quote
  #4 (permalink)  
Old November 10th, 2005, 11:37 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, I have rewritten and recompiled everything
in lower case only (hello) and I still get the
same error message. Any other suggestions?

Ernie.

Reply With Quote
  #5 (permalink)  
Old November 11th, 2005, 12:29 AM
Registered User
 
Join Date: Oct 2005
Location: , , USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear E,
If you post your code it would help. But, from the error, did you have your class "main(String[] blaa blaa" set-up correctly like:

"public class Hello {

public static void main(String[] args) { "

Just check it out, and otherwise post your code so we can help you out.

Reply With Quote
  #6 (permalink)  
Old December 29th, 2005, 04:53 AM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got it .Thank you




http://www.jvsoft.org
http://www.jvsoft.org

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
Sdk Development pkhussain Reporting Services 0 January 16th, 2007 04:17 AM
Downloading SDK 1.4 ironchef Java Basics 0 August 31st, 2006 04:51 PM
Please Define SDK eberly General .NET 2 April 10th, 2005 04:49 PM
Direct X SDK krishnabhargav General .NET 0 September 21st, 2004 08:42 AM
Longhorn SDK stu9820 ASP.NET 1.0 and 1.1 Professional 0 May 13th, 2004 12:59 PM



All times are GMT -4. The time now is 04:40 AM.


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