Run com.sun.javaws.Main from javaws.jar

Q

Can I run com.sun.javaws.Main from javaws.jar directly? I don't want to use the JavaWS command.

✍: FYIcenter

A

Not really. You can get JavaWS started. But you need to set a number of properties at the command line to make it work properly. See the tutorial below:

1. First try:

>\fyicenter\jdk-1.8.0\bin\java 
   -cp \fyicenter\jdk-1.8.0\jre\lib\javaws.jar 
   com.sun.javaws.Main

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: 
   com/sun/deploy/config/JREInfo

2. Adding deploy.jar

>\fyicenter\jdk-1.8.0\bin\java 
   -cp \fyicenter\jdk-1.8.0\jre\lib\javaws.jar;\fyicenter\jdk-1.8.0\jre\lib\deploy.jar 
   com.sun.javaws.Main

#### Java Web Start Error:
#### Invalid arguments supplied: { }

3. Adding JNLP file:

>\fyicenter\jdk-1.8.0\bin\java 
   -cp \fyicenter\jdk-1.8.0\jre\lib\javaws.jar;\fyicenter\jdk-1.8.0\jre\lib\deploy.jar 
   com.sun.javaws.Main 
   dynamictree.jnlp

Exception: java.security.AccessControlException thrown from the UncaughtExceptio
nHandler in thread "Java Web Start Main Thread"

Exception: java.security.AccessControlException thrown from the UncaughtExceptio
nHandler in thread "AWT-Shutdown"

Java HotSpot(TM) 64-Bit Server VM warning: Exception java.security.AccessControl
Exception occurred dispatching signal UNKNOWN to handler- the VM may need to be
forcibly terminated

 

Understanding and Using javaws.jar

⇒⇒FAQ for JavaWS (Java Web Start)

2017-12-31, 253👍, 0💬