A simple solution for running Recaf.
- See the 'releases' page
For more details see the dedicated README.md
for the GUI and CLI sub-modules:
A simple launcher for Recaf 4.X and above
Home Page: https://recaf.coley.software/
A simple solution for running Recaf.
For more details see the dedicated README.md
for the GUI and CLI sub-modules:
This would allow the user via the GUI or CLI to choose what happens when they provide no arguments to the launcher. The main options would be run
and update-and-run
. This would allow the launcher to seamlessly open Recaf without any intermediate steps or required user input.
In your readme, you're saying:
This is, in fact, not true. When I try to run Recaf using java -jar launcher.jar run, I get the error:
No local cached version of JavaFX found.
- Try running with 'update-jfx'
Based on the code from src/main/java/software/coley/recaf/launch/commands/Run.java
, it indeed checks only for the locally cached version of JavaFX and ignores any bundled version (line 61: JavaFxVersion javaFxVersion = JavaFxVersion.getLocalVersion();
).
I don't want to force downloading JavaFX separately. The whole reason for using JDK with bundled JFX is to not occupy additional disk space for a copy of JavaFX for every Java app that might use it.
My proposal for a fix is:
if (javaFxVersion != null)
and don't do classpathItems.addAll(javafxDependencies);
if it's not true.This will assume JavaFX is bundled with JDK and try to run Recaf with it. Of course, bundled JavaFX could probably be checked in some way (like how the Java runtime itself does when running a JAR with javafx Application subclass as the main class).
When trying to install Recaf 4.x with launcher 0.4.1 it hangs on fetching the artifact. No network usage listed in Task Manager above 32kbps which is baseline
I can't use Recaf 2 because I need to change an annotation
C:\Users\username\Downloads>java -jar recaf-launcher-0.4.1.jar update-ci -b dev4
Attempting to resolve installed Recaf version...
Recaf jar file not found: 'C:\Users\username\AppData\Roaming\Recaf\recaf.jar'
Attempting to resolve JFX version...
No JavaFX version class found in the current classpath
Java Properties:
- java.home = C:\Program Files\Java\graalvm-jdk-17.0.11+7.1
- java.version = 17.0.11
- java.vm.vendor = Oracle Corporation
- java.vm.version = 17.0.11+7-LTS-jvmci-23.0-b34
- javafx.platform = win
- javafx.version = -1
- os.arch = amd64
- os.bitness = 64
- os.name = Windows 11
- os.processors = 20
- os.version = 10.0
- recaf.version = ?
Attempting to resolve installed Recaf version...
Recaf jar file not found: 'C:\Users\username\AppData\Roaming\Recaf\recaf.jar'
Checked for update recently on 2024/06/05 16:30:08, will check again later in 6m 52s
Recaf CI has 30 artifacts listed, fetching first matching one...
Same issue on Java 22
Here's the stdout generated when using Azul Zulu 21: stdout_zulu21.txt
Same thing with Eclipse Adoptium 17: stdout_adoptium17.txt
The exception java.lang.UnsatisfiedLinkError: 'java.lang.String com.sun.javafx.font.PrismFontFactory.regReadFontLink(java.lang.String)'
is probably generated by some JavaFX incompatibility. I'm unsure if either of these runtimes have JavaFX bundled, but a quick find
for jfx/javafx in the install directory yields nothing. Thanks in advance.
Attempting to resolve installed Recaf version...
Found Recaf's build config, checking contents...
- MAVEN_GROUP = software.coley
- MAVEN_NAME = recaf-core
- VERSION = 4.0.0-SNAPSHOT
- GIT_REVISION = 1
- GIT_SHA = ebfd9b9bb3e856eb06985493e65efe92de7b2c94
- GIT_DATE = 2024 04/15 19:52
- GIT_BRANCH = dev4
- BUILD_DATE = 2024 04/15 19:53
- BUILD_UNIX_TIME = 1713210800811
- DIRTY = 0
Attempting to resolve JFX version...
No JavaFX version class found in the current classpath
Java Properties:
- java.home = D:\Program Files\Zulu\zulu-22
- java.version = 22.0.1
- java.vm.vendor = Azul Systems, Inc.
- java.vm.version = 22.0.1+8
- javafx.platform = win
- javafx.version = -1
- os.arch = amd64
- os.bitness = 64
- os.name = Windows 11
- os.processors = 8
- os.version = 10.0
- recaf.version = 4.0.0-SNAPSHOT
Looking in 'C:\Users\Liticane\AppData\Roaming\Recaf' for Recaf/dependencies...
Running Recaf '4.0.0-SNAPSHOT' with JavaFX '23-ea+3:win'
23:52:30.171 [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:33)
at software.coley.recaf.Main.main(Main.java:70)
https://bugs.openjdk.org/browse/JDK-8325993
JavaFX 23 updates the compile target from 17 to 21. Recaf 4x currently is on 17 as a baseline. Before fetching newer versions than 22 the launcher should check if the current JVM is on version 21 or higher.
First time installing the launcher. When running java -jar recaf-launcher-0.1.3.jar update-jfx
, it attempts to download dependencies into AppData\Roaming\Recaf\dependencies
. In my case, the dependencies
directory did not exist and the launcher did not make an attempt to create the directory automatically. This caused the dependency download to fail.
dependencies
folder in appdata\recaf isnt created automatically :(((
Failed downloading FX artifact: ' https://repo1.maven.org/maven2/org/openjfx/javafx-media/22-ea+16/javafx-media-22-ea+16-win.jar'
java.nio.file.NoSuchFileException: C:\Users\yeah\AppData\Roaming\Recaf\dependencies\javafx-media-22-ea+16-win.jar
at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(Unknown Source)
at java.base/java.nio.file.Files.newOutputStream(Unknown Source)
at java.base/java.nio.file.Files.copy(Unknown Source)
at software.coley.recaf.launch.commands.UpdateJavaFX.updateTo(UpdateJavaFX.java:200)
at software.coley.recaf.launch.commands.UpdateJavaFX.update(UpdateJavaFX.java:159)
at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:44)
at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:24)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at software.coley.recaf.launch.Launcher.main(Launcher.java:51)
```
Add jdk selection option + version check to recaf launcher
To be able to double click jars and to swifty open projects. It is common to make the argument of the runnable being a path to the destination to open.
As such, please add an argument to the 4.x launcher to open Recaf with he desired workspace (jar, directory, ...).
And does nothing
C:\java\jdk22\bin\javaw -jar recaf-launcher-0.4.1.jar
Hi. I want to make simple cli command to decompile jar file. With programs like text editors I can just specify filename after program name (notepad myfile.txt
). But it doesn't work with this launcher. Where can I specify file to open? Or workspace to open or stuff like that.
Also headless mode doesn't seem to work for me, recaf still opens a window even when I use java
(not javaw
) and specify -x
option. And there's no --help
or anything
For example, when I open the launcher.jar it doesn't open, I don't see MessageBox with error, to understand what happened, I have to open recaf-launcher.log to find the line with an error.
In that case log is:
Attempting to resolve installed Recaf version...
Recaf jar file not found: 'C:\Users\u\AppData\Roaming\Recaf\recaf.jar'
It would be nice to see a MessageBox with error:
Recaf jar file not found:
``C:\Users\u\AppData\Roaming\Recaf\recaf.jar''.
I think it won't be a problem to make MessageBox display via jfx
Downloaded launcher 0.4.0, downloaded Java 22 x64 and installed that ahead of time. When I try to run recaf via the launcher, it downloads recaf and JavaFX, however there seems to be a class required that is not available.
- java.version = 22.0.1
- java.vm.vendor = Oracle Corporation
- java.vm.version = 22.0.1+8-16
...
Running Recaf '4.0.0-SNAPSHOT' with JavaFX '23-ea+3:win'
08:34:52.540 [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:33)
at software.coley.recaf.Main.main(Main.java:70)```
runed java -jar update-jfx
and the following error appeared
java.nio.file.NoSuchFileException: C:\Users\neilhuang007\AppData\Roaming\Recaf\dependencies at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) at java.base/sun.nio.fs.WindowsDirectoryStream.<init>(WindowsDirectoryStream.java:86) at java.base/sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(WindowsFileSystemProvider.java:541) at java.base/java.nio.file.Files.newDirectoryStream(Files.java:481) at java.base/java.nio.file.Files.list(Files.java:3767) at software.coley.recaf.launch.info.JavaFxVersion.getLocalVersion(JavaFxVersion.java:66) at software.coley.recaf.launch.commands.UpdateJavaFX.update(UpdateJavaFX.java:153) at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:44) at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:24) at picocli.CommandLine.executeUserObject(CommandLine.java:2041) at picocli.CommandLine.access$1500(CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461) at picocli.CommandLine$RunLast.handle(CommandLine.java:2453) at picocli.CommandLine$RunLast.handle(CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273) at picocli.CommandLine$RunLast.execute(CommandLine.java:2417) at picocli.CommandLine.execute(CommandLine.java:2170) at software.coley.recaf.launch.Launcher.main(Launcher.java:51)
Currently the Recaf process is started with no arguments, but we'll want to allow specifying content like:
Usage:
jar
path as an argument should pass that path as an input/workspace to Recaf when launchedjava
source file path as an argument should pass that path as a script to Recaf when launchedrun
and auto
commands should have new --input
and --script
arguments for passing along to Recaf when launchedSee: LaunchCommand
Just had a guy where the jars were incomplete, so using them in the URLClassLoader
didn't load all the necessary classes.
Maven hosts the md5/sha1 of files. So this should be ezpz to add.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.