Reputation: 49
I am a beginner. I am trying to run a java JDBC program in Eclipse with tomcat server. But when I run the program a pop up "Java virtual machine launcher" window with "A java exception error has occurred" is coming up.I think the code compilation is fine.
So how should I fix this problem.When I surf through different websites, some are saying that I should re-install java again . Is it true. Please help me with the answers.
Thanks in advance
Upvotes: 4
Views: 109512
Reputation: 1
I'm getting this exact same error when I try running the Danger Hiptop (T-Mobile Sidekick) simulator.jar file (I know, it's an old, outdated device, but I'm really into it). I have Java installed (plus, the right version), but as I open it through Java(TM) Platform SE Binary, it gives me this exact error.
Upvotes: 0
Reputation: 1
If you're trying to install Scala then you might have downloaded the wrong JDK.
For Scala you need to download JDK 8 Update 351.
Upvotes: 0
Reputation: 11
In my case, both JDK 1,7 and JRE 1.8 was present in the java build path>>library. I removed JDK 1.7, it resolves my problem.
Upvotes: 1
Reputation: 83
I faced the same issue with my Eclipse (currently using Eclipse Photon). While trying the metadata delete method did not work, as I am running on JDK 1.7, it seems that the current version of Ant is Ant 1.10, so setting ANT home to 1.9 solved the issue.
Go to Windows > Preferences > Ant > Runtime > Ant Home and then point to the version of Ant needed.
Upvotes: 2
Reputation: 91
I had the same problem occur when I cleaned my project as well as when it was trying to build. For me, the error was a mismatch between my ant version (1.10) and my default JRE (JDK 1.7). Apparently ant 1.10 is not compatible with JDK 1.7. Changing the default JRE to JRE 1.8.0 fixed the problem.
Window > Preferences > Java > Installed JREs > Add... > find the java 1.8 version, add it and then select the check box next to it. > OK
Upvotes: 0
Reputation: 366
As explained in some of the answers, removing the .metadata folder, present inside the workspace, works. But this issue can also occur if the package name starts with java. So typically java.example.com
would cause this error. You can use com.java.example
.
Upvotes: 0
Reputation: 17345
Problem reason
This problem occurs when you are copying the whole eclipse workspace from one System to another system(with a different JVM or configuration). The .metadata
folder inside your project's workspace folder contains the information about the runtime of your project.
Solution
Close eclipse if it is open and just delete the .metadata
folder under your eclipse workspace. Start you eclipse again and you will see the .metadata
is freshly created based on your current JVM configurations.
Upvotes: 3
Reputation: 1
The same virtual machine launcher error - java exception has occurred happened with me in eclipse .This error was due to the package name . I changed the package name and the problem solved. Java does not apply some package name using "java" keyword .
Upvotes: 0
Reputation: 2609
For me, I just delete my metaData folder and start eclipse with importing all the necessary project and library files.
Upvotes: 3