JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
feature_request_small.png
CLOSED  Feature request JPPF-176  -  Enable specifying the JVM location for the driver and node launcher
Posted Aug 03, 2013 - updated Mar 29, 2016
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Feature request
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Other
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Targetted for
    icon_milestones.png JPPF 5.2
Issue description
From this forum post :
java path should be set in properties file which will be searched by batch file and if it dosent gets it, it will use default java path


This is a change that will impact:
  • the shell scripts (.bat and .sh)
  • the build.xml Ant scripts
  • the ProcessLauncher code

#8
Comment posted by
 lolo4j
Nov 23, 02:49
I've given it a try on both Linux and Windows, and seems like it works, at least for the shell scripts.

I added a property in the jppf-driver.properties file, "jppf.java.path=path_to_java_executable", then got the launcher script to parse it and use it to launch the driver:

On Windows:
@echo off
 
set CONFIG_FILE="config\jppf-driver.properties"
rem set the default value
set JAVA_PATH=java
rem try and parse from the config file
call:getvalue %CONFIG_FILE% "jppf.java.path" JAVA_PATH
 
set DRIVER_CMD=
 
call %JAVA_PATH% -cp config;lib/* -Xmx16m -Dlog4j.configuration=log4j-driver.properties -Djppf.config=jppf-driver.properties -Djava.util.logging.config.file=config/logging-driver.properties org.jppf.server.DriverLauncher
goto:eof
 
:getvalue
rem This function reads a value from an INI file and stores it in a variable
rem %1 = name of properties file to search in.
rem %2 = search term to look for
rem %3 = variable to place search result
rem FOR /F "eol=# eol=[ tokens=1,2* delims==" %%i in ('findstr /b /l /i %~2= %1') DO set %~3=%%~j
FOR /F "eol=# tokens=1,2* delims==" %%i in ('findstr /b /l /i %~2= %1') DO set %~3=%%~j
goto:eof
On Linux:
#! /bin/sh
 
file="config/jppf-driver.properties"
 
JAVA_PATH=`sed '/^\#/d' $file | grep 'jppf.java.path'  | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//'`
if 
  [ -z $JAVA_PATH ];
then
  JAVA_PATH="java"
fi
 
echo JAVA_PATH = $JAVA_PATH
 
$JAVA_PATH -cp config:lib/* -Xmx16m -Djppf.config=jppf-driver.properties -Dlog4j.configuration=log4j-driver.properties -Djava.util.logging.config.file=config/logging-driver.properties org.jppf.server.DriverLauncher


#9
Comment posted by
 lolo4j
Nov 23, 03:04
In the context of Feature request JPPF-288 - Clients task sets node configuration, I would also like to reuse the "jppf.java.path" property to enable setting the jvm to use when starting a slave node. It would be used as a configuration override when provisioning the slave.

Doing the same when restarting a master node may be more problematic, since the configuration may be read from a source other than a file. Maybe we could write a temporary config override file that would be applied once the configuration has been loaded.

In any case, I will create a separate feature request for this.
#10
Comment posted by
 lolo4j
Dec 27, 10:07
Implemented in trunk revision 3939
#13
Comment posted by
 lolo4j
icon_reply.pngMar 29, 06:32, in reply to comment #9
As a precision, the functionality described in comment #9 was actually implemented as part of this feature request.