Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java virtual machine launcher error- A java exception has occurred

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

like image 542
user3290189 Avatar asked Feb 13 '23 20:02

user3290189


2 Answers

For me, I just delete my metaData folder and start eclipse with importing all the necessary project and library files.

like image 138
Omar Faroque Anik Avatar answered Apr 27 '23 03:04

Omar Faroque Anik


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.

like image 36
Lucky Avatar answered Apr 27 '23 04:04

Lucky