【发布时间】:2019-03-06 21:57:15
【问题描述】:
我正在尝试使我在 Windows 上制作的 JavaFX 应用程序适用于 Ubuntu。我制作了 .jar 文件,它在 Windows 10 上运行良好,但在 Ubuntu 上无法运行。无论我是从桌面双击它(启用作为可执行文件运行)还是从终端运行它,我都会收到以下错误:
javac myApp.jar 或 javac myApp
error: Class names, 'myApp.jar', are only accepted if annotation processing is explicitly requested
javac -cp myApp.jar 或 javac -cp myApp
javac: no source files
这是我在运行 java -jar myApp.jar 时遇到的错误:
Could not find or load main class Main
Caused by: java.lang.NoClassDefFoundError: javarx/application/Application
这是我的清单文件:
Manifest-Version: 1.0
Implementation-Title:
Implementation-Version:
Permissions: sandbox
JavaFX-Version: 8.0
Class-Path:
Created-By: JavaFX Packager
Implementation-Vendor:
Main-Class: Main
我已经使用apt install default-jre 命令安装了Java。我还安装了 JavaFX。
我认为应用程序尝试从何处获取其 JavaFX 库可能存在一些问题,但我不确定是否是这样,或者我将如何修复它。
【问题讨论】: