无法为linux创建javafx应用程序.deb包

时间:2015-04-30 12:48:58

标签: javafx

[fx:deploy] java.io.IOException: Cannot run program "fakeroot" (in directory "/tmp/fxbundler2581933641178636333/images/linux-deb.image"): error=2, No such file or directory
[fx:deploy]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
[fx:deploy]     at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:146)
[fx:deploy]     at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:138)
[fx:deploy]     at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:132)
[fx:deploy]     at com.oracle.tools.packager.linux.LinuxDebBundler.buildDeb(LinuxDebBundler.java:846)
[fx:deploy]     at com.oracle.tools.packager.linux.LinuxDebBundler.bundle(LinuxDebBundler.java:352)
[fx:deploy]     at com.oracle.tools.packager.linux.LinuxDebBundler.execute(LinuxDebBundler.java:898)
[fx:deploy]     at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:506)
[fx:deploy]     at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:471)
[fx:deploy]     at com.sun.javafx.tools.ant.DeployFXTask.execute(DeployFXTask.java:285)
[fx:deploy]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[fx:deploy]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[fx:deploy]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[fx:deploy]     at java.lang.reflect.Method.invoke(Method.java:497)
[fx:deploy]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[fx:deploy]     at org.apache.tools.ant.Task.perform(Task.java:348)
[fx:deploy]     at org.apache.tools.ant.Target.execute(Target.java:435)
[fx:deploy]     at org.apache.tools.ant.Target.performTasks(Target.java:456)
[fx:deploy]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
[fx:deploy]     at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
[fx:deploy]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[fx:deploy]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
[fx:deploy]     at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
[fx:deploy]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:452)
[fx:deploy]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:139)
[fx:deploy] Caused by: java.io.IOException: error=2, No such file or directory
[fx:deploy]     at java.lang.UNIXProcess.forkAndExec(Native Method)
[fx:deploy]     at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
[fx:deploy]     at java.lang.ProcessImpl.start(ProcessImpl.java:134)
[fx:deploy]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[fx:deploy]     ... 24 more

BUILD FAILED
/home/india/Desktop/ReadEdge/build/build.xml:208: Error: Bundler "DEB Installer" (deb) failed to produce a bundle.

Total time: 54 seconds

2 个答案:

答案 0 :(得分:11)

错误消息在谈论&#34;没有这样的文件或目录时有点误导&#34;所以,乍一看,听起来似乎tmp目录中缺少某些东西。

实际抱怨的是您的系统上未安装fakeroot这一事实。假设您正在构建类似ubuntu的系统,那么这应该会让您感到厌烦:

sudo apt-get install fakeroot

fakeroot对我很新。 This link explains why you need it

答案 1 :(得分:5)

只是添加到jonnyp关于fakeroot的答案,因为我在尝试打包Scala Play应用程序时遇到了与OP相同的问题。

在Mac OS上,您可以使用Homebrew安装fakeroot

brew install fakeroot

要在我的Mac上创建Debian软件包,我还需要使用brew install dpkg安装Debian软件包管理模块。如果这是他们遇到的第一页,可能会保存某人搜索!