# Running elastic in windows with JRockit - Could not create the Java Virtual machine

**URL:** <https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838>\
**Category:** Elasticsearch\
**Created:** [February 21, 2013, 1:29pm UTC](https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838 "2013-02-21T13:29:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Marchena\_Parr](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@Daniel\_Marchena\_Parr](https://discuss.elastic.co/u/Daniel_Marchena_Parr)\
**Post date:** [February 21, 2013, 1:29pm UTC](https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838/1 "2013-02-21T13:29:21Z")

</div>

Hello guys,

I'm new to elasticsearch and i'm following this tutorial  
([http://bin63.com/how-to-install-elasticsearch-on-windows](http://bin63.com/how-to-install-elasticsearch-on-windows)) to install it in  
the windows environment.

The JDK/JRE in use is JRockit 1.6 (last version).

I faced a problem when running the .bat file, and i can't find a solution:

_Unknown option or illegal argument: -XX +UseParNewGC._  
_Please check for incorrect spelling or review documentation of startup  
options._  
\*  
\*  
_Could not create the Java virtual machine_  
\*  
\*  
My \*JAVA\_HOME \*is pointing directly to \*C:\Program  
Files\Java\jrockit-jdk1.6.0\_37-R28.2.5-4.1.0\bin\java \*and my \*Path \*variable  
is: \*  
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%JAVA\_HOME%  
\*

Both the erro and my global variables can be found in the attached files.

Any ideas?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 21, 2013, 1:36pm UTC](https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838/2 "2013-02-21T13:36:51Z")

</div>

For JRockit VM, you can safely disable (comment with "REM") the JVM  
options in elasticsearch.bat starting with "-XX", because they are only  
valid for HotSpot VM.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Daniel\_Marchena\_Parr](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@Daniel\_Marchena\_Parr](https://discuss.elastic.co/u/Daniel_Marchena_Parr)\
**Post date:** [February 21, 2013, 1:44pm UTC](https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838/3 "2013-02-21T13:44:03Z")

</div>

Sorry Jorg, what should i do to get it solved?

Run REM + elasticsearch.bat?

It isnt just a warning message, the engine is not initiating (  
[http://localhost:9200/](http://localhost:9200/))

Em quinta-feira, 21 de fevereiro de 2013 10h36min51s UTC-3, Jörg Prante  
escreveu:

> For JRockit VM, you can safely disable (comment with "REM") the JVM  
> options in elasticsearch.bat starting with "-XX", because they are only  
> valid for HotSpot VM.
> 
> Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 21, 2013, 3:01pm UTC](https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838/4 "2013-02-21T15:01:29Z")

</div>

You have to modify the start script. Pick your favorite text editor,  
open the file %ES\_HOME%\bin\elasticsearch.bat (I hope this is correct  
Windows syntax), in doubt, open the File Explorer to find the file, it's  
in the bin direcotry where you installed Elasticsearch. Now, add the  
letters "REM " in front of the lines with the active JVM options  
starting with "-XX". "REM" means remark and is marking a comment line in  
Windows batch files. You will notice there are already lines with -XX  
options that are marked with REM so it should be very easy.

Jörg

Am 21.02.13 14:44, schrieb dertyu765:

> Sorry Jorg, what should i do to get it solved?
> 
> Run REM + elasticsearch.bat?
> 
> It isnt just a warning message, the engine is not initiating  
> ([http://localhost:9200/](http://localhost:9200/))

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Daniel\_Marchena\_Parr](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@Daniel\_Marchena\_Parr](https://discuss.elastic.co/u/Daniel_Marchena_Parr)\
**Post date:** [February 22, 2013, 1:17pm UTC](https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838/5 "2013-02-22T13:17:02Z")

</div>

Thanks alot Jorg, my .bat file is like this now:

@echo off

SETLOCAL

if NOT DEFINED JAVA\_HOME goto err

set SCRIPT\_DIR=%~dp0  
for %%I in ("%SCRIPT\_DIR%..") do set ES\_HOME=%%~dpfI

REM \*\*\*\*\* JAVA options \*\*\*\*\*

if "%ES\_MIN\_MEM%" == "" (  
set ES\_MIN\_MEM=256m  
)

if "%ES\_MAX\_MEM%" == "" (  
set ES\_MAX\_MEM=1g  
)

if NOT "%ES\_HEAP\_SIZE%" == "" (  
set ES\_MIN\_MEM=%ES\_HEAP\_SIZE%  
set ES\_MAX\_MEM=%ES\_HEAP\_SIZE%  
)

set JAVA\_OPTS=%JAVA\_OPTS% -Xms%ES\_MIN\_MEM% -Xmx%ES\_MAX\_MEM%

if NOT "%ES\_HEAP\_NEWSIZE%" == "" (  
set JAVA\_OPTS=%JAVA\_OPTS% -Xmn%ES\_HEAP\_NEWSIZE%  
)

if NOT "%ES\_DIRECT\_SIZE%" == "" (  
set JAVA\_OPTS=%JAVA\_OPTS% -XX:MaxDirectMemorySize=%ES\_DIRECT\_SIZE%  
)

set JAVA\_OPTS=%JAVA\_OPTS% -Xss256k

REM Enable aggressive optimizations in the JVM  
REM - Disabled by default as it might cause the JVM to crash  
REM set JAVA\_OPTS=%JAVA\_OPTS% -XX:+AggressiveOpts

REM set JAVA\_OPTS=%JAVA\_OPTS% -XX:+UseParNewGC  
REM set JAVA\_OPTS=%JAVA\_OPTS% -XX:+UseConcMarkSweepGC

REM set JAVA\_OPTS=%JAVA\_OPTS% -XX:CMSInitiatingOccupancyFraction=75  
REM set JAVA\_OPTS=%JAVA\_OPTS% -XX:+UseCMSInitiatingOccupancyOnly

REM When running under Java 7  
REM JAVA\_OPTS=%JAVA\_OPTS% -XX:+UseCondCardMark

REM GC logging options -- uncomment to enable  
REM JAVA\_OPTS=%JAVA\_OPTS% -XX:+PrintGCDetails  
REM JAVA\_OPTS=%JAVA\_OPTS% -XX:+PrintGCTimeStamps  
REM JAVA\_OPTS=%JAVA\_OPTS% -XX:+PrintClassHistogram  
REM JAVA\_OPTS=%JAVA\_OPTS% -XX:+PrintTenuringDistribution  
REM JAVA\_OPTS=%JAVA\_OPTS% -XX:+PrintGCApplicationStoppedTime  
REM JAVA\_OPTS=%JAVA\_OPTS% -Xloggc:/var/log/elasticsearch/gc.log

REM Causes the JVM to dump its heap on OutOfMemory.  
set JAVA\_OPTS=%JAVA\_OPTS% -XX:+HeapDumpOnOutOfMemoryError  
REM The path to the heap dump location, note directory must exists and have  
enough  
REM space for a full heap dump.  
REM JAVA\_OPTS=%JAVA\_OPTS% -XX:HeapDumpPath=$ES\_HOME/logs/heapdump.hprof

set  
ES\_CLASSPATH=%ES\_CLASSPATH%;%ES\_HOME%/lib/elasticsearch-0.20.5.jar;%ES\_HOME%/lib/_;%ES\_HOME%/lib/sigar/_  
set ES\_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES\_HOME%"

"%JAVA\_HOME%\bin\java" %JAVA\_OPTS% %ES\_JAVA\_OPTS% %ES\_PARAMS% %\* -cp  
"%ES\_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch"  
goto finally

:err  
echo JAVA\_HOME environment variable must be set!  
pause

:finally

ENDLOCAL

It's working great.

Em quinta-feira, 21 de fevereiro de 2013 12h01min29s UTC-3, Jörg Prante  
escreveu:

> You have to modify the start script. Pick your favorite text editor,  
> open the file %ES\_HOME%\bin\elasticsearch.bat (I hope this is correct  
> Windows syntax), in doubt, open the File Explorer to find the file, it's  
> in the bin direcotry where you installed Elasticsearch. Now, add the  
> letters "REM " in front of the lines with the active JVM options  
> starting with "-XX". "REM" means remark and is marking a comment line in  
> Windows batch files. You will notice there are already lines with -XX  
> options that are marked with REM so it should be very easy.
> 
> Jörg
> 
> Am 21.02.13 14:44, schrieb dertyu765:
> 
> > Sorry Jorg, what should i do to get it solved?
> > 
> > Run REM + elasticsearch.bat?
> > 
> > It isnt just a warning message, the engine is not initiating  
> > ([http://localhost:9200/](http://localhost:9200/))

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:50am UTC](https://discuss.elastic.co/t/running-elastic-in-windows-with-jrockit-could-not-create-the-java-virtual-machine/10838/6 "2017-07-06T02:50:04Z")

</div>


