пытаюсь развернуть java-апплет с помощью jnlp

я пытаюсь развернуть апплет с помощью jnlp

мой jnlp-файл:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.6" codebase="http://localhost:8080/docRuleTool/appletjars/" href="dynamictree-applet.jnlp">
    <information>
        <title>dynamictree</title>
        <vendor>dynamic</vendor>
    </information>
    <resources>
        <j2se version="1.6" href="http://localhost:8080/docRuleTool/appletjars/" />
        <jar href="dynamictree.jar" main="true" />
        <jar href="prefuse.jar" main="true" />
    </resources>
    <applet-desc 
         name="dynamictree-applet"
         main-class="com.vaannila.utility.dynamicTreeApplet.class"
         width="1000"
         height="1000">
     </applet-desc>
     <update check="background"/>
</jnlp>

мой код апплета:

<script src="http://www.java.com/js/deployJava.js"></script>
<script>
    var attributes = { id:'DynamicApplet', code:'jstojava.dynamicTreeApplet',} ;
    var parameters = {jnlp_href:'./appletjars/dynamictree-applet.jnlp'} ;
    deployJava.runApplet(attributes, parameters, '1.6');
</script>

Мой javascript:

function showSelected(value){
alert("the value given from  "+value);  
DynamicApplet.dieasenameencode=value; 
}

Ошибка, которую я получаю:

execption: The application has requested a version of the JRE (version 1.6) that currently is not locally installed. Java Web Start is unable to automatically download and install the requested version. This JRE must be installed manually..
JNLPException[category: System Configuration : Exception: null : LaunchDesc: 
<jnlp spec="1.6" codebase="http://localhost:8080/docRuleTool/appletjars/" href="http://localhost:8080/docRuleTool/appletjars/dynamictree-applet.jnlp">
  <information>
    <title>dynamictree</title>
    <vendor>dynamic</vendor>
    <homepage href="null"/>
  </information>
  <update check="background" policy="always"/>
  <resources>
    <java href="http://localhost:8080/docRuleTool/appletjars/" version="1.6"/>
    <jar href="http://localhost:8080/docRuleTool/appletjars/dynamictree.jar" download="eager" main="true"/>
    <jar href="http://localhost:8080/docRuleTool/appletjars/prefuse.jar" download="eager" main="true"/>
  </resources>
  <applet-desc name="dynamictree-applet" main-class="com.vaannila.utility.dynamicTreeApplet.class" documentbase="http://localhost:8080/docRuleTool/" width="1000" height="1000"/>
</jnlp> ]
    at sun.plugin2.applet.JNLP2Manager.downloadJREResource(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Exception: JNLPException[category: System Configuration : Exception: null : LaunchDesc: 
<jnlp spec="1.6" codebase="http://localhost:8080/docRuleTool/appletjars/" href="http://localhost:8080/docRuleTool/appletjars/dynamictree-applet.jnlp">
  <information>
    <title>dynamictree</title>
    <vendor>dynamic</vendor>
    <homepage href="null"/>
  </information>
  <update check="background" policy="always"/>
  <resources>
    <java href="http://localhost:8080/docRuleTool/appletjars/" version="1.6"/>
    <jar href="http://localhost:8080/docRuleTool/appletjars/dynamictree.jar" download="eager" main="true"/>
    <jar href="http://localhost:8080/docRuleTool/appletjars/prefuse.jar" download="eager" main="true"/>
  </resources>
  <applet-desc name="dynamictree-applet" main-class="com.vaannila.utility.dynamicTreeApplet.class" documentbase="http://localhost:8080/docRuleTool/" width="1000" height="1000"/>
</jnlp> ]

person bhalkian    schedule 29.08.2011    source источник
comment
Какая версия у вас установлена ​​JRE/JDK? Я думаю, это не 1,6 - может быть, вы можете использовать <j2se version="1.6+" ... /> (обратите внимание на +) в своем JNLP?   -  person Philipp Reichart    schedule 30.08.2011


Ответы (1)


Проблема в этой строке:

<j2se version="1.6" href="http://localhost:8080/docRuleTool/appletjars/" />

Java Web Start попытается загрузить Jre 1.6 с URL-адреса, указанного в атрибуте href. Исправленная версия приведена ниже:

<j2se version="1.6" href="http://java.sun.com/products/autodl/j2se" />

Пример файла JNLP можно найти здесь: Распространите свое приложение Swing через Веб-запуск Java

person Sunil Manheri    schedule 15.09.2011