问题
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.
回答1:
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)
回答2:
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?
回答3:
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.
回答4:
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
回答5:
- 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.
回答6:
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
回答7:
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!
回答8:
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.
回答9:
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.
Finally i resolved the issue by changing JDK version jdk1.8.0_05 to jdk1.8.0_172
回答10:
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
回答11:
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
回答12:
Install latest java jdk and your problem will be solved.
回答13:
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
来源:https://stackoverflow.com/questions/18459945/how-to-solve-could-not-create-the-virtual-machine-error-of-java-virtual-machine