5

First, sorry for my English, this isn't my native language.

My environment has :
- a jre 1.5.0_12 (binaries)
- a jre 1.6.0_17 (default jre)
- a jre 1.7.0_45 (binaries)

I have 2 ways to launch the application via Java Webstart :

1) \\<network filesystem>\javaws-1.5.0_12.exe \\<network filesystem>\urClient-DAP2.jnlp

2) "C:\Program Files\Java\jre1.5.0_12\bin\javaws.exe" "http://some-server.com/EU10.jnlp"

Before installing Java 1.7, no problem.

But since I installed the JRE 1.7 (only binaries, and registered in regedit), the 2nd way doesn't want to download the JAR and execute the application. I only got the Java splash screen - "Java Loading" appears then disappears in about 20 seconds.

I've found two workarounds :
- disable or uninstall the JRE 1.7
- Or the weirdest way : I enable java console ....(deployment.console.startup.mode=SHOW)

I'm stuck, and the two workarounds are not viable...

EDIT : in the javaws trace i got this exception :

`Exception in thread "javawsApplicationMain" java.lang.NullPointerException
at javax.swing.SwingUtilities.appContextGet(Unknown Source)
at javax.swing.UIManager.getLAFState(Unknown Source)
at javax.swing.UIManager.maybeInitialize(Unknown Source)
at javax.swing.UIManager.getLookAndFeel(Unknown Source)
at com.sun.deploy.util.DeployUIManager.setLookAndFeel(Unknown Source)
at com.sun.javaws.ui.DownloadWindow.buildIntroScreen(Unknown Source)
at com.sun.javaws.Launcher.downloadResources(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)`

EDIT 2 : I find this difference between running via network file or http :

