-1

I need to specify system properties, i.e. smth like this "-Dx=1 -Dy=2" and pass it to the applet. Also - I launch it through JNLP.

Tried the following:

<j2se version="1.7+"  java_arguments="-Dx=1 -Dy=2" java-vm-args="-Dx=1 -Dy=2"/>

Also:

<applet-desc main-class="my.AppletLauncher"
             name="Demo Applet"
             width="1000"
             height="1000">
    <param name="java-vm-args" value="-Dx=1 -Dy=2"/>
    <param name="java_arguments" value="-Dx=1 -Dy=2"/>

Nothing helps.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Boris
  • 1,054
  • 1
  • 13
  • 23
  • *"specify system properties, i.e. smth like.."* No, I'm going to stop you there. When it comes to system properties, some exist, some don't. Further, while some can be set by a sand-boxed app., others require trust. Some properties have separate, specific attributes to set them in JNLP. So be specific. What properties are you trying to set? – Andrew Thompson Jan 28 '14 at 02:40
  • I mean exactly arbitrary properties. They are not something specific for Java. They are just my properties, specific for that applet only. – Boris Jan 28 '14 at 07:21
  • Then they are ***not**C System properties and should not be defined that way. As mentioned by @etalbo, add them as properties in the JNLP file, and they should be retrievable in the app. – Andrew Thompson Jan 28 '14 at 12:37

1 Answers1

1

Try with property tag:

<resources>
    <j2se version="1.7+"/>
    <property name="x" value="1"/>
    <property name="y" value="2"/>
</resources>

Also read this https://bugs.openjdk.java.net/browse/JDK-8023821 about setting properties using JNLP.

Hope it helps.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
eltabo
  • 3,749
  • 1
  • 21
  • 33