我已按照本指南将 JavaFX 设置到 Linux 机器上。首先我已经安装了 Java 11
asus@asus-pc:/usr/share/openjfx/lib$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu219.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu219.04.1, mixed
mode, sharing)
asus@asus-pc:/usr/share/openjfx/lib$
Run Code Online (Sandbox Code Playgroud)
然后我从命令安装了 OpenJFX sudo apt-get install openjfx
asus@asus-pc:/usr/share/openjfx/lib$ ls
javafx.base.jar javafx.graphics.jar javafx.swing.jar
javafx.controls.jar javafx.media.jar javafx.web.jar
javafx.fxml.jar javafx.properties src.zip
asus@asus-pc:/usr/share/openjfx/lib$
Run Code Online (Sandbox Code Playgroud)
然后在 Eclipse 中创建了一个库。
然后我将它包含到我的 java 项目中。我尝试运行此代码:
package se.danielmartensson.start;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application{
/*
* Start the start(Stage front)
*/
public …Run Code Online (Sandbox Code Playgroud) 我有一个经典问题:将 JavaFX 11 与 OpenJDK 11 与 Eclipse IDE 一起使用。
Error: JavaFX runtime components are missing, and are required to run this application
Run Code Online (Sandbox Code Playgroud)
我有 OpenJDK 11.0.2
dell@dell-pc:~$ java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
dell@dell-pc:~$
Run Code Online (Sandbox Code Playgroud)
我也有JavaFX 11 SDK。顺便一提!如果您想知道,我正在使用 Lubuntu Linux 18.10。

然后我.jar将JavaFX 11 SDKEclipse IDE 中的文件包含到一个库包中。
你知道为什么吗?如果我.jar从 Maven导入所有这些文件而不是下载JavaFX SDK并将其导入到库中,我会遇到同样的错误。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" …Run Code Online (Sandbox Code Playgroud) 我通过 Maven 存储库选择了 Apache Commons IO、JSerialComm 和 Ini4J 库。
但是当我尝试通过创建图像时mvn javafx:jlink出现以下错误:
[INFO] --- javafx-maven-plugin:0.0.2:jlink (default-cli) @ JUSBPlotter ---
[WARNING] Required filename-based automodules detected. Please don't publish this project to a public artifact repository!
Error: automatic module cannot be used with jlink: ini4j from file:///root/.m2/repository/org/ini4j/ini4j/0.5.4/ini4j-0.5.4.jar
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:447)
Run Code Online (Sandbox Code Playgroud)
我似乎与此有关:
Error: automatic module cannot be used with jlink:
Run Code Online (Sandbox Code Playgroud)
我的模块文件如下所示:
module org.openjfx.JUSBPlotter {
requires …Run Code Online (Sandbox Code Playgroud) 通常我一直在使用GNU Octave来解决二次规划问题。
我解决的问题是
x = 1/2x'Qx + c'x
Run Code Online (Sandbox Code Playgroud)
受制于
A*x <= b
lb <= x <= ub
Run Code Online (Sandbox Code Playgroud)
哪里lb和ub是下限和上限,例如限制x
当我解决时,我的 Octave 代码看起来像这样。只需简单的一行
U = quadprog(Q, c, A, b, [], [], lb, ub);
Run Code Online (Sandbox Code Playgroud)
方括号[]是空的,因为我不需要等式约束
Aeq*x = beq,
Run Code Online (Sandbox Code Playgroud)
所以我的问题是:在 Python 中是否有一个易于使用的二次求解器来解决问题
x = 1/2x'Qx + c'x
Run Code Online (Sandbox Code Playgroud)
受制于
A*x <= b
lb <= x <= ub
Run Code Online (Sandbox Code Playgroud)
或受制于
b_lb <= A*x <= b_ub
lb <= x <= ub
Run Code Online (Sandbox Code Playgroud)