Upgrade Elasticsearch to 5.6.3 - java

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

Related

Intellij JBoss - Initial heap size set to a larger value than the maximum heap size

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"

Error: Could not create the Java Virtual Machine

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.

Where does Maven set Java options? [duplicate]

When building a Java 8 project with Maven:
mvn clean package
I get this message:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
How to remove this message?
Compatibility Guide for JDK 8 says that in Java 8 the command line flag MaxPermSize has been removed. The reason is that the permanent generation was removed from the hotspot heap and was moved to native memory.
So in order to remove this message
edit MAVEN_OPTS Environment User Variable:
Java 7
MAVEN_OPTS -Xmx512m -XX:MaxPermSize=128m
Java 8
MAVEN_OPTS -Xmx512m
The JDK 8 HotSpot JVM is now using native memory for the representation of class metadata and is called Metaspace.
The permanent generation has been removed. The PermSize and MaxPermSize are ignored and a warning is issued if they are present on the command line.
-XX:MaxPermSize=size
Sets the maximum permanent generation space size (in bytes). This option was deprecated in JDK 8, and superseded by the -XX:MaxMetaspaceSize option.
-XX:PermSize=size
Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded. This option was deprecated in JDK 8, and superseded by the -XX:MetaspaceSize option.
In JBoss EAP 6.4, right click on the server and open launch configuration under VM argument you will find
{-Dprogram.name=JBossTools: jboss-eap" -server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m}
update it to
{-Dprogram.name=JBossTools: JBoss 6.4" -server -Xms512m -Xmx512m}
this will solve your problem.
I got similar message when running command line mvn (version 3.3.3) on Linux with Java 8.
By opening maven script /$MAVEN-HOME/bin/mvn, found the following line
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
Where $MAVEN_PROJECTBASEDIR by default is your home directory.
So two places you can take a look, first is file $MAVEN_PROJECTBASEDIR/.mvn/jvm.config if it exists. Secondly look at files possibly set up the environment variable MAVEN_OPTS. Candidate files are .bashrc, .bash_profile, .profile and those files included by them such as /etc/profile, /etc/bash.bashrc
I located
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
in .bashrc in my system, change it to
export MAVEN_OPTS="-Xmx512m"
issue resolved
in case some one still get this kind of message. Its happen because you add JVM argument when running maven project. Because it is related with maven you can check your pom.xml file on your project.
find this line <argLine>...</argLine>, on my project I also have argument below
<argLine>-Xmx1024m -XX:MaxPermSize=512m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>
you should replace MaxPermSize argument as -Xms123m -Xmx123m, since MaxPermSize is already deprecated and wont take any effect on your JVM config :
<argLine>-Xms512m -Xmx512m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>
Please to solve this problem we just have set installed JDK path in
standalone.conf
file which under the bin folder of JBoss\Wildfly Server. To solve this we do the following steps:
Open the standlone.conf file which under JBoss_or_wildfly\bin folder
Within this file find for #JAVA_HOME text.
Remove the # character and set your installed JDK path as
JAVA_HOME="C:\Program Files\Java\jdk1.8.0_65"
Hope this will solve your problem
Thanks
For Eclipse users...
Click Run —> Run configuration —> are —> set Alternate JRE for 1.6 or 1.7

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize

When building a Java 8 project with Maven:
mvn clean package
I get this message:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
How to remove this message?
Compatibility Guide for JDK 8 says that in Java 8 the command line flag MaxPermSize has been removed. The reason is that the permanent generation was removed from the hotspot heap and was moved to native memory.
So in order to remove this message
edit MAVEN_OPTS Environment User Variable:
Java 7
MAVEN_OPTS -Xmx512m -XX:MaxPermSize=128m
Java 8
MAVEN_OPTS -Xmx512m
The JDK 8 HotSpot JVM is now using native memory for the representation of class metadata and is called Metaspace.
The permanent generation has been removed. The PermSize and MaxPermSize are ignored and a warning is issued if they are present on the command line.
-XX:MaxPermSize=size
Sets the maximum permanent generation space size (in bytes). This option was deprecated in JDK 8, and superseded by the -XX:MaxMetaspaceSize option.
-XX:PermSize=size
Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded. This option was deprecated in JDK 8, and superseded by the -XX:MetaspaceSize option.
In JBoss EAP 6.4, right click on the server and open launch configuration under VM argument you will find
{-Dprogram.name=JBossTools: jboss-eap" -server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m}
update it to
{-Dprogram.name=JBossTools: JBoss 6.4" -server -Xms512m -Xmx512m}
this will solve your problem.
I got similar message when running command line mvn (version 3.3.3) on Linux with Java 8.
By opening maven script /$MAVEN-HOME/bin/mvn, found the following line
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
Where $MAVEN_PROJECTBASEDIR by default is your home directory.
So two places you can take a look, first is file $MAVEN_PROJECTBASEDIR/.mvn/jvm.config if it exists. Secondly look at files possibly set up the environment variable MAVEN_OPTS. Candidate files are .bashrc, .bash_profile, .profile and those files included by them such as /etc/profile, /etc/bash.bashrc
I located
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
in .bashrc in my system, change it to
export MAVEN_OPTS="-Xmx512m"
issue resolved
in case some one still get this kind of message. Its happen because you add JVM argument when running maven project. Because it is related with maven you can check your pom.xml file on your project.
find this line <argLine>...</argLine>, on my project I also have argument below
<argLine>-Xmx1024m -XX:MaxPermSize=512m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>
you should replace MaxPermSize argument as -Xms123m -Xmx123m, since MaxPermSize is already deprecated and wont take any effect on your JVM config :
<argLine>-Xms512m -Xmx512m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>
Please to solve this problem we just have set installed JDK path in
standalone.conf
file which under the bin folder of JBoss\Wildfly Server. To solve this we do the following steps:
Open the standlone.conf file which under JBoss_or_wildfly\bin folder
Within this file find for #JAVA_HOME text.
Remove the # character and set your installed JDK path as
JAVA_HOME="C:\Program Files\Java\jdk1.8.0_65"
Hope this will solve your problem
Thanks
For Eclipse users...
Click Run —> Run configuration —> are —> set Alternate JRE for 1.6 or 1.7

JBOSS not starting from cmd

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.

Categories