•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 397,834 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,519 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 99666 | Replies: 58
![]() |
•
•
Join Date: Apr 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by server_crash
Actuallly, when you find the folder containing the source file(.java), you should notice the .class file is not in that same folder. If it is, then we have problems!
Hi, I'm a brand new newbie following this thread with great interest. I can run the "HelloWorldApp" just fine at the DOS command line; but, I want to learn to use NetBeans IDE. When I plug HelloWorldApp.java into NetBeans it compiles successfully into the same folder; however, when I try to run I get the above error message, followed by the encouragement "BUILD SUCCESSFUL" (no "HelloWorld" output, however). I've tried futzing around with the classpath stuff till I'm blue in the face! It can't be this hard! Any ideas?
Thanks
•
•
Join Date: Apr 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Guys, I finally got "HelloWorldApp" to work from within NetBeans IDE. It appears my problem was that I had put both HelloWorldApp.java and HelloWorldApp.class (from an earlier DOS prompt compile) directly into the project path. Therefore, when I ran the code within NetBeans I got a new "build" with only the compiled code, and not the source; I was confused because my original source and class file were still together in their original place - so I didn't understand why Java couldn't find the source. Anyway, I obviously have a lot to learn! If anyone can suggest a way I can clear up my considerable confusion about how this all works, I would be eternally gratefull!
•
•
Join Date: Jun 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
hi i am getting this error too but i dont use command line (and dont plan to) im using textPad, and i installed it after i installed the jdk, so even after reading these helpful post i still dont understand where my problem is. the .java file is in the same folder as the .class. im not that new to java, but i've just begun to work at home and am unfamilier with setting up the editor and such to make it work (at school it was already good to go
)
) •
•
Join Date: Mar 2006
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Hey all,
i'm kinda having this same problem.. in fact i'm just trying to run in the DOS prompt. Codings written for Applets (appletviewer sach.html ) run perfectly in dos prompt, after i set the Classpath n all.
But, a simple java program, gives me this same error , when i try to run using >>java Sach
after successfully compiling using javac..
Exception in thread "main" java.lang.NoClassDefFoundError: Sach
i set my classpath to the following
path=C:\Program Files\Java\jdk1.5.0_05\bin
(btw, i guess this sounds correct ya? coz ,well the javac command works fine. It doesn't even give any compile errors).
i hope someone can help me out plz. it's really confusing..
Regards,
Sachitha
i'm kinda having this same problem.. in fact i'm just trying to run in the DOS prompt. Codings written for Applets (appletviewer sach.html ) run perfectly in dos prompt, after i set the Classpath n all.
But, a simple java program, gives me this same error , when i try to run using >>java Sach
after successfully compiling using javac..
Exception in thread "main" java.lang.NoClassDefFoundError: Sach
i set my classpath to the following
path=C:\Program Files\Java\jdk1.5.0_05\bin
(btw, i guess this sounds correct ya? coz ,well the javac command works fine. It doesn't even give any compile errors).
i hope someone can help me out plz. it's really confusing..
Regards,
Sachitha
•
•
Join Date: Jun 2005
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 0
It looks like you have set the PATH but NOT the CLASSPATH.
For CLASSPATH - just put a period in as the variable. Really. It's weird, but it works.
If you're not sure how to do this, let me know.
Good luck!
PS You might want to try to install JCreator instead - it's free, and you don't have to do all this nonsense - I don't think.
For CLASSPATH - just put a period in as the variable. Really. It's weird, but it works.
If you're not sure how to do this, let me know.
Good luck!
PS You might want to try to install JCreator instead - it's free, and you don't have to do all this nonsense - I don't think.
•
•
Join Date: Mar 2006
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
i set the PATH and CLASSPATH using the following link which was posted in this page itself
(http://www.cs.ucsb.edu/~teliot/Path_and_Classpath.htm )
but that's for jdk 1.5.0_02, but i'm having jdk 1.5.0_05...
i gave for the CLASSPATH a . (a fullstop)
Now how do i run programs in the Command prompt???
i just did like this...
javac <program>.java //now this worked without a problem
when i gave
java <program> //it gives the following error
Exception in "main" java.lang.UnsupportedClassVersion error
....etc etc...
plz tell me wut i should do , n why do i get such an error...
(http://www.cs.ucsb.edu/~teliot/Path_and_Classpath.htm )
but that's for jdk 1.5.0_02, but i'm having jdk 1.5.0_05...
i gave for the CLASSPATH a . (a fullstop)
Now how do i run programs in the Command prompt???
i just did like this...
javac <program>.java //now this worked without a problem
when i gave
java <program> //it gives the following error
Exception in "main" java.lang.UnsupportedClassVersion error
....etc etc...
plz tell me wut i should do , n why do i get such an error...
•
•
Join Date: Mar 2006
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
hey i kinda figured out a way to run simple java program (like hello world..)
set classpath=.
set path=.......\bin
but this program with packages n all wont work.. it compiles , but cant run
can someone plz tell me why???
i get the following error when i start to run with java command
Exception in thread "main" java.lang.NullPointerException
why is that?
set classpath=.
set path=.......\bin
but this program with packages n all wont work.. it compiles , but cant run
can someone plz tell me why???
i get the following error when i start to run with java command
Exception in thread "main" java.lang.NullPointerException
why is that?
•
•
Join Date: Aug 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
My command prompt doesn't recognize neither CLASSPATH nor JAVA_HOME commands...I've already set the path variable but when i'm goiong to set the classpath and java_home variables it says that they are not recognized as an intern or extern command etc...
Could anyone please help me?
(I'm portuguese; sorry for my english...)
Could anyone please help me?
(I'm portuguese; sorry for my english...)
Last edited by dir : Aug 23rd, 2006 at 8:11 pm.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
Other Threads in the Java Forum
- Previous Thread: Assigning Array Values En Masse
- Next Thread: Q. Lotus Notes + Java?


Linear Mode