JAVAFx构建失败 [英] JAVAFx Build Failed

查看:1082
本文介绍了JAVAFx构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用JavaFx为Windows创建了一个应用程序,这很酷。我可以运行它从e(fx)剪辑,一切正常工作,但我不能从项目中创建一个jar文件。
我可以导出它(右键单击 - > Export-> Runnable Jar文件)。但是,如果我在MAC OS X上运行jar,在菜单栏中我得到javamenuitem而不是我的应用程序名称,我真的不喜欢。
我搜索如何隐藏该菜单,或者只是重命名它,我发现我必须重命名build.fxbuild文件中的应用程序标题*。现在我不能构建它。



所以这是我真正想要的:在Mac OS X中删除/隐藏/重命名javamenuitem。
如果您有任何经验,请与我分享。我将非常感激:)



当我尝试运行build.xml文件时,我收到以下错误:

  [javac]将22个源文件编译为C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build\classes 
[javac] warning:[options] bootstrap类路径未与-source连接1.7
[javac]注意:C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build\src\application\SajátKészlet.java使用未选中或不安全的操作。
[javac]注意:重新编译-Xlint:取消选中的详细信息。
[javac] 1警告
[副本]将12个文件复制到C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build\classesinit

-fx-tasks:
[taskdef]无法从资源com / sun / javafx / tools / ant / antlib.xml加载定义。没有找到。
执行部署:
[副本]将20个文件复制到C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\dist\libs

BUILD FAILED
C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build.xml:217:问题:无法创建任务或键入javafx:com .sun.javafx.tools.ant:resources
原因:名称未定义。
动作:检查拼写。
操作:检查是否已声明任何自定义任务/类型。
操作:检查任何< presetdef> /< macrodef>声明已经发生。
在这个命名空间中没有定义类型或任务


总时间:22秒

**
我使用:
-Windows 7 64bit
-jdk 8 u5
-JAVA_HOME设置
-e (fx)clipse(开普勒),我下载了一体版本(对于懒惰






I created an app with JavaFx for windows, which is really cool. I can run it from e(fx)clipse, everthing works fine, but I can't make a jar file from the project. I can export it (Right click->Export->Runnable Jar File). However, if I run the jar on MAC OS X , in the menu bar I get "java" menuitem instead of my application name ,which i really don't like. I searched for how to hide that menuitem, or just rename it, and I found that I have to rename the "Application title*" in the build.fxbuild file. Now I can't build it.

So this is what I really want: to remove/hide/rename the "java" menuitem in Mac OS X. If you have any experience, please share it with me. I will be really grateful :) .

I get the following error when I try to run the build.xml file:

[javac] Compiling 22 source files to C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build\classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] Note: C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build\src\application\SajátKészlet.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 warning
 [copy] Copying 12 files to C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build\classesinit

    -fx-tasks:
  [taskdef] Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found.
do-deploy:
     [copy] Copying 20 files to C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\dist\libs

BUILD FAILED
C:\Users\Hassan\Desktop\Programming\workspace\Raktar_vevo 2.7\build.xml:217: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:resources
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet


Total time: 22 seconds 

** I use: -Windows 7 64bit -jdk 8 u5 -JAVA_HOME is set -e(fx)clipse (Kepler), I downloaded the All-in-one version (for the lazy link)

Thanks you very much for your help!

解决方案

You need to setup jdk as jre in Prefereces->Java->Installed JREs, and check it as "separate jre" in External Tools Configuration->JRE in case of Eclipse

Edit: Run > External Tools > External Tool Configuration

这篇关于JAVAFx构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