[java] How to solve could not create the virtual machine error of Java Virtual Machine Launcher?

I am working on java wicket framework and Apache tomcat. Here I have Problem when i tried
to start tomcat it shows Java Virtual Machine Launcher pop window "Could not create the
Java Virtual Machine".
After clicking on "OK" button on Pop window it shows the error on console.

Error occurred during initialization of VM.
Could not reserve enough space for object heap.

Please give me any reference or suggestions.
Thanks in Advance.

This question is related to java eclipse version wicket tomcat6

The answer is


Error:

sony@sony-VPCEH25EN:~$ java --version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Solution: Remove extra hyphen '-'

sony@sony-VPCEH25EN:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Edit your Catlina.bat so that your -Xmx settings are less than your physical memory

See Tomcat 7: How to set initial heap size correctly?


On ubuntu (version 18), some application support java 8 and do not support java 11. If this is the case , you can switch to java 8 by following instruction on below topic : https://askubuntu.com/questions/1133216/downgrading-java-11-to-java-8


I was facing the same issue while i was using "jdk-10.0.1_windows-x64_bin" and eclipse-jee-oxygen-3a-win32-x86_64 on Windows 64 bit Operating System.

But Finally i resolved this issue by changing my jdk to "jdk-8u172-windows-x64", Now its working fine. @Thanks


  • Tap on Windows-Pause to open the System Control Panel applet. You can alternatively open the control panel manual to go there if you prefer it that way. Click on advanced system settings on the left.
  • Select environmental variables here.
  • Click on new under System Variables.
  • Enter '_JAVA_OPTIONS' as the variable name.
  • Enter '-Xmx1024M' as the variable value.
  • Click ok twice.

If none of the other options works, then this could be an issue with the version of the JDK itself, just uninstall the current jdk and install the latest version.

I too faced this issue, after trying everything I upgraded to latest JDK, then this issue was resolved finally.


I had the same issue today when running the ancient software Dundjinni, a mapping tool, on Windows 10. (Dundjinni requires a rather old installation of Java; I haven’t tried updating Java, for fear the programme will fail.) My method was to simply run Dundjinni in administrator mode. Here is how:

Click Start or press the Start key, navigate down to the software, rightclick the programme, choose More, then choose Run as administrator. Note that this option is not available if you simply type the name of the software.

enter image description here


I was also facing this issue when we upgraded from java 8 to java 10. I solved by removing -Djava.endorsed.dirs="C:\Program Files\Apache Software Foundation\Tomcat 8.5\endorsed" from the argument.


May be this can help you- Add the system variable _JAVA_OPTIONS and in the "new variable value" add "-Xmx1024M" Xmx sets the maximum heap memory size


For me it was picking the default JVM v6 set in env vars.

Needed to explicitly add below in eclipse.ini to use v8 which is req by photon.

-vm
C:\Program Files\Java\jdk1.8.0_75\bin\javaw.exe
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8

NOTE : Add the entry of vm above the vm args else it will not work!


I was facing the same issue while i was using JDK 1.8.0_05 64 bit and eclipse-jee-oxygen-3a-win32-x86_64 on Windows 64 bit Operating System.

enter image description here

Finally i resolved the issue by changing JDK version jdk1.8.0_05 to jdk1.8.0_172


The error does not say much and lot of things can be wrong. One thing that was wrong in my case was following

-x.DargName=108352123

Which is clearly wrong and should have been

-Dx.argName=108352123

I was facing the same issue, I was using tomcat 8.5 with Java 10.Finally I installed Java 8(1.8.0_171) and it's working fine without any issues


I had to add an older jdk on my project.

Right button on Project folder > Properties > Java Build Path > Libraries > Add Library > JRE System Library

enter image description here

enter image description here

In case you don't have the package for jdk8, download the jdk that some user mentioned above (http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-windows-x64.exe) and click on "Installed JREs" and search for the directory you downloaded the jdk8.

enter image description here

Then click on Finish.

Remove the apache server and add again.

The magic is done ;)


Install latest java jdk and your problem will be solved.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to version

Which TensorFlow and CUDA version combinations are compatible? How can the default node version be set using NVM? Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51 Which ChromeDriver version is compatible with which Chrome Browser version? How to find which version of TensorFlow is installed in my system? How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite? What does 'Unsupported major.minor version 52.0' mean, and how do I fix it? Find nginx version? How to check all versions of python installed on osx and centos How can I specify the required Node.js version in package.json?

Examples related to wicket

Scope 'session' is not active for the current thread; IllegalStateException: No thread-bound request found How to solve could not create the virtual machine error of Java Virtual Machine Launcher? How to resolve Error listenerStart when deploying web-app in Tomcat 5.5?

Examples related to tomcat6

There are No resources that can be added or removed from the server Proxy Error 502 : The proxy server received an invalid response from an upstream server HTTP Status 500 - org.apache.jasper.JasperException: java.lang.NullPointerException How to solve could not create the virtual machine error of Java Virtual Machine Launcher? The network adapter could not establish the connection - Oracle 11g Best way to increase heap size in catalina.bat file CATALINA_HOME environmental variable is not defined correctly How to change the port of Tomcat from 8080 to 80? Error With Port 8080 already in use How to set level logging to DEBUG in Tomcat?