possible that eclipse does not have the correct jar defined. did you try to add the tools.jar needed for ant?
preferences > ant > runtime
for me, i just delete the metadata folder and start eclipse with import all of your library project. check your ant class path and add this jar again. thanks
in my case ant home was pointing to a symbolic link (to a real ant installation). eclipse didn't like that. updating to the actual installation folder solved the issue.
i had this problem recently (then a colleague) in eclipse when running an ant script from the ui interface (context menu,
run as or
due to some reason, the runtime jre for the ant script (or for ant itself, unclear at this point) got changed. this runtime jre can be changed from the context menu for the ant script,
external tools configurations...:
then move on to the jre tab on the right side:
my colleague had the
separate jre setting wrong, changed it to the proper jre setting (jdk 1.8_xxx in his case). this was after a merge, where apparantly some incorrect settings were merged into a branch (or so we think).
in my case, i think i had this set as
run in the same jre as the workspace which was wrong. i also set this to
separate jre, chose the proper 1.8 jdk and that fixed the issue. this was after an upgrade of the eclipse version (as i recall).
i have had same problem, probably caused by switching between two versions of eclipse but using same workspace. this has worked safely for some time, but suddenly, the exception was raised.
i deleted the .metadata folder in the workspace folder.
i set up my workspace again: close all the annoying useless eclipse default tabs, import existing project, set ant home directory in ant...run configurations etc.
i had the same error; switched workspace from eclipse indigo to eclipse kepler. i was able to resolve it by resetting the ant_home value. it was originally pointing to the correct folder, but i just reset it to the same folder and clicked on 'apply'. works fine now. hope this helps.
in my case :
- no log in eclipse, just message : java virtual machine launcher : a java exception has occured.
due to the re-use of a old workspace with a different eclipse version, i solved by replacing all jar dependency in ant->runtime->classpath->ant home entries (default) by reals and existing jar (from my eclipse-jee-kepler-sr1-win32-x86_64\eclipse\plugins\org.apache.ant_1.8.4.v201303080030\lib)
it's explain on : https://bugs.eclipse.org/bugs/show_bug.cgi?id=102463#c41
for me the problem were the jdk i were trying to use. the project i wanted to build was setup to use the 1.6 jdk. i got the same error as the questioner, but when i changed to java 8 the build worked fine. so i am assuming that the ant version that comes with newer versions eclipse does not work with older jdks.
ide like (eclipse-oxygen) will have default ant versions. if your ant build xml is not compatible with higher version of ant.
lower/higher the ant version to the suitable one. jdk is not compatible with all ant builds. for instance, ant 1.9.2 is the last version to support java 7.
so we need to match the jdk version and ant version's respectively. override the ide default version using preferences -> ant -> runtime -> click on ant home (and choose the new version of ant home there, that will override the ant home entries)
i had the same problem and it kept me a while to figure out what the solution is. i followed all the suggestion on this page and similar pages; nothing helpt! i uninstalled and installed jdk, eclipse, reset my project, i forced eclipse clear it's parameters, ...; no success.
what finally fixed my problem was deleting the .metadata directory in the workspace folder. i don't know what eclipse keeps in there, but deleting the .metadata direcotry caused eclipse reinitiate every setting. i did have to reimport my project structure. it works again like a charm. no vague 'there is an exception occured' error message.
this is most likely due to difference in ant version being used by eclipse. please update ant_home in eclipse . window --> preferences --> ant --> runtime --> classpath -->click ant home.. and try to locate the latest version of ant directory location. this works for me :)
- Ant not working in Eclipse Kepler (Java Virtual Machine Launcher - A Java Exception has occured)
- eclipse not working - No java virtual machine was found
- Running Ant Build.xml getting: Java Virtual Machine Launcher: Could not find the main class. Program will exit
- How to fix Eclipse Java Virtual Machine Launcher Error?
- Can not create java virtual machine popup message in eclipse
- Eclipse Oxygen Upgrade - "Java Virtual Machine Launcher - A Java Exception has occured)"
- Eclipse Java Virtual Machine Launcher jvm.cfg Error
- "Error: Could not create the Java Virtual Machine Error: A fatal exception..." Shows error when I tried to launch Eclipse IDE 2019-06
- eclipse not opening, gives error saying no java virtual machine found
- Eclipse - no Java (JRE) / (JDK) ... no virtual machine
- eclipse won't start - no java virtual machine was found
- How to solve could not create the virtual machine error of Java Virtual Machine Launcher?
- Eclipse autocomplete not working in some Java files
- Eclipse - Failed to create the java virtual machine
- Eclipse Java Content Assist not working
- Eclipse Kepler - PHP Code completion not working
- apache tomcat 9.x not working with eclipse & Java 10.0.1
- Starting Eclipse results in Failed to create Java Virtual Machine
- java application not working with java9 and eclipse
- Eclipse Java 11 classpath only not working compared to Maven
- No java virtual machine was found in Eclipse
- Java virtual machine launcher error- A java exception has occurred
- Eclipse content assist not working for Java objects within Groovy files
- Eclipse code fomatter not working for Java Generics code?
- Scala IDE not working properly in Eclipse Luna for Java EE
- Java project working on Eclipse but not working when exported to runnable jar file
- Eclipse Failed to create the Java Virtual Machine
- Java Eclipse android-XML editor (graphic display) is not working
- Eclipse not working after deleting a version of java
- UTF-8 encoding not working with Eclipse java application
More Query from same tag
- Simple find/replace using regex in Eclipse
- Fetch all projects under a GITHUB repo
- GGTS 3.1 (Eclipse) Search view is not working
- Showing error that platform name cannot be resolved even i added all the required files regarding to it
- Eclipse Warning When I try to run a GAE project
- Qt jambi Eclipse integration problem
- Where do you put -Dvar=value arguments in Eclipse debug configurations?
- Android - Image button size
- Delete android sqlite database file
- IBM Worklight 6.1 - Uncaught ReferenceErrors: WLJQ is not defined, WL is not defined
- SVN update not working
- Play 18.104.22.168: How to find currently used port for debugger?
- How to create executable (.exe) file for any platform using Sikuli-script + Java + Eclips IDE
- JHipster Eclipse Plugin Error
- Can we use mvn build command through command line
- Eclipse Dynamic Web Module and Apache Wicket
- Compiler version changes when eclipse crashes
- If-else blocks not returning true on a condition that is clearly true, what do I do?
- Target definition file - Plugins downloaded location
- How to use text/html in a BPMN documentation/textAnnotation element
- Cant copy all files using cp command
- I can't see my other projects in Eclipse!
- Eclipse debugging not working properly with ART runtime
- Eclipse is telling me a cycle was detected in the building path, but that's not true!
- Error while importing android packages class
- ActiveMQ: Error while loading shared libraries
- constant eclipse crashes
- Groovydocs on Eclipse
- Eclipse xmlFiles content is not allowed in prolog error
- Cannot add API properly in eclipse