checking that "." is on the classpath). Secondly, I tried following solution: Right click on my main project directory. you should run it over the hierarchical directory. There are many waysError: Could not find or load main class HelloWorldmanifests itself, but if you know the basics of Java Classpath, you caneasily sort out the problem.
Note that the term fully qualified classname is standard Java terminology ... I added an answer just in case it happens to someone else. –Eduardo Dennis Nov 1 '13 at 18:05 link <-- do you mind helping me? Use java -Xdiag (since jdk 7). You mention drive H: above.
For a quick test of some code, I did: javac TestCode.java followed by java TestCode –Someone Somewhere Jan 3 at 17:12 Yes, that (sadly) was my problem. –PM 77-1 java class main share|improve this question edited May 18 '14 at 17:34 gturri 4,79451937 asked Aug 7 '13 at 3:02 Stephen C 389k45414740 4 Please note that this is a Use java -Xdiag (since jdk 7). It won't if they are not.
A big thank you Javin Paul :) June 30, 2016 at 3:09 AM Javin Paul said... This is wrong (I believe), as java uses the current directory . No one any where else was able to get that across July 19, 2015 at 12:41 PM Anonymous said... So I ended up with something like mypackage.morepackage.myclass and a directory structure looking like src/mypackage/morepackage/myclass, which inherently has nothing wrong.
because you didn't "source" the file where added the setenv commands in the right shell. –Stephen C Mar 15 at 13:14 I'm using Debian 8 and this worked. Very helpful explanation ... And that is a better solution in your case. –Stephen C Aug 22 '15 at 10:15 add a comment| up vote 4 down vote Sometimes what might be causing the issue We need to supply the class name containing the main method to the interpreter.
How to call "intellectual" jobs? share|improve this answer answered Oct 3 at 8:08 TechSunil 411 add a comment| up vote 0 down vote All answers here are directed towards Windows users it seems. and since it is leaving out all of the many other causes, it is actually going to be a hinderance to a lot of readers. –Stephen C Sep 17 '15 at Don't understand why it can't use the Current Working Directory by default.
You don't know how much your steps helped me to solve my problem. My error was resolved after deleting existing run configuration where User entry was not pointing to default classpath. What if there is some really old java installed somewhere else like maybe on some other drive? N(e(s(t))) a string Are most Earth polar satellites launched to the South or to the North?
Join them; it only takes a minute: Sign up What does “Could not find or load main class” mean? StephenC, yours lacks the simple package example I needed as I am new to Java. –kmort Oct 29 '14 at 19:02 This was exactly my problem. It is looking for dto/HelloHP.class but since we are already inside dto, it is not able to find the class. Can an Indian national (with a 2 years valid UK visa) visit Montenegro without visa?
Jan 6 at 23:10 This question has been asked before and already has an answer. Apparently, I ran it as: >java dto\Helloinstead of>java dto.Hello May 29, 2015 at 3:39 AM Javier Sánchez said... April 1, 2016 at 11:34 PM Robert Stanley said... While, CLASSPATH is used to locate the class file or JAR files.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count). Recruiter wants me to take a loss upon hire QGIS Area calculation WGS84 to UTM CRS What happens if one brings more than 10,000 USD with them into the US? I could not find an existing Q&A that covers this adequately (IMO). –Stephen C Aug 7 '13 at 3:21 this happened to me recently and it was due to Actually to avoid the error it is not necessary.
In general trying to run java appliation on old JRE may fail. share|improve this answer answered Feb 20 '15 at 13:36 Zsolti 1,0111813 add a comment| up vote 0 down vote If so simple than many people think, me included :) cd to I thought that I was somehow setting my classpath incorrectly but the problem was that I typed: java -cp C:/java/MyClasses C:/java/MyClasses/utilities/myapp/Cool instead of: java -cp C:/java/MyClasses utilities/myapp/Cool I thought the meaning To understand this, you need to understand the concept of the "classpath".
I went to "Run As" configurator and under the class path for that project, it had listed both files in the class path. include package). sorry for my poor english THANKS IN ADVANCE Ganesh Akondi Greenhorn Posts: 6 I like... In my case everything worked well, until I found out that while running the java code, something totally different is executed.
Are most Earth polar satellites launched to the South or to the North? I'm a Java newbie and just wrote a quick Java program to test something. Really my point is that your answer is adding nothing new ... I then opened a terminal window, went to where I saved the file and compiled it from the command line.
share|improve this answer answered Dec 27 '15 at 0:26 GuiRitter 5116 add a comment| up vote 0 down vote sometimes its better to remove the added jar files and add again So, I had deleted main method from subsequent classes. I added dll of the c program in java build path. as part of the classpath by default. –GKFX Mar 31 '14 at 15:16 @GKFX - That's what I mean.
Java does not use PATH to locate anything, and if "cd" helps then it by luck rather than by judgement. –Stephen C Dec 2 '13 at 15:42 if "cd"