我已经为此斗争了一整天,我就是找不出我做错了什么。我在netbeans中有一个项目,根据netbeans教程中的方法,我为该项目创建了web起始页,但每次尝试将教程项目或我的项目作为web start运行时,我都会收到以下错误:
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文件是:
<?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>我真的很感激你能帮上忙
发布于 2015-03-23 22:22:36
只需将您的jnlp更改为:
<?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>编辑:如果这没有帮助,或者你对此有任何疑问,请在下面添加你的评论。
发布于 2015-03-24 00:01:58
试一试
file:///C:/Users/snip/dist/
在JNLP-XML的代码库中。
文件Uri-方案需要2x // (file://)
编辑
对此无可奉告?
因此,如果这不起作用,您可以尝试执行以下操作:
https://stackoverflow.com/a/2417010/3887073
它告诉我们:
<jnlp spec="1.0+" codebase="file://localhost/X:/path/to/jnlp/" href="software.jnlp">发布于 2015-03-31 23:39:10
确保没有在代码中的任何位置使用应用程序的路径作为值。如果程序接受命令行参数,请尝试在JNLP文件中将参数指定为<application-desc>的<argument></argument>子元素,并使用以下命令直接从命令行运行Java Web Start程序
javaws path.to.ClassWithMainMethodhttps://stackoverflow.com/questions/29201661
复制相似问题