Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in Eclipse launch configuration: GrammaticalStructure.1 references non-existing project begins

Tags:

java

eclipse

I have created a java project following these steps:

1.File->java project
2. Created the package.
3. Created the main class.

Wrote the simple program to print hello world

 package misc;
 public class MyMainClass {
    public static void main(String[] args) {
        System.out.println("Hello World");
           }
     }

but I get the error when I run the program

Launch configuration GrammaticalStructure.1 references non-existing project begins.

Could you please let me know what can be the reason for it?

like image 545
thetna Avatar asked Dec 24 '11 13:12

thetna


3 Answers

Please try to run it by right-clicking on your source file and select: "Run As -> Java Application".

like image 82
Francis Upton IV Avatar answered Sep 28 '22 14:09

Francis Upton IV


You can right-click on your project and select "Run As"->Run Configurations.you can edit the "Main class"

like image 29
user660393 Avatar answered Sep 28 '22 14:09

user660393


Right-click on "src" folder of your project then "Run As"->"Run Configurations" then change the "Main class" option with the name same as your driving code name. This happens because there may exist more than one main classes in the same project may be due to some testing requirement or by mistake.

like image 34
Apurva Sharma Avatar answered Sep 28 '22 15:09

Apurva Sharma