I've written the following program and have compiled and got the class file in "C:/jdk1.5/bin/myproject/classes/a/first/" directory and now when I'm trying to run this program its giving "java.lang.NoClassDefFound" . Plz tell what should I do.
I've stored the .java file in "myproject/a/first" directory in bin folder.
First off, it's probably best not to store your Java project files in the java/bin directory as it can get pretty full, and also you won't get to experience the full fun of classpaths unless you deploy code outside of you Java directory
In answer to your question - are you compiling in the correct directory? (in your post I noticed that you stated two different locations in which your temp1.java file was)
If your temp1.java file is the C:/jdk1.5/bin/myproject/classes/a/first/ I would make sure you are located in the C:/jdk1.5/bin/myproject/classes folder and then try executing
Please don't repost the same question in another forum, even if an ungodly time period like two hours has passed without your getting an answer that is satisfactory to you. Perhaps the fact that it is Saturday has something to do with it. I've deleted your duplicate post.
Perhaps you haven't gotten additional answers because Daniel has already done an excellent job of responding to your question, but for some reason that's unclear to me, you've chosen not to respond to his counter-questions. Answer them, and he (or someone else) is likely to continue to help you understand this material. We can't explain to you what you are misunderstanding until we can figure out what you're thinking right now. While you're at it, you might show us what actual command line you used, so we can tell you how to modify it.
I'm really sorry if my reposting the same question in another forum offended you. I'll wait for the answers but I've already scheduled my exam on 19th of this month and I'm doing really bad in classpaths question thats why got little panicky which happens to everyone if they'll have the exam so close.
Joined: Feb 08, 2006
For compiling I'm giving the following command at "C:\jdk1.5\bin>" prompt: