2

I need to activate webstart by passing command line arguments in my code. I have seen Passing command line arguments to javaws (Java WebStart) executable but could not get the solution which can take multiple arguments though we could use -open or -print.

I need to run 'javaws http://appServerURL:port/context/sample.jnlp' with following arguments

  1. -u
  2. username
  3. -p
  4. password
  5. -s
  6. C:/ProgramFiles/saple/some.bat -Ip 10.44.219.109 -Usr readwrite -Pwd readwrite

Your help is much appreciated.....

Community
  • 1
  • 1
anotherNovice1984
  • 397
  • 3
  • 6
  • 13

1 Answers1

2

Create a batch file like

set JRE_HOME=c:\Program Files\java\jre1.5.0_12
set ARG=

set ARG=%ARG% -Xbootclasspath/a:"%JRE_HOME%\lib\javaws.jar";"%JRE_HOME%\lib\deploy.jar"
set ARG=%ARG% -classpath "%JRE_HOME%\lib\deploy.jar"
set ARG=%ARG% -Djnlpx.home="%JRE_HOME%\bin"
set ARG=%ARG% -Djnlpx.slashport=1322
set ARG=%ARG% -Djnlpx.jvm="%JRE_HOME%\bin\javaw.exe"
set ARG=%ARG% -Djnlpx.remove=false

rem activate if you want to debug your client
rem set ARG=%ARG% -Djnlpx.vmargs="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001"

set ARG=%ARG% -Djava.security.policy=file:"%JRE_HOME%\lib\security\javaws.policy"
set ARG=%ARG% -DtrustProxy=true -Xverify:remote -Djnlpx.heapsize=NULL,NULL

set ARG=%ARG% -u username -p password -s C:/ProgramFiles/saple/some.bat -Ip 10.44.219.109 -Usr readwrite -Pwd readwrite

"%JRE_HOME%\bin\javaw.exe" %ARG% com.sun.javaws.Main http://appServerURL:port/context/sample.jnlp
Oleg Pavliv
  • 20,462
  • 7
  • 59
  • 75
  • Thanks for the response....but I'm not in a position to run a batch file. I t would have been great if I could pass dynamically like using -open option in javaws command – anotherNovice1984 Feb 22 '11 at 09:45