Error: could not find or load the main class in Eclipse

I am having problems starting a project in Eclipse 4.2. I have a single class Java program called Conversion. Eclipse is building a great project. I can run the program from the command line by going to the / bin / folder in the project folder, which is located in the workspace, and typing java Conversion .

However, when I try to run the program from Eclipse, the console displays Error: Could not find or load main class Conversion .

Project name 10.12.12: Project .

+6
source share
5 answers

Eclipse does not support the use of a colon or hyphen in project names. The columns seem to violate the way compilation is handled.

The problem can be fixed by using a colon in the project name.

As noted in the comments, this may be a Java 6 bug. It is fixed in Java 7.

+5
source

It seems that the project is not part of the class path.
Check your Run Configuration->Classpath , and if your project does not exist, add it under User Entries .

enter image description here

enter image description here

+6
source

Make sure the build path is configured correctly in eclipse. The paths for external JAR files may be incorrect.

0
source

Faced the same problem, but solved it.

I deleted some files that I did not delete from the build path. Make sure your project is error free :)

-1
source

This problem will increase. Keeping the file name with one name and compilation time if you have a different name. Then you will get this problem. Check java file name once.

-1
source

Source: https://habr.com/ru/post/925513/


All Articles