Col-E / Recaf

The modern Java bytecode editor
https://recaf.coley.software
MIT License
6.05k stars 467 forks source link

Recaf crash - JFX validation failed, could not find 'VersionInfo' class #878

Open defaultuser1 opened 2 hours ago

defaultuser1 commented 2 hours ago

Can't seem to get this to run. Steps:

  1. Run recaf-gui-0.6.0.jar
  2. Update recaf/javafx
  3. Tried with OpenJDK22U-jdk_x64_windows_hotspot_22.0.2_9 and openjdk-23.0.1_windows-x64_bin

Diagnostics:


20:06:38.978 [AccessPatcher/main] DEBUG: Opening access to all packages
20:06:38.989 [AccessPatcher/main] DEBUG: Patching package reflection restrictions
20:06:39.053 [JFXValidation/main] ERROR: JFX validation failed, could not find 'VersionInfo' class
java.lang.ClassNotFoundException: com.sun.javafx.runtime.VersionInfo
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:413)
    at java.base/java.lang.Class.forName(Class.java:404)
    at software.coley.recaf.util.JFXValidation.validateJFX(JFXValidation.java:26)
    at software.coley.recaf.Main.main(Main.java:77)
Exit code: 101
Java
 - Version (Runtime): 22.0.2+9
 - Version (Raw):     22
 - Vendor:            Eclipse Adoptium
 - Home:              E:\Applications\OpenJDK22U-jdk_x64_windows_hotspot_22.0.2_9\jdk-22.0.2+9
JavaFX
 - Version (Runtime): <uninitialized>
 - Version (Raw):     <uninitialized>
Operating System
 - Name:           Windows 10
 - Version:        10.0
 - Architecture:   amd64
 - Processors:     24
 - Path Separator: ;
Recaf
 - Version:    4.0.0-SNAPSHOT
 - Build hash: 7c5746f05d140072a326cce78723242509d3e763
 - Build date: 2024 11/14 09:06
Launch
 - Args: software.coley.recaf.Main
Classpath:
 - File: recaf.jar
   - SHA1: 3d83959f39548e0a5e53367d09199f163ddd3f53
Threads
 - Signal Dispatcher [RUNNABLE]
 - Notification Thread [RUNNABLE]
 - Common-Cleaner [TIMED_WAITING]
   - java.base@22.0.2/jdk.internal.misc.Unsafe.park(Native Method)
   - java.base@22.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
   - java.base@22.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1847)
   - java.base@22.0.2/java.lang.ref.ReferenceQueue.await(ReferenceQueue.java:71)
   - java.base@22.0.2/java.lang.ref.ReferenceQueue.remove0(ReferenceQueue.java:143)
   - java.base@22.0.2/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:218)
   - java.base@22.0.2/jdk.internal.ref.CleanerImpl.run(CleanerImpl.java:140)
   - java.base@22.0.2/java.lang.Thread.runWith(Thread.java:1583)
   - java.base@22.0.2/java.lang.Thread.run(Thread.java:1570)
   - java.base@22.0.2/jdk.internal.misc.InnocuousThread.run(InnocuousThread.java:186)
 - Reference Handler [RUNNABLE]
   - java.base@22.0.2/java.lang.ref.Reference.waitForReferencePendingList(Native Method)
   - java.base@22.0.2/java.lang.ref.Reference.processPendingReferences(Reference.java:246)
   - java.base@22.0.2/java.lang.ref.Reference$ReferenceHandler.run(Reference.java:208)
 - Finalizer [WAITING]
   - java.base@22.0.2/java.lang.Object.wait0(Native Method)
   - java.base@22.0.2/java.lang.Object.wait(Object.java:375)
   - java.base@22.0.2/java.lang.Object.wait(Object.java:348)
   - java.base@22.0.2/java.lang.ref.NativeReferenceQueue.await(NativeReferenceQueue.java:48)
   - java.base@22.0.2/java.lang.ref.ReferenceQueue.remove0(ReferenceQueue.java:158)
   - java.base@22.0.2/java.lang.ref.NativeReferenceQueue.remove(NativeReferenceQueue.java:89)
   - java.base@22.0.2/java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:173)
 - Attach Listener [RUNNABLE]
 - main [RUNNABLE]
   - java.base@22.0.2/java.lang.Thread.dumpThreads(Native Method)
   - java.base@22.0.2/java.lang.Thread.getAllStackTraces(Thread.java:2489)
   - app//software.coley.recaf.ExitDebugLoggingHook.handle(ExitDebugLoggingHook.java:191)
   - app//software.coley.recaf.ExitDebugLoggingHook.run(ExitDebugLoggingHook.java:67)
   - app//software.coley.recaf.ExitDebugLoggingHook$$Lambda/0x00000152140edcb8.run(Unknown Source)
   - java.base@22.0.2/java.lang.Shutdown.runHooks(Shutdown.java:130)
   - java.base@22.0.2/java.lang.Shutdown.exit(Shutdown.java:167)
   - java.base@22.0.2/java.lang.Runtime.exit(Runtime.java:188)
   - java.base@22.0.2/java.lang.System.exit(System.java:1925)
   - app//software.coley.recaf.ExitDebugLoggingHook.exit(ExitDebugLoggingHook.java:220)
   - app//software.coley.recaf.Main.main(Main.java:79)
Col-E commented 2 hours ago
Exit code: 101
Classpath:
 - File: recaf.jar
   - SHA1: 3d83959f39548e0a5e53367d09199f163ddd3f53

Looks like JavaFX wasn't downloaded. The launcher adds the %RECAF%/dependencies dir as a -cp so if that directory is empty Recaf won't run.

Whats in your directory?

defaultuser1 commented 2 hours ago

Ok so the problem was running the recaf-gui with java8 causes it to launch with the wrong args. Java8: E:\Applications\OpenJDK22U-jdk_x64_windows_hotspot_22.0.2_9\jdk-22.0.2+9\bin\java.exe -cp recaf.jar software.coley.recaf.Main

Java 22: E:\Applications\OpenJDK22U-jdk_x64_windows_hotspot_22.0.2_9\jdk-22.0.2+9\bin\java.exe -cp recaf.jar;dependencies\javafx-base-24-ea+15-win.jar;dependencies\javafx-controls-24-ea+15-win.jar;dependencies\javafx-graphics-24-ea+15-win.jar;dependencies\javafx-media-24-ea+15-win.jar software.coley.recaf.Main

defaultuser1 commented 2 hours ago
Exit code: 101
Classpath:
 - File: recaf.jar
   - SHA1: 3d83959f39548e0a5e53367d09199f163ddd3f53

Looks like JavaFX wasn't downloaded. The launcher adds the %RECAF%/dependencies dir as a -cp so if that directory is empty Recaf won't run.

Whats in your directory?

Ah just saw this sorry. Thanks for your super fast reply! That directory is there with javafx-base-24-ea+15-win.jar, javafx-controls-24-ea+15-win.jar, javafx-graphics-24-ea+15-win.jar, javafx-media-24-ea+15-win.jar and was there before I tried running recaf-gui with Java22. Not sure if recaf-gui is supposed to work with Java8 or not, feel free to close this if not.

Col-E commented 35 minutes ago

Not sure if recaf-gui is supposed to work with Java8 or not, feel free to close this if not.

The launcher is designed so that you can run it with older versions of Java like version 8. Recaf requires 22+ and the launcher lets you point to that version when it starts Recaf.

That directory is there with ...

Hmmm, that's odd that its not picking up the files in there. I'll take a look at the launcher along with some other updates I'm making to it today/tomorrow.