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.....

2
  • Also I'm aware of <arguments> section in a JNLP file but arguments have to be passed during run time.... Commented Feb 22, 2011 at 6:37
  • 1
    It would be great if I can get the usage of -open option in case of multiple arguments being passed. Commented Feb 22, 2011 at 9:48

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.