I am tried to run ant Project but getting below error
Unrecognized option: -classic Error: Could not create the Java Virtual
Machine. Error: A fatal exception has occurred. Program will exit.
Press any key to continue . . .
run.bat contain below setting
set JAVA_OPTS=%JAVA_OPTS% -Xms3072m -Xmx3072m -Djava.util.logging.config.file=%JBOSS_HOME%\server\all\conf\logging.properties
set JAVA_OPTS=%JAVA_OPTS% -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:MaxPermSize=2048M
set JAVA_OPTS=-classic -Xdebug -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%
System configuration:
OS - Window 7
Ram - 8gb
The -classic option in your JAVA_OPTS variable was removed in Java 1.4. The option was used in Java 1.3 to invoke the Java 1.2 classic VM.
So if you're using a recent version of Java, you need to remove the option from your JAVA_OPTS variable.
Related
I am using IntelliJ 2020.1 Ultimate and have a JBoss 7.0.2 server that I want to run from IntelliJ.
I have added it as a configuration:
But when I try start the server, I get the following error:
IDEA.app/Contents/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-stdlib.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-reflect.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-plugin.jar"
org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 64088
4a7ed3b5-cfb6-4196-b997-396c16d8c06f
/Users/richardmarais/Library/Caches/JetBrains/IntelliJIdea2020.1/compile-server
Picked up JAVA_TOOL_OPTIONS: -Dhttps.protocols=TLSv1.2 -Xmx2048m
-XX:MaxPermSize=1024m -Xms2048m OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0 Error occurred
during initialization of VM Initial heap size set to a larger value
than the maximum heap size
My idea.vmoptions are the default values:
-Xms128m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
Question
Do you know how I can fix the above error to get JBoss to start?
You don't need to set any global environment variables to patch the VM options.
Unset JAVA_TOOL_OPTIONS and specify the proper VM Options in the Run/Debug configuration for the server:
-Xms256m -Xmx2048m -XX:MaxPermSize=512m
It should be more than enough for any project. I doubt that you really need 5GB initial heap size.
Also note that IntelliJ IDEA .vmoptions doesn't affect the options for the apps that you start from the IDE.
I fixed this by doing this.
open -a TextEdit.app ~/.bash_profile
then:
export JAVA_TOOL_OPTIONS="-Dhttps.protocols=TLSv1.2 -Xmx4096m -Xms128m"
I'm having difficulty running jMeter 5.0 via the jmeter.bat file on Windows 8.1. I've been using jMeter 3.0 successfully via the jmeter.bat file. The bat file for the 3.0 version in this directory, and works:
C:\Downloads\jMeter 3.0\apache-jmeter-3.0\bin
The jMeter 5.0 version sits in this directory, and fails:
C:\Downloads\jMeter 5.0\apache-jmeter-5.0\bin
Error it produces:
Invalid initial heap size: -Xms1024m -Xmx1024m -Dpropname=value
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
errorlevel=1
Press any key to continue . . .
Do I need to tweak the jmeter.bat file or install something else first?
JMeter's JVM settings increased by default and you can update jmeter.bat file with your required settings overriding JVM_ARGS=... or HEAP
JMeter JVM heap settings have changed from -Xms512m -Xmx512m to -Xms1g -Xmx1g
HEAP - (Optional) JVM memory settings used when starting JMeter
Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
I'm stuck at this problem for a long time without finding any solution.
I have the following Java Options in my Tomcat7_1w.exe:
(I don't have a setenv.bat or catalina.bat)
-Dcatalina.home=G:\Server\Tomcat_1
-Dcatalina.base=G:\Server\Tomcat_1
-Djava.endorsed.dirs=G:\Server\Tomcat_1\endorsed
-Djava.io.tmpdir=G:\Server\Tomcat_1\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=G:\Server\Tomcat_1\conf\logging.properties
-XX:SoftRefLRUPolicyMSPerMB=3600
-XX:+UseParallelGC
-XX:NewRatio=2
-Dserver
-D64
-Xmx8g
-Xms2g
But I get the following error:
[2018-03-09 16:01:29] [error] [12196] CreateJavaVM Failed
[2018-03-09 16:01:29] [error] [12196] The system could not find the environment option that was entered.
[2018-03-09 16:01:29] [error] [ 1620] Failed to start Java
[2018-03-09 16:01:29] [error] [ 1620] ServiceStart returned 4
I tried -Xmx4g, -Xmx4G still the same error.
Options that work:
-Dcatalina.home=G:\Server\Tomcat_1
-Dcatalina.base=G:\Server\Tomcat_1
-Djava.endorsed.dirs=G:\Server\Tomcat_1\endorsed
-Djava.io.tmpdir=G:\Server\Tomcat_1\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=G:\Server\Tomcat_1\conf\logging.properties
-XX:SoftRefLRUPolicyMSPerMB=3600
-XX:+UseParallelGC
-XX:NewRatio=2
-Dserver
-Xmx1024m
-Xms512m
Also, if I use the option -d64 (with small d), I get the same error. The capital D does not give an error.
What am I doing wrong?
Options -d32 and -d64 do not work on windows. You should select according bin folder with JRE (32 or 64 bit) in system PATH variable.
Additional info:
From Dariusz's answer, in Windows, you can't switch between 32 bit and 64 bit using Java options, instead you need to install the desired version of JVM.
In case you are getting the following error:
%1 is not a valid Win32 application.
Failed creating java C:\Program Files\Java\jre1.8.0_161\bin\server\jvm.dll
Then there is a version mismatch between your JVM and Apache Tomcat i.e., one is 32 bit and the other is 64 bit. Both need to be the same version.
I get the same error with the latest version of Elasticsearch 5.6.3
Error: encountered environment variables that are no longer supported
Use jvm.options or ES_JAVA_OPTS to configure the JVM
ES_HEAP_SIZE=1024m: set -Xms1024m and -Xmx1024m in jvm.options or add "-
Xms1024m -Xmx1024m" to ES_JAVA_OPTS
I have tried to add ES_JAVA_OPTS="-Xms1024m -Xmx1024m in bin/elasticsearch but I get the same thing.
You need to read the error message carefully.
Solution 1: open $ES_HOME/config/jvm.options and modify the lines starting with -Xms and -Xmx
-Xms1024m
-Xmx1024m
Or Solution 2: use an environment variable before starting Elasticsearch
> export ES_JAVA_OPTS="-Xms1024m -Xmx1024m"
> bin/elasticsearch
I have JBOSS installed in my Windows 7 machine., I can start JBOSS from Eclipse but it doesn't publish and when I try to run the standalone.bat file from the Bin directory it throws this error ,
JAVA_OPTS: -client -Dprogram.name=standalone.bat **-Xms1303M -Xmx1303M** -XX:MaxPe
rmSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInter
val=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -D
jboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.config=standa
lone.xml
**Error occurred during initialization of VM**
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
I did research the forum and many are suggesting to change the -Xms1303M to -Xms256M ., I edited the standalone.conf file in an editor but it is not getting reflected and getting the same error again.
Could someone please guide me ?
Most likely, you are using or running jboss on a 32 bit jdk and the memory params are out of range or exceed the limits of a 32 bit jdk. Either upgrade to a 64 bit jdk or add this line in your run.conf in jboss/bin, remove the jvm args from your command line and see if jboss starts.
set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=256M"
In Windows, it is the standalone.bat file and not the standalone.conf file that must be modified with the new JAVA_OPTS environment variable.