论坛首页 Web前端技术论坛

Java Web Start 通过JNLP文件指定jvm内存

浏览 2790 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2010-04-14   最后修改:2010-04-16
指定javaFx运行时使用客户机的JVM内存大小

要写 initial-heap-size= "128m " max-heap-size= "256m "
就相当于-Xms128m -Xmx256M


可是修改后,程序运行时,任务栏会出现两个java的小图标, 大约一分钟后会自己动关闭一个.不好看.


<?xml version="1.0" encoding="utf-8"?> 
<jnlp spec="6.0+" codebase="." href="applet.jnlp"> 
        <information> 
                <title>Test</title> 
                <vendor>Qu0ll</vendor> 
        </information> 
        <resources> 
                <java version="1.6+" href="http://java.sun.com/products/autodl/j2se" 
max-heap-size="512m"/> 
                <jar href="applet.jar" main="true" download="eager"/> 
                <property name="jnlp.packEnabled" value="true"/> 
        </resources> 
        <applet-desc name="Test" main-class="test.MyApplet" width="640" 
height="480"/> 
</jnlp> 


And finally the HTML (index.html): 


<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
    <head> 
        <title>Test Applet</title> 
    </head> 
    <body> 
        <script src="http://java.com/js/deployJava.js"></script> 
        <script> 
            var attributes = { code:'test.MyApplet'} ; 
            var parameters = {jnlp_href: 'applet.jnlp', 
java_arguments:'-Xmx512m -Djnlp.packEnabled=true'} ; 
            deployJava.runApplet(attributes, parameters, '1.6'); 
        </script> 
    </body> 
</html> 





<?xml version= "1.0 " encoding= "utf-8 "?> 
<jnlp spec= "0.2 1.0 " 
codebase= "http://java.sun.com/products/javawebstart/apps " 
href= "draw.jnlp "> 
<information> 
<title> Draw 4 App </title> 
<vendor> Sun Microsystems, Inc. </vendor> 
</information> 
<resources> 
<j2se version= "1.3+ " initial-heap-size= "128m " max-heap-size= "256m " href= "http://java.sun.com/products/autodl/j2se "/> 
<jar href= "draw.jar " main= "true " download= "eager "/> 
</resources> 
<application-desc main-class= "Draw "/> 
</jnlp> 




论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics