Canalblog
Editer l'article Suivre ce blog Administration + Créer mon blog
Publicité
Java and front end - day to day work
28 octobre 2009

I have spend so, many days trying to have my

I have spend so, many days trying to have my applet work on all windows.
I don't even dare trying to make it work on Mac.
But the least I can say is that the JNLP really debugging process is really not a pleasure.
JNLP debugging messages really looks like the debugging tool of the 90's begining).
Want I see all those engeneers at Sun-Oracle trying to (badly) copycat the iphone Application shop, while no-one is even working on improving JNLP publishing I just get really angry.

Nevertheless I won't talkToday about this because I am not qualified. I will talk about something I lost my morningon. Is it a bug ? I don't know but it should be from my point of Vue.

Ok let's start. You have a wonderfull Applet. Very pround if. For sure you made it !
Now suppose you have two parts in your JNLP file:
1) One part is "special" I mean my applet can have different "personnalities". For each there is a specific jar to be loaded.

2) One part is constant. Allways the same.
It Just calls :
- others JNLP from sun
- or others and others local jars
- and the java with 10 parameters.

So I made 2 jnlps. the main one is suppose to be short and containing specific things. there can be hundred of those. the other is buried on my server and has only one instance.

1) The main jnlp : Berlin_HH.jnlp containing specific things and is <applet-desc>.
It calls the jnlp thath is always the same : free-visit.jnlp

Berlin_HH.jnlp :
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="Berlin_HH.jnlp">
  <information>       ........   </information>
  <resources>
       <extension href="http://www.free-visit.net/fv_exec/player/free-visit.jnlp"/>
  </resources>

  <applet-desc name="BerlinHH" main-class="player3d.LaVisitePlayerApplet" width="1" height="1">
    <param name="dataPath" value="http://www.free-visit.com/users/tmilard/vis/Hackesche_Hofe.vis"/>
  </jnlp>


2) The constant one : free-visit.jnlp containing the list of jars and java parameters  is a <component-desc /> JNLP.

It calls the jnlp thath is always the same : free-visit.jnlp

free-visit.jnlp :
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="free-visit.jnlp">
  <information> ...  </information>
    <!-- =========================== --> 
  <resources>
    <java version="1.6.0_12+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Djava.security.manager -Xms350m -Xmx1024m -Dj3d.rend=d3d -Dj3d.optimizeForSpace=true -Dsun.java2d.d3d=false -Dsun.java2d.ddoffscreen=false -Dsun.java2d.noddraw=true -Dj3d.audiodevice=org.jdesktop.j3d.audioengines.joal.JOALMixer"/>

    <!--  a) free-visit player -->
    <jar href="http://www.free-visit.net/fv_exec/player/LaVisPlayer-signed.jar" main="true" download="eager"/>
    <!--  b) java3D API -->
    <jar href="http://www.xxxx/xxxx/xx.jar" download="eager"/>
    <jar href="http://www.yyyy/yyyy/yy.jar" download="eager"/>
    <jar href="http://www.zzz/zzzzz/zz.jar" download="eager"/>
    <!--  and 15 others -->
    <jar href="http://kakaka.cpm/kakakakakka/ka.jar" download="eager"/>      
xec/player/starfireExt-signed.jar" download="eager"-->
  </resources>
    <!-- =========================== --> 
<component-desc />
  </jnlp>

  • - Smart programming ! No ?

The main jnlp tells free-visit.jnlp to bring him the jars and also the java+jvl-parameters.
I calls this a cool simplification of my application : This way,
Berlin_HH.jnlp my main jnlp file stays simple.

  • - So what is wrong with this ?

- For the jar, cool. I can really put in the second jnlp file (  ) all the jars.
- The problem concern the java-and-jvm-parameters. It seems it is forbuden. It looks like Sun engeneers have build the JNLP potato-jam that forbid this line in a <component-desc /> JNLP file.

This line cannot be put in free-visit.jnlp :
<java version="1.6.0_12+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Djava.security.manager -Xms350m -Xmx1024m -Dj3d.rend=d3d -Dj3d.optimizeForSpace=true -Dsun.java2d.d3d=false -Dsun.java2d.ddoffscreen=false -Dsun.java2d.noddraw=true -Dj3d.audiodevice=org.jdesktop.j3d.audioengines.joal.JOALMixer"/>

Therefore I have to put this line back in may Berlin_HH.jnlp (main file, with <applet-desc> tag ).
Therefore doubling the lengh of my main JNLP file. And this is an issue for me as I wanted to keep is as small-and-simple as I could.

Is it a problem ?

Sun  engenneers I think your decision to have delegates JNLP files is good. <applet-desc> callings <component-desc /> is brilliant.
Looks a bit like cascade procedural programming I did using Pascal langage (I loved this langage by the way).
This works for jar files. Good.
So why on earth did you forbid it for java-and-jvm-parameters ?
Maybe there is somethong I do not know. Please do tell me.

Publicité
Publicité
Commentaires
Java and front end - day to day work
  • I work with java. I love gui and good looking screen. I love Internet. Internet java, you got it I love programing front end with java. Why should it be made only with Flash. java Swing and now javaFx can do also nice things. Ok, it can, it could it
  • Accueil du blog
  • Créer un blog avec CanalBlog
Publicité
Publicité