944,117 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 3194
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Jun 16th, 2005
0

Exception in thread "main".lang.NoClassDefFoundError:

Expand Post »
Hi friends

I m new to this site.
I have got a problem.
I cant run Java program on my PC.
If anyone can help plz reply.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manisha is offline Offline
21 posts
since Jun 2005
Jun 16th, 2005
0

Re: Problem with java

Check your environment variables:
I posted this in a previous thread:

Java Syntax (Toggle Plain Text)
  1. Considering you have windows:
  2.  
  3. Goto start--->right click on my computer--->select properties
  4. Goto the advanced tab, and you should see a button at the bottom that says environment variables...click on that.
  5.  
  6. The only thing you need to worry about is the PATH variable, and the CLASSPATH variable, nothing else.
  7.  
  8. SKIP THIS STEP AND GO ON TO THE CLASSPATH, IF IT DOESN'T WORK AFTER SETTING THE CLASSPATH, THEN COME BACK AND SET THIS.
  9. The path variable must point to the bin folder in the sun app server, and the bin folder in the jdk directory. Now, those are two different directories, so you seperate them with a semicolon when creating it. Here is what mine looks like:
  10.  
  11. C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0\bin
  12.  
  13.  
  14.  
  15.  
  16. Classpath....This points to the tools.jar file in the jdk directory. It's pretty easy to find. Here is what mine looks like:
  17.  
  18. .;%classpath%.;C\Program Files\Java\jdk1.5.0\lib\tools.jar
  19.  
  20. Your's will look similar, although you do not need the .;%classpath%.; statement.
  21.  
  22.  
  23. Next, you need to know how to access your files at the command line.
  24.  
  25. To do so, you simply type cd/folderName at the command line. The cd stands for current directory. My folder was named javawork, so to access it, I did this at the command prompt:
  26.  
  27. cd/javawork // brings me to the right directory
  28. javac Hello.java //compiles my program
  29. java Hello //runs my program
  30.  
  31.  
  32. Let me know if you don't undestand something or need more help.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jun 17th, 2005
0

Re: Problem with java

Hi everyone,

Quote originally posted by server_crash ...
Check your environment variables:
I posted this in a previous thread:

Java Syntax (Toggle Plain Text)
  1. Considering you have windows:
  2.  
  3. Goto start--->right click on my computer--->select properties
  4. Goto the advanced tab, and you should see a button at the bottom that says environment variables...click on that.
  5.  
  6. The only thing you need to worry about is the PATH variable, and the CLASSPATH variable, nothing else.
  7.  
  8. SKIP THIS STEP AND GO ON TO THE CLASSPATH, IF IT DOESN'T WORK AFTER SETTING THE CLASSPATH, THEN COME BACK AND SET THIS.
  9. The path variable must point to the bin folder in the sun app server, and the bin folder in the jdk directory. Now, those are two different directories, so you seperate them with a semicolon when creating it. Here is what mine looks like:
  10.  
  11. C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0\bin
  12.  
  13.  
  14.  
  15.  
  16. Classpath....This points to the tools.jar file in the jdk directory. It's pretty easy to find. Here is what mine looks like:
  17.  
  18. .;%classpath%.;C\Program Files\Java\jdk1.5.0\lib\tools.jar
  19.  
  20. Your's will look similar, although you do not need the .;%classpath%.; statement.
  21.  
  22.  
  23. Next, you need to know how to access your files at the command line.
  24.  
  25. To do so, you simply type cd/folderName at the command line. The cd stands for current directory. My folder was named javawork, so to access it, I did this at the command prompt:
  26.  
  27. cd/javawork // brings me to the right directory
  28. javac Hello.java //compiles my program
  29. java Hello //runs my program
  30.  
  31.  
  32. Let me know if you don't undestand something or need more help.
I could not have said it better myself

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Jun 17th, 2005
0

Re: Problem with java

I could: see the installation instructions
They're quite comprehensive for a variety of platforms.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jun 17th, 2005
0

Re: Problem with java

Hi
Thanx for a reply.I hav already tried to set the path and the classpath. But its still not working.by the way
My path is: c:\matlab\bin;c:\bin;C:\Program Files\ESTsoft\ALZip\;C:\Program Files\Java\jdk1.5.0\bin
& the classpath is:"C:\Program files\java\jdk1.5.0\lib\tools.jar"
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manisha is offline Offline
21 posts
since Jun 2005
Jun 17th, 2005
0

Re: Problem with java

Quote originally posted by jwenting ...
I could: see the installation instructions
Dont be a party pooper!


Anyways, try adding a period to the end of the classpath:

C:\Program files\java\jdk1.5.0\lib\tools.jar.


Get it. Got it. Good.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jun 17th, 2005
0

Re: Problem with java

Thanx for ur suggestion.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manisha is offline Offline
21 posts
since Jun 2005
Jun 17th, 2005
0

Re: Problem with java

Quote originally posted by manisha ...
Thanx for ur suggestion.
did it work?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jun 21st, 2005
0

Re: Problem with java

Quote originally posted by server_crash ...
did it work?
Thanx for ur help but it havnt worked yet.
I dont know what the hell is the problem here.
It did work one yr back but now i m unable to work it out.
anyways thanx.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manisha is offline Offline
21 posts
since Jun 2005
Jun 21st, 2005
0

Re: Problem with java

You should have let me know that it still wasn't working. These problems can take a while to fix.

Now, if you tried putting the period at the end of the .jar extension(.jar.) and it didn't work, try adding this at the VERY beginninng:

Java Syntax (Toggle Plain Text)
  1. .;%classpath%.;
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Please help me!!!
Next Thread in Java Forum Timeline: java option for backward compatibility





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC