Querz / mcaselector

A tool to select chunks from Minecraft worlds for deletion or export.
MIT License
3.18k stars 177 forks source link

Consider bundling javafx libraries for better compatibility #352

Open birkett83 opened 2 years ago

birkett83 commented 2 years ago

On Debian there are official packages for openjdk 11 and openjdk 17. Debian provides javafx packages compatible with openjdk 11, but not for openjdk 17. Since mcaselctor requires both java 17 and javafx, there's no easy way to run it on debian. This may apply to other linux distros such as ubuntu but I've not tested them.

To Reproduce using debian's openjdk11 packages:

    java.lang.UnsupportedClassVersionError: net/querz/mcaselector/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

using debian's openjdk17 packages: Please install JavaFX for your Java version (17.0.3) to run MCA selector

Expected behavior It would be great if you could bundle JavaFX in your build of MCA selector so you don't need to install JavaFX separately. Various forum posts suggest this is the preferred option for using JavaFX on recent versions of java.

theslysyl commented 2 years ago

Also having the same issue on windows. Further complicated because you can't download the JavaFX 17.0.3 setup for free anymore off of the website linked in the wiki.

slayer3032 commented 2 years ago

Can confirm Linux Mint 20.3 has the same problem

mk-pmb commented 2 years ago

Please try my MCA Selector installer for Ubuntu and tell me if it worked for you.

IAmEchino commented 2 years ago

Can confirm on PopOS 22.04. Using Wine doesn't work either because the installation stops with this error:

image

Even when I navigate to the application and open it with Wine manually, it refuses to open.

Please end my suffering by implementing this.

IAmEchino commented 2 years ago

Please try my MCA Selector installer for Ubuntu and tell me if it worked for you.

Unfortunately it didn't, but I left an issue report on your git with the problem. Thanks for putting this together though! I really appreciate it! : )

EDIT: It works now!

ic22487 commented 2 years ago

Same Issue on macOS Monterey M1

Screen Shot 2022-06-30 at 10 35 41 AM
DaddyBones commented 2 years ago

Same Issue on macOS Monterey M1

Screen Shot 2022-06-30 at 10 35 41 AM

Same issue. I've followed a few tutorials to install this with no success.

Xerosigma commented 2 years ago

Same issue Screen Shot 2022-08-11 at 6 31 03 PM

Was able to get it working by installing the matching JFX version on my machine and pointing to it.

  1. Install JavaFX for your version of he JDK - https://gluonhq.com/products/javafx/
  2. Update bash profile to set the right JAVA_HOME and add a line for JFX.
  3. Execute the jar with JFX controls.

.bash_profile

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-18.0.2.jdk/Contents/Home
export JFX=~/java/javafx-sdk-18.0.2/lib

Run

java -jar --module-path $JFX --add-modules javafx.controls ~/Minecraft/mcaselector-2.1.jar
Chrisspy36 commented 2 years ago

I believe I am having the same issue on my MacOs Monterey 12.4, as others have also said. I was wondering has anyone found a fix? Am I missing something simple? I tried to look up how to download JavaFX but didn't really get a good tutorial. Is it that simple to just download JavaFX, which to me isn't simple as I've been pulling my hair out for sometime trying to figure out how to do it. Installing java 17 or 18 was very straight forward but the videos I found on Java FX seem like they are doing a lot of extra stuff I'm a little apprehensive to try as I don't want to mess anything up. Someone please help!

DaddyBones commented 2 years ago

I found I needed the Zulu JRE-FX 18 and even though I am on an M1, the M1 version did not work for me. Once installed, when I clicked on the MCA Selector file to open MCA Selector, but I got an error saying it can't find the correct folder, and will gave me the name of the folder the program is looking for. I simply renamed the Zulu folder name to the folder name MCA Selector was looking for and it worked.

Sharparam commented 4 months ago

@Querz Any input on this?

It seems impossible to get mcaselector working with the standard JRE/JDK solutions on various distros, and not bundling JavaFX is as mentioned above not standard for Java applications. It only seems to work out of the box on Windows.

I've tried with OpenJDK with OpenJFX separately installed, which mcaselector doesn't seem to understand. It also doesn't work with Oracle's own JRE/JDK which bundles JavaFX, nor with the Zulu thing that is mentioned in the wiki.

The only thing that works is manually downloading JavaFX and adding --module-path as mentioned in a comment above in this issue, which is far from ideal.

sbrl commented 1 month ago

Another alternative here that someone could try is to bundle everything required into an AppImage - which shouldn't require editing any of the original mcaselector code.

mk-pmb commented 1 month ago

I prefer downloading JFX separately because it keeps the mcaselector binary small. Would be sad if several Java applications in my software archive would waste disk space by each bloating themselves with JFX. It should be trivial to port my install script for Ubuntu to other platforms like macOS. If someone would then bundle such an installer as an AppImage, there would be an AppImage with a really easy upgrade path: Just clear its cache and restart it.

sbrl commented 4 weeks ago

@mk-pmb a bundled AppImage doesn't have to be the only option. In theory it should be trivial to provide multiple download options with a simple shell script / etc that automatically builds and prepares all forms of release.