jmeter-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 62107] jmeter.bat fails to execute due to space in the (program files) for jdk path
Date Tue, 20 Feb 2018 13:55:06 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=62107

--- Comment #15 from Manu <manu2k@gmail.com> ---
(In reply to Felix Schumacher from comment #14)
> (In reply to Manu from comment #12)
> > (In reply to Felix Schumacher from comment #10)
> > > I have tested this (and the ones before) with the following setup:
> > > 
> > > > set "JM_LAUNCH=C:\PATH WITH SPACES\java"
> > > > jmeter.bat
> > > 
> > > Date: Mon Feb 19 18:13:45 2018
> > > New Revision: 1824800
> > > 
> > > URL: http://svn.apache.org/viewvc?rev=1824800&view=rev
> > > Log:
> > > Use quotes around JM_LAUNCH and add a title to JM_START
> > > 
> > > Hopefully this will fix the space problem.
> > > 
> > > Bugzilla Id: 62107
> > > 
> > > Modified:
> > >     jmeter/trunk/bin/jmeter.bat
> > >     jmeter/trunk/bin/jmeterw.cmd
> > 
> > I tried that, hardcording JM_LAUNCH="C:\Program
> > Files\Java\jdk1.8.0_162\bin\java" within jmeter.bat and it worked. However I
> > believe it should work as part of the environment variable settings as well.
> 
> Instead of editing jmeter.bat you could create a setenv.bat and place it
> there. Note that I used 'set "var=value"' 
> 
> Have you tried again with the current version? 
> 
> Does the current version work with the environment variable?

Yes setting the JM_LAUNCH with setenv.bat as well its working..
I tried it with 3.2 and 4.0 version.
However the actual issue is that if I set JM_LAUNCH in Environment Variables >>
user variable it's breaking due to space on launch. This is observed with 4.0
as well.

C:\apache-jmeter-4.0\bin>jmeter

C:\apache-jmeter-4.0\bin>rem   Licensed to the Apache Software Foundation (ASF)
under one or more

C:\apache-jmeter-4.0\bin>rem   contributor license agreements.  See the NOTICE
file distributed with

C:\apache-jmeter-4.0\bin>rem   this work for additional information regarding
copyright ownership.

C:\apache-jmeter-4.0\bin>rem   The ASF licenses this file to You under the
Apache License, Version 2.0

C:\apache-jmeter-4.0\bin>rem   (the "License"); you may not use this file
except in compliance with

C:\apache-jmeter-4.0\bin>rem   the License.  You may obtain a copy of the
License at

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem       http://www.apache.org/licenses/LICENSE-2.0

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   Unless required by applicable law or agreed to
in writing, software

C:\apache-jmeter-4.0\bin>rem   distributed under the License is distributed on
an "AS IS" BASIS,

C:\apache-jmeter-4.0\bin>rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.

C:\apache-jmeter-4.0\bin>rem   See the License for the specific language
governing permissions and

C:\apache-jmeter-4.0\bin>rem   limitations under the License.

C:\apache-jmeter-4.0\bin>rem  
=====================================================

C:\apache-jmeter-4.0\bin>rem   Environment variables that can be defined
externally:

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   Do not set the variables in this script. Instead
put them into a script

C:\apache-jmeter-4.0\bin>rem   setenv.bat in JMETER_HOME/bin to keep your
customizations separate.

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   DDRAW       - (Optional) JVM options to
influence usage of direct draw,

C:\apache-jmeter-4.0\bin>rem                 e.g. '-Dsun.java2d.ddscale=true'

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   JMETER_BIN  - JMeter bin directory (must end in
\)

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   JMETER_COMPLETE_ARGS - if set indicates that
JVM_ARGS is to be used exclusively instead

C:\apache-jmeter-4.0\bin>rem                 of adding other options like HEAP
or GC_ALGO

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   JMETER_HOME - installation directory. Will be
guessed from location of jmeter.bat

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   JM_LAUNCH   - java.exe (default) or javaw.exe

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   JM_START    - set this to "start" to launch
JMeter in a separate window

C:\apache-jmeter-4.0\bin>rem                 this is used by the jmeterw.cmd
script.

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   JVM_ARGS    - (Optional) Java options used when
starting JMeter, e.g. -Dprop=val

C:\apache-jmeter-4.0\bin>rem                 Defaults to '-Duser.language="en"
-Duser.region="EN"'

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   GC_ALGO     - (Optional) JVM garbage collector
options

C:\apache-jmeter-4.0\bin>rem                 Defaults to '-XX:+UseG1GC
-XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem   HEAP        - (Optional) JVM memory settings
used when starting JMeter

C:\apache-jmeter-4.0\bin>rem                 Defaults to '-Xms1g -Xmx1g
-XX:MaxMetaspaceSize=256m'

C:\apache-jmeter-4.0\bin>rem

C:\apache-jmeter-4.0\bin>rem  
=====================================================

C:\apache-jmeter-4.0\bin>setlocal

C:\apache-jmeter-4.0\bin>rem Guess JMETER_HOME if not defined

C:\apache-jmeter-4.0\bin>set "CURRENT_DIR=C:\apache-jmeter-4.0\bin"

C:\apache-jmeter-4.0\bin>if not "" == "" goto gotHome

C:\apache-jmeter-4.0\bin>set "JMETER_HOME=C:\apache-jmeter-4.0\bin"

C:\apache-jmeter-4.0\bin>if exist "C:\apache-jmeter-4.0\bin\bin\jmeter.bat"
goto okHome

C:\apache-jmeter-4.0\bin>cd ..

C:\apache-jmeter-4.0>set "JMETER_HOME=C:\apache-jmeter-4.0"

C:\apache-jmeter-4.0>cd "C:\apache-jmeter-4.0\bin"

C:\apache-jmeter-4.0\bin>if exist "C:\apache-jmeter-4.0\bin\jmeter.bat" goto
okHome

C:\apache-jmeter-4.0\bin>rem Get standard environment variables

C:\apache-jmeter-4.0\bin>if exist "C:\apache-jmeter-4.0\bin\setenv.bat" call
"C:\apache-jmeter-4.0\bin\setenv.bat"

C:\apache-jmeter-4.0\bin>if not defined JMETER_LANGUAGE (
rem Set language
 rem Default to en_EN
 set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

C:\apache-jmeter-4.0\bin>rem Minimal version to run JMeter

C:\apache-jmeter-4.0\bin>set MINIMAL_VERSION=1.8.0

C:\apache-jmeter-4.0\bin>rem --add-modules java.activation if JAVA 9

C:\apache-jmeter-4.0\bin>set JAVA9_OPTS=

C:\apache-jmeter-4.0\bin>for /F "tokens=3" %g in ('java -version 2>&1 | findstr
/i "version"') do (
rem @echo Debug Output: %g
 set JAVAVER=%g
)

C:\apache-jmeter-4.0\bin>(
rem @echo Debug Output: "1.8.0_162"
 set JAVAVER="1.8.0_162"
)

C:\apache-jmeter-4.0\bin>if not defined JAVAVER (

 set ERRORLEVEL=2
 goto pause
)

C:\apache-jmeter-4.0\bin>rem Check if version is from OpenJDK or Oracle Hotspot
JVM prior to 9 containing 1.${version}.x

C:\apache-jmeter-4.0\bin>rem JAVAVER will be equal to "9.0.4" (quotes are part
of the value) for Oracle Java 9

C:\apache-jmeter-4.0\bin>rem JAVAVER will be equal to "1.8.0_161" (quotes are
part of the value) for Oracle Java 8

C:\apache-jmeter-4.0\bin>rem so we extract 2 chars starting from index 1

C:\apache-jmeter-4.0\bin>IF "1." == "1." (
set JAVAVER=1.8.0_162
 for /F "delims=. tokens=1-3" %v in (""1.8.0_162"") do (set current_minor=%w )
)  else (
rem Java 9 at least
 set current_minor=9
 set JAVA9_OPTS=--add-modules java.activation --add-opens
java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED
--add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens
java.desktop/java.awt=ALL-UNNAMED --add-opens
java.desktop/java.awt.font=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
)

C:\apache-jmeter-4.0\bin>(set current_minor=8 )

C:\apache-jmeter-4.0\bin>for /F "delims=. tokens=1-3" %v in ("1.8.0") do (set
minimal_minor=%w )

C:\apache-jmeter-4.0\bin>(set minimal_minor=8 )

C:\apache-jmeter-4.0\bin>if not defined current_minor (

 set ERRORLEVEL=2
 goto pause
)

C:\apache-jmeter-4.0\bin>rem @echo Debug: CURRENT=8 - MINIMAL=8

C:\apache-jmeter-4.0\bin>if 8 LSS 8 (

 set ERRORLEVEL=3
 goto pause
)
Files\Java\jdk1.8.0_162\bin\ was unexpected at this time.
C:\apache-jmeter-4.0\bin>if .C:\Program Files\Java\jdk1.8.0_162\bin\ == . set
JM_LAUNCH=java.exe
C:\apache-jmeter-4.0\bin>

-- 
You are receiving this mail because:
You are the assignee for the bug.
Mime
View raw message