Home > Could Not > Java Error Could Not Find The Main Class

Java Error Could Not Find The Main Class


since your main class is inside com.jni package, you must run outside that directory and provide a fully qualified name e.g. My error was resolved after deleting existing run configuration where User entry was not pointing to default classpath. I realize that. August 15, 2015 at 8:43 AM raghu said... his comment is here

Solution Cone 155,613 views 5:05 Loading more suggestions... You must not work with the public much. -- Trilby----How to Ask Questions the Smart Way Offline #3 2014-09-24 16:50:59 Marcel- Member From: Utrecht, NL Registered: 2006-12-03 Posts: 259 Re: [SOLVED] In my case everything worked well, until I found out that while running the java code, something totally different is executed. share|improve this answer answered Jun 30 '15 at 7:56 Nathan Williams 907 Wow!

Could Not Find Or Load Main Class Eclipse

It's on default package, and I have tried everything from cleaning the project, building the project and build automatically. This feature is not available right now. And why? In short, on average they DON'T help. –Stephen C Mar 8 '15 at 4:50 3 cd-ing back to the root folder of the java package was exactly the one solution

  1. JavaProgrammers 1,355 views 6:11 How to run java programs using command prompt - Duration: 8:09.
  2. All I did was copy the files into the package and Eclipse was then able to detect the main method.
  3. Do I need to type java -cp . every time I run a prog?
  4. Other References From the Oracle Java Tutorials - Common Problems (and Their Solutions) From the Java Documentation: The Java command - 'java' and 'javaw' The Classpath share|improve this answer edited Sep

Note that the term fully qualified classname is standard Java terminology ... Here's my path environment variable. Are you sure? Could Not Find Or Load Main Class Intellij So in the first try, I go there and execute java command to launch my program, as seen below: C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto>java HelloHP Error: Could not find or load main class HelloHP

Can you please describe your problem in little more detail? Error: Could Not Find Or Load Main Class Jar You need to build this skill by doing active development. Basically, there are two main causes: The first likely cause is that you may have provided the wrong class name. (Or ... C# does not use packages but it has things called namespaces which I think are similar.

Please try again later. Could Not Find Or Load Main Class Maven True Miller 7,793 views 3:16 ♣FIX♣ ……‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹nonexistent Java Runtime Environment - Duration: 6:15. Also try java -cp . Can an umlaut be written as a line in handwriting?

Error: Could Not Find Or Load Main Class Jar

Thanks. Server is the main class, contains main() method but somehow Eclipse is not able to find it. Could Not Find Or Load Main Class Eclipse I created a simple hello world program and used: java -cp HelloWorld and I got the output Hello world, so it must have executed fine actually the same thing is happening Could Not Find Or Load Main Class Netbeans April 2, 2016 at 8:53 PM Valerie said...

Regarding the work in that java directory, yes of course, I'll read your suggestions and fix that too. http://rsmasters.net/could-not/java-error-could-not-find-or-load-main-class-helloworld.html Loading... posted 2 years ago 1 Suppose by current directory you mean C:\java So you set your ClassPath variable to CLASSPATH = C:\java What you should have done was setting CLASSPATH to No one any where else was able to get that across July 19, 2015 at 12:41 PM Anonymous said... Error: Could Not Find Or Load Main Class Linux

Show more Language: English Content location: United States Restricted Mode: Off History Help Loading... to your classpath. Note that the windows classpath separator is a semi-colon ie ; share|improve this answer edited Jun 10 '13 at 1:25 Leigh 24.5k73668 answered Sep 20 '11 at 13:16 Saket 20.1k83969 44 weblink posted 2 years ago Thank you!

Dustin Wright Greenhorn Posts: 24 1 I like... Error: Could Not Find Or Load Main Class Scala About Press Copyright Creators Advertise Developers +YouTube Terms Privacy Policy & Safety Send feedback Try something new! Watch Queue Queue __count__/__total__ Find out whyClose HOW TO FIX COULD NOT OPEN OR LOAD MAIN CLASS IN JAVA RASTOR SCALE SubscribeSubscribedUnsubscribe1010 Loading...

Either add .

Windows (tested with 7) doesn't accept special characters (like á) in class and package names. add a comment| 23 Answers 23 active oldest votes up vote 184 down vote accepted You must ensure that you add the location of your .class file to your classpath. share|improve this answer answered Mar 8 '14 at 10:32 Maxim Geerinck 1,22731638 add a comment| up vote 2 down vote This problem occurred for me when I imported an existing project Error Could Not Find Or Load Main Class Spring Boot If you uninstall Java and install a new version, you may find your work vanish altogether.

This is explained well by the Oracle documentation: The java command documentation Setting the Classpath. PackageName/*.java java -cp . Don't understand why it can't use the Current Working Directory by default. http://rsmasters.net/could-not/java-error-could-not-find-or-load-the-main-class.html This feature is not available right now.

share|improve this answer edited Mar 23 '12 at 19:48 0605002 8,14321852 answered Sep 20 '11 at 13:24 ymutlu 3,37022030 add a comment| up vote 3 down vote Project > Clean and HelloWorld share|improve this answer edited Jan 21 '12 at 17:39 Yi Jiang 35.7k11105121 answered Jan 21 '12 at 17:17 Sudhakar Pabbati 47942 5 This works great. A big thank you Javin Paul :) June 30, 2016 at 3:09 AM Javin Paul said... BeerSong If it works with -cp that means you set your CLASSPATH to somethig that does not include current directory.

Here's the code, but again, it's un-edited sample code from the book. Two things i can think of not using the -cp option is 1.