如何解决java.lang.Thread.run上的javaFX模糊处理错误未知源
我是JavaFX的新手。尝试运行JavaFX应用程序时出现此错误
Exception in Application start method
java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
at java.lang.Thread.run(UnkNown Source)
Caused by: java.lang.AbstractMethodError: javafx.application.Application.start(Ljavafx/stage/Stage;)V
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.invokelaterdispatcher$Future.run(invokelaterdispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
... 1 more
我的主班是main.mainpage
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.stage.WindowEvent;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class mainpage extends Application {
public static Stage STAGE;
public static Scene SCENE;
@Override
public void start(Stage stage) throws Exception {
STAGE = stage;
Parent root = FXMLLoader.load(getClass().getResource("login.fxml"));
SCENE = new Scene(root);
STAGE.setScene(SCENE);
STAGE.show();
STAGE.setonCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent t) {
Platform.exit();
System.exit(0);
}
});
}
public static void main(String args[]) {
launch(args);
}
}
Proguard配置文件:
-injars '************************************************************.jar'
-outjars '************************************************************-obf.jar'
-libraryjars 'C:\Program Files\Java\jre1.8.0_251\lib\rt.jar'
-dontshrink
-obfuscationdictionary OBF.txt
-classobfuscationdictionary OBF.txt
-packageobfuscationdictionary OBF.txt
-dontnote
-dontwarn
-ignorewarnings
# Keep - Applications. Keep all application classes,along with their 'main'
# methods.
-keepclasseswithmembers public class com.javafx.main.Main,main.mainpage {
public static void main(java.lang.String[]);
}
# Rename FXML files together with related views
-adaptresourcefilenames **.fxml,**.png,**.css
-adaptresourcefilecontents **.fxml
-adaptclassstrings
# Save Meta-data for stack traces
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
# Keep all annotations and Meta-data
-keepattributes *Annotation*,Signature,EnclosingMethod
# Keep names of fields marked with @FXML attribute
-keepclassmembers class * {
@javafx.fxml.FXML *;
}
# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# Also keep - Database drivers. Keep all implementations of java.sql.Driver.
-keep class * extends java.sql.Driver
# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,includedescriptorclasses,allowshrinking class * {
native <methods>;
}
我使用exe4j制作exe文件。当我没有混淆地运行时,该应用程序正在运行。但混淆后无法正常工作。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。