Pass property file in WinRun4J

397 Views Asked by At

I am trying to translate a .bat file to a INI file so that I can use WinRun4J to launch a small JAVA app as a service.

Working from the demo that ships with the download, the web page https://github.com/poidasmith/winrun4j and a few samples that have posted I've come up with an .ini file that reads as...

terrainserver.class=ru.ibs.JEPPEG3.ProjectionServer.ProjectionServerDaemon
terrainserver.id=TerrainServer
terrainserver.name=WinRun4J TerrainServer terrainserver
terrainserver.description=Pegasus Terrain Service

classpath.1=*.jar
classpath.2=*.zip

arg.1=prjsrvConfig=.\prjsrv.properties

vmarg.1=-Xdebug
vmarg.2=-Xnoagent
vmarg.3=-Xrunjdwp:transport=dt_socket,address=2121,server=y,suspend=n

vm.heapsize.min.percent=256m
vm.heapsize.preferred=1000m

vm.location=C:\Program Files (x86)\Java\jdk1.7.0_55\jre\bin\server\jvm.dl

from the original batch file...

set JAVA_HOME=c:\jdk1.3.1_03
set PRJSRV_CLASSPATH=.\ProjServer.jar;.\ode.jar;.\classes12.zip;.\JAGR-client.jar;.\PegasusElevAdapter.jar
set PRJSRV_PARAM1=prjsrvConfig=.\prjsrv.properties

start %JAVA_HOME%\bin\java.exe -classpath %PRJSRV_CLASSPATH% -D%PRJSRV_PARAM1% -Xms256m -Xmx1000m ru.ibs.JEPPEG3.ProjectionServer.ProjectionServerDaemon

My question is is using arg key the correct method of setting a reference to the prjsrv.properties file? Or is there a better method? JAVA isn't my strongest language so please bear with me.

1

There are 1 best solutions below

0
Marged On

From what I can see your batch will have to be translated into:

vmarg.4=-DprjsrvConfig=.\prjsrv.properties

Besides that I think you need to rename these:

terrainserver.class=ru.ibs.JEPPEG3.ProjectionServer.ProjectionServerDaemon
terrainserver.id=TerrainServer
terrainserver.name=WinRun4J TerrainServer terrainserver
terrainserver.description=Pegasus Terrain Service

to

service.class=ru.ibs.JEPPEG3.ProjectionServer.ProjectionServerDaemon
service.id=TerrainServer
service.name=WinRun4J TerrainServer terrainserver
service.description=Pegasus Terrain Service

because WinRun4j does not support terrainserver but service.* or main.class instead.