via HTTP (doesn't donwload jar) :
cache: User cache dir = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws cache: System cache dir = C:\Program Files\Java\jre1.5.0_12\cache\javaws cache: Muffin Cache = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws\muffins basic: Java part started basic: jnlpx.jvm: C:\Program Files\Java\jre1.7.0_45\bin\javaw.exe basic: jnlpx.splashport: 3611 basic: jnlpx.remove: false basic: jnlpx.heapsize: NULL,NULL

via network file (download jar and start application) :

cache: User cache dir = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws cache: System cache dir = C:\Program Files\Java\jre1.5.0_12\cache\javaws cache: Muffin Cache = C:\Documents and Settings\U01E519\Application Data\Sun\Java\Deployment\cache\javaws\muffins basic: Java part started basic: jnlpx.jvm: C:\Program Files\Java\jre1.5.0_12\bin\javaw.exe basic: jnlpx.splashport: 3831 basic: jnlpx.remove: true basic: jnlpx.heapsize: 64m,256m

The parameter jnlpx.jvm is different and i don't know why when i try to acess jnlp with http the jvm is 1.7, i want to use the 1.5 instead.

EDIT 3 : I solved the problem of EDIT 2 now i run java web start with a bat :

`@echo off
set JRE_HOME="C:\Program Files\Java\jre6"
echo %JRE_HOME%
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

echo %ARG%                     

%JRE_HOME%\bin\javaw.exe %ARG% com.sun.javaws.Main "PRC_ApplicationInstruction1.6.jnlp"`

And in JNLP file never use <j2se version="1.6+"> but <j2se version="1.6">

Thanks in advance.

  • I am guessing it is something to do with the Java security settings. – EpicPandaForce Jul 09 '14 at 14:55
  • Yes maybe, but i tried all options i could. The only one which allow to launch my apply is when i enable the option : show the console. – user3633094 Jul 10 '14 at 06:53
  • Wait a second, you're using the Java 1.5 in order to run the webstart. Why not the newer ones, Java 1.6 or Java 1.7? – EpicPandaForce Aug 12 '14 at 10:16
  • 1
    Because i don't have the hand on the 1.5 and 1.6 applications. And if i want them to be started we 1.7 we need to resign it all (and we can't) – user3633094 Aug 12 '14 at 13:07
  • 1
    Have you [checked the logs](http://stackoverflow.com/a/11992492/829571)? – assylias Aug 14 '14 at 12:57
  • 1
    Thanks assylias, i got an Exception : basic: Launching Cache Viewer Exception in thread "main" java.lang.ExceptionInInitializerError at com.sun.javaws.Main.main(Unknown Source) Caused by: java.lang.NullPointerException at javax.swing.SwingUtilities.appContextGet(Unknown Source) at javax.swing.JComponent.getDefaultLocale(Unknown Source) at javax.swing.JComponent.(Unknown Source) at javax.swing.JLabel.(Unknown Source) at javax.swing.JLabel.(Unknown Source) at com.sun.javaws.ui.CacheViewer.(Unknown Source) ... 1 more – user3633094 Aug 18 '14 at 07:28
  • Can you try setting a default `look and feel` in the application, such as `CrossPlatformLookAndFeel` using the line `UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());`? – EpicPandaForce Aug 18 '14 at 08:11
  • This is just a very wild guess, but maybe it has something to do with the Control Panel -> Java Control Panel -> Java -> View -> Runtimes. – EpicPandaForce Aug 18 '14 at 12:37
  • Unfortunately i don't have access to source code. Everything is fine when you run withotu javaws. When i go to control panel and look at runtines all seems fine. But i don't understand the difference that appears about the jnlpx.jvm – user3633094 Aug 18 '14 at 15:04
  • I have a question, does it work if you use `-Dswing.systemlaf=com.sun.javax.swing.plaf.metal.CrossPlatformLookAndFeel` parameter when you run the application with JavaWS? – EpicPandaForce Aug 25 '14 at 11:09
  • I tried this but nothing change – user3633094 Aug 26 '14 at 09:39
  • Okay, PLEASE TRY THIS ANSWER: http://stackoverflow.com/a/20102779/2413303 – EpicPandaForce Sep 09 '14 at 11:59

2 Answers2

3

== Step 1

Your issue comes from java 7u45 security only. First, try to add this properties to your jars :

Permissions: all-permissions
Codebase: *
Trusted-Library: true

It could be enough and will clear the security warnings.

== Step 2

If it is not enough : 7u45 won't transport non-secure properties to your application unless the JNLP is signed (i.e.: the osgi bundle-list in Eclipse RCP). So try to signed your JNLP.

== Step 3

If you can't signed the JNLP ^^ You can turned your non-secure properties to secure ones by adding "jnlp" at the beginning of the name to all your properties

The Oracle documentation on that flaw : http://docs.oracle.com/javase/tutorial/deployment/doingMoreWithRIA/settingArgsProperties.html

Kraiss
  • 919
  • 7
  • 22
  • Thanks for your answer. But the problem is not when i try to use the jre 1.7.0_45. But only when i try to use javaws with jre 1.5 and 1.6. I corrected all the security problem when i had to use the 1.7 (and now i got no problem when using this one) – user3633094 Aug 18 '14 at 07:59
  • Did you try the step 3 ? – Kraiss Aug 18 '14 at 09:38
  • I can't do the step 3, i only have access to jar. I don't have access to source code. – user3633094 Aug 18 '14 at 12:36
  • Hi, i tried the step 1 and 3 with a simple application (a swing application with one window with Hello World in it). And i got the same problem, the jar won't be downloaded – user3633094 Sep 03 '14 at 15:20
1

Finally I resolve all the problem this way :

I run java web start with a bat :

`@echo off
set JRE_HOME="C:\Program Files\Java\jre6"
echo %JRE_HOME%
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
echo %ARG%                     
%JRE_HOME%\bin\javaw.exe %ARG% com.sun.javaws.Main "PRC_ApplicationInstruction1.6.jnlp"`

And in JNLP file never use <j2se version="1.6+"> but <j2se version="1.6">