java.lang.Thread.run处的javaFX模糊错误(未知源)

java.lang.Thread.run处的javaFX模糊错误(未知源),javafx,proguard,obfuscation,Javafx,Proguard,Obfuscation,我是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.a

我是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);
    }
}
导入javafx.application.application;
导入静态javafx.application.application.launch;
导入javafx.application.Platform;
导入javafx.event.EventHandler;
导入javafx.stage.WindowEvent;
导入javafx.fxml.fxmloader;
导入javafx.scene.Parent;
导入javafx.scene.scene;
导入javafx.stage.stage;
公共类主页扩展应用程序{
公共静态舞台;
公共静态场景;
@凌驾
public void start(Stage)引发异常{
阶段=阶段;
父根=fxmloader.load(getClass().getResource(“login.fxml”);
场景=新场景(根);
舞台场景;
STAGE.show();
STAGE.setOnCloseRequest(新的EventHandler(){
@凌驾
公共无效句柄(WindowEvent t){
Platform.exit();
系统出口(0);
}
});
}
公共静态void main(字符串参数[]){
发射(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>;
}
-injars'***************************************************************************************************************************jar'
-outjars'*********************************************************************************************************-obf.jar'
-libraryjars'C:\Program Files\Java\jre1.8.0\U 251\lib\rt.jar'
-dontshrink
-obfuscationdictionary OBF.txt
-classobfuscationdictionary OBF.txt
-packageobfousationdictionary OBF.txt
-dontnote
-唐特沃恩
-忽视警告
#保留应用程序。保留所有应用程序类及其“main”
#方法。
-KeepClassSwithMembers公共类com.javafx.main.main,main.mainpage{
公共静态void main(java.lang.String[]);
}
#重命名FXML文件和相关视图
-AdapterResourceFileNames**.fxml、**.png、**.css
-AdapterResourceFileContents**.fxml
-自适应类字符串
#保存堆栈跟踪的元数据
-重命名SourceFileAttribute源文件
-keepattributes源文件,LineNumberTable
#保留所有注释和元数据
-keepattributes*注释*、签名、封闭方法
#保留用@FXML属性标记的字段名称
-keepclassmembers类*{
@javafx.fxml.fxml*;
}
#还保留-枚举。保留中所需的特殊静态方法
#枚举类。
-keepclassmembers枚举*{
公共静态**[]值();
公共静态**valueOf(java.lang.String);
}
#还保留数据库驱动程序。保留java.sql.Driver的所有实现。
-keep class*扩展了java.sql.Driver
#保留名称-本机方法名称。保留所有本机类/方法名称。
-保留类成员,包括描述类,允许收缩类*{
本地人;
}

我使用exe4j生成exe文件。当我运行时没有混淆,那么应用程序正在工作。但是混淆之后它就不起作用了。

我不使用proguard,所以我不知道怎么做,但是您希望避免混淆
start()
方法的名称,当您调用
launch(…)
时,反射会调用该方法。显然,这里发生的事情是proguard正在更改该方法的名称,因此通过反射找到的
start()
方法是从
Application
继承的方法,它是抽象的。您使用什么??这个程序员要杀了meI不要混淆我的代码。尝试了你的建议,效果很好!很多