Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Ant Build.xml getting: Java Virtual Machine Launcher: Could not find the main class. Program will exit

I am writing my code in eclipse, the code is running fine but when I try to build it in ant by running build.xml. I am getting

Java Virtual Machine Launcher: Could not find the main class. Program will exit.

Any suggestions?

like image 327
topcan5 Avatar asked Jul 02 '13 04:07

topcan5


1 Answers

if you are using java 1.6 and upgraded eclipse, it's more likely caused by eclipse the solution is to go to Run as → External tools configuration… → JRE where the default was set to “Separate JDK”: jdk1.6.0_31 and change this to “run in the same JRE as the workspace” (1.7/1.8), and it should works.

Bug fix would be to provide a working default configuration with setup. Configuration should be in a way it does not break if the user adds additional JDKs to Preferences.

for more details you can see Bug 472599

like image 186
Seif Tml Avatar answered Oct 05 '22 04:10

Seif Tml