Har*_*rdy 9 deployment runtime-error javafx-2
我正在尝试部署JavaFX应用程序.我一直在努力的应用程序相当复杂,包括几个库.当我创建一个jnlp并尝试运行它时,我总是收到"运行时错误.点击查看详细信息"消息.有人建议我尝试只做一个简单的Hello World应用程序来查看它是否与包含的库有关.我试过了,我仍然得到"运行时错误".
这是我正在尝试使用的build.xml.
<project name="App" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="C:\Program Files\Java\jdk7\lib\ant-javafx.jar" />
<target name="default">
<fx:deploy width="600" height="400" outdir="${basedir}/dist" outfile="App">
<fx:application name="App" mainClass="${javafx.main.class}"/>
<fx:resources>
<!-- include application jars -->
<fx:fileset dir="${basedir}" includes="*.jar"/>
<fx:fileset dir="${basedir}/lib" includes="*.jar"/>
<fx:fileset dir="${basedir}" includes="app.ini" />
<fx:fileset dir="${basedir}/template" includes="*.template" />
</fx:resources>
<!-- request user level installation -->
<fx:preferences install="false"/>
</fx:deploy>
</target>
</project>
Run Code Online (Sandbox Code Playgroud)
对于Hello World版本,我刚删除了该<fx:resources>部分.我从eclipse中运行它们作为蚂蚁任务.他们都在我的项目中使用.jnlp和.html文件创建了一个dist文件夹.然后我点击jnlp运行应用程序并看到一个小窗口,其中包含文本"运行时错误.点击查看详细信息." 我单击它并得到一个错误窗口,显示"应用程序无法运行.执行应用程序时出错.单击"详细信息"以获取更多信息."我单击"详细信息"按钮,查看包含以下信息的Java控制台(HelloWorld版本):
Java Plug-in 10.7.2.11
Using JRE version 1.7.0_07-b11 Java HotSpot(TM) 64-Bit Server VM
User home directory = C:\Users\user
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
Match: beginTraversal
Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], JREInfo: JREInfo for index 0:
platform is: 1.7
product is: 1.7.0_07
location is: http://java.sun.com/products/autodl/j2se
path is: C:\Program Files\Java\jre7\bin\javaw.exe
args is: null
native platform is: Windows, amd64 [ x86_64, 64bit ]
JavaFX runtime is: JavaFX 2.2.1 found at C:\Program Files\Java\jre7\
enabled is: true
registered is: true
system is: true
Match: ignoring maxHeap: -1
Match: ignoring InitHeap: -1
Match: digesting vmargs: null
Match: digested vmargs: [JVMParameters: isSecure: true, args: ]
Match: JVM args after accumulation: [JVMParameters: isSecure: true, args: ]
Match: digest LaunchDesc: file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp
Match: digest properties: []
Match: JVM args: [JVMParameters: isSecure: true, args: ]
Match: endTraversal ..
Match: JVM args final:
Match: Running JREInfo Version match: 1.7.0.07 == 1.7.0.07
Match: Running JVM args match: have:<> satisfy want:<>
CacheEntry[file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp]: updateAvailable=false,lastModified=Fri Sep 14 07:13:28 MDT 2012,length=915
Run Code Online (Sandbox Code Playgroud)
当我运行我正在处理的应用程序时,我得到了几乎相同的错误.我刚刚卸载了java,然后重新安装了最新的SDK.除了可能使用64位JVM而不是我安装的32位JVM之外,这没有做任何事情.错误消息保持不变.
有谁知道我做错了什么?我的构建脚本不正确吗?有更好的部署方式吗?我没有jnlp所以我对任何部署方法都开放.我只需要一些我可以在Windows机器上运行的东西,可能还需要一台mac.
我试过谷歌搜索我的问题,我搜索了StackOverflow,似乎无法找到任何相关的东西.我可能只是使用了错误的搜索词.
任何帮助将不胜感激.
谢谢,哈代
如果您使用的是 netbeans,则右键单击项目并转到项目属性,然后转到库,然后单击管理平台,然后选择默认 Javafx 平台,然后转到 JAVAFX 选项卡,然后将 JAVAFX SDK 位置更改为 Java fx 2 sdk 所在的位置并同样更改 JAVAFX JRE。希望这能解决您的问题。
| 归档时间: |
|
| 查看次数: |
3396 次 |
| 最近记录: |