在将我的问题标记为重复或重复之前,请注意我已经尝试了一切:
2.我自己签署了我的应用程序,并在 Java 控制面板的异常列表中提供了链接。将安全级别从非常高降低到高。还是一样的结果。
3.后来我也生成了keytool store,输入了.csr和.jks文件的命令,提供了它们在NetBeans中的路径和别名,又失败了。
4.在manifest文件中提供了“all-permissions”命令,得到了相同的结果。
5.尝试将 JNLP 文件作为独立的 webstart 应用程序运行,但由于 Java 安全原因而被阻止。(不知道为什么!)
我在下面粘贴我的代码:
这是我的 FXML 文件:
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml/1" fx:controller="javafxwillrunthistime.FXMLDocumentController">
<children>
<Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" />
<Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" />
</children> </AnchorPane>
以下是我的主文件:
public class JavaFXWillRunThisTime extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("FXMLDocument.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
这是一个例外:
Missing Application-Name manifest attribute for: file:/G:/WorkSpaces/NetBeans/JavaFXWillRunThisTime/dist/JavaFXWillRunThisTime.jar
java.lang.NullPointerException: Location is required. at
javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at
javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at
javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at
javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at
javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at
javafx.fxml.FXMLLoader.load(Unknown Source) at
javafxwillrunthistime.JavaFXWillRunThisTime.start(JavaFXWillRunThisTime.java:22)
我已经尝试在我拥有的所有浏览器中运行它。阅读 Oracle 关于 JavaFX 的 web depolyment 的文档,还查看了它在其网站上提供的浏览器列表。
如果有人能告诉我下一步该怎么做,那将是一个很大的帮助?