需要做如下配置即可:
1.将javaws.exe配置到classpath路径下。
2.将你的类打包成一个jar文件。
3.写一个file.jnlp文件
内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec = "1.0+"
codebase="file:C:/Users/limx/Desktop/Temporary"
href="filechooser.jnlp">
<information>
<title>FileChooser demo application</title>
<vendor>Mindview Inc.</vendor>
<description>
Jnlp File chooser Application
</description>
<description kind="short">
Demonstrates opening, reading and writing a text file
</description>
<!--<icon href="mindview.gif"/>-->
<offline-allowed/>
</information>
<resources>
<j2se version="1.6+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="jnlpfilechooser.jar" download="eager"/>
</resources>
<application-desc
main-class="gui.jnlp.JnlpFileChooser"/>
<security><all-permisssion><security>
</jnlp>
4.写一个html启动文件
<html>
Follow me
<a href="filechooser.jnlp" target="_blank">click here</a>
</html>
这样就ok了
此时点击这个链接,就会自动启动一个java RCP了。
JNLP:Java Network Launch Protocol
参考:
http://www.oracle.com/technetwork/java/javase/demos-nojavascript-137100.html
http://www.oracle.com/technetwork/java/javase/architecture-138566.html
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SimpleBundleDownload