首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Netbeans JNLP Webstart错误

Netbeans JNLP Webstart错误
EN

Stack Overflow用户
提问于 2015-03-23 08:38:55
回答 4查看 1.2K关注 0票数 4

我已经为此斗争了一整天,我就是找不出我做错了什么。我在netbeans中有一个项目,根据netbeans教程中的方法,我为该项目创建了web起始页,但每次尝试将教程项目或我的项目作为web start运行时,我都会收到以下错误:

代码语言:javascript
运行
复制
java.lang.NumberFormatException: For input string: "\Users\<snip>"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verifyCodebaseEx(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verifyCodebase(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
at com.sun.javaws.Launcher.prepareResources(Unknown Source)
at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

我的jnlp文件是:

代码语言:javascript
运行
复制
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="file:/C:/Users/<snip>/dist/" href="launch.jnlp" spec="1.0+">
    <information>
        <title>...</title>
        <vendor>me</vendor>
        <homepage href=""/>
        <description>...</description>
        <description kind="short">...</description>
    </information>
    <update check="background"/>
    <security>
<all-permissions/>
</security>
    <resources>
    <j2se version="1.8+"/>
    <jar eagar="true" href="<snip>.jar" main="true"/>

    </resources>
    <application-desc main-class="<snip>">
    </application-desc>
    </jnlp>

我真的很感激你能帮上忙

EN

回答 4

Stack Overflow用户

发布于 2015-03-23 22:22:36

只需将您的jnlp更改为:

代码语言:javascript
运行
复制
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="file:/C:/MyFolder/" href="launch.jnlp" spec="1.0+">
    <information>
        <title>...</title>
        <vendor>me</vendor>
        <homepage href=""/>
        <description>...</description>
        <description kind="short">...</description>
    </information>
    <update check="background"/>
    <security>
<all-permissions/>
</security>
    <resources>
    <j2se version="1.8+"/>
    <jar eagar="true" href="MyJarFile.jar" main="true"/>

    </resources>
    <application-desc main-class="com.MyCompany.MyMainClass">
    </application-desc>
    </jnlp>

编辑:如果这没有帮助,或者你对此有任何疑问,请在下面添加你的评论。

票数 2
EN

Stack Overflow用户

发布于 2015-03-24 00:01:58

试一试

file:///C:/Users/snip/dist/

在JNLP-XML的代码库中。

文件Uri-方案需要2x // (file://)

编辑

对此无可奉告?

因此,如果这不起作用,您可以尝试执行以下操作:

https://stackoverflow.com/a/2417010/3887073

它告诉我们:

代码语言:javascript
运行
复制
<jnlp spec="1.0+" codebase="file://localhost/X:/path/to/jnlp/" href="software.jnlp">
票数 2
EN

Stack Overflow用户

发布于 2015-03-31 23:39:10

确保没有在代码中的任何位置使用应用程序的路径作为值。如果程序接受命令行参数,请尝试在JNLP文件中将参数指定为<application-desc><argument></argument>子元素,并使用以下命令直接从命令行运行Java Web Start程序

代码语言:javascript
运行
复制
javaws path.to.ClassWithMainMethod
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29201661

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档