Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Could not find or load main class com.google.gwt.dev.Compiler while compiling a GWT project

Whenever I try to compile any of my GWT application the compilation fails with the error message "Error: Could not find or load main class com.google.gwt.dev.Compiler". This problem started after I made some changes to the path and classpath environment variables while installing Tomcat, I don't know whether these changes caused the problem. I tried to reinstall GWT plugin but all in vain. Any help would be greatly appreciated. I am using Eclipse 4.3 and GWT SDK 2.6.0.

like image 917
Mayur Jadhav Avatar asked Mar 20 '14 15:03

Mayur Jadhav


People also ask

Could not find or load main class com google gwt dev compiler?

Try Run As > Run Configurations , delete the current configuration by clicking on the X top left. Apply and close. Now, Run As > Web application . A default configuration will be created.

What is GWT compiler?

The heart of GWT is a compiler that converts Java source into JavaScript, transforming your working Java application into an equivalent JavaScript application. The GWT compiler supports the vast majority of the Java language. The GWT runtime library emulates a relevant subset of the Java runtime library.


4 Answers

Try Run As > Run Configurations, delete the current configuration by clicking on the X top left. Apply and close. Now, Run As > Web application. A default configuration will be created.

If you have any VM arguments, copy them before doing the steps above.

like image 168
Momo Avatar answered Oct 26 '22 11:10

Momo


Check things as mentioned in below snapshots:

check whether Main class is having value com.google.gwt.dev.DevMode or not.

Go To Run Configuration >

enter image description here

Go To Project Properties > Build Path

Check whether GWT SDK is installed properly or not

enter image description here

like image 35
Braj Avatar answered Oct 26 '22 11:10

Braj


I would recommend creating maven or ant scripts to build outside eclipse.

This way other developers in your team, that maybe don't use eclipse can also build/run the application.

like image 1
Knarf Avatar answered Oct 26 '22 12:10

Knarf


set the "classpath" environment variable = %gwt_installed_dir%

"classpath" environment variable = %gwt_installed_dir%

like image 1
shyangs Avatar answered Oct 26 '22 12:10

shyangs