Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jd-gui does not run since Big Sur #161798

Closed
6 tasks done
rgov opened this issue Dec 6, 2023 · 13 comments
Closed
6 tasks done

jd-gui does not run since Big Sur #161798

rgov opened this issue Dec 6, 2023 · 13 comments
Labels
outdated stale Issue which has not received any feedback for some time.

Comments

@rgov
Copy link
Contributor

rgov commented Dec 6, 2023

Verification

Description of issue

I installed the JD-GUI cask but the Java runtime dependency was not installed:

ERROR launching 'JD-GUI'

No suitable Java version found on your system!
This program requires Java 1.8+
Make sure you install the required Java version.

The formula does not reference the dependency on Java.

It should probably have a caveats clause with depends_on_java, but this isn't sufficient.

I did already have the temurin package, version 20.0.2,9 installed, which didn't seem to work, nor did upgrading to 21.0.1,12.

Command that failed

brew install --cask jd-gui

Output of command with --verbose --debug

/opt/homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromAPILoader): loading jd-gui
==> Cask::Installer#install
==> Printing caveats
==> Cask::Installer#fetch
==> Downloading https://github.com/java-decompiler/jd-gui/releases/download/v1.6.6/jd-gui-osx-1.6.6.tar
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.1.24\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.1.2\)\ curl/8.1.2 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://github.com/java-decompiler/jd-gui/releases/download/v1.6.6/jd-gui-osx-1.6.6.tar
Already downloaded: /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar
==> Checking quarantine support
/usr/bin/env /usr/bin/xattr -h
/usr/bin/env /usr/bin/swift -target arm64-apple-macosx14 /opt/homebrew/Library/Homebrew/cask/utils/quarantine.swift
==> Quarantine is available.
==> Verifying Gatekeeper status of /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar
==> /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar is quarantined
==> Verifying checksum for 'fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar'
==> Installing Cask jd-gui
==> Cask::Installer#stage
==> Extracting primary container
==> Using container class UnpackStrategy::Tar for /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar
/usr/bin/env tar --extract --no-same-owner --file /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar --directory /private/tmp/d20231205-25230-3o0o9
/usr/bin/env cp -pR /private/tmp/d20231205-25230-3o0o9/jd-gui-osx-1.6.6/. /opt/homebrew/Caskroom/jd-gui/1.6.6/jd-gui-osx-1.6.6
==> Verifying Gatekeeper status of /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar
==> /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar is quarantined
==> Propagating quarantine from /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar to /opt/homebrew/Caskroom/jd-gui/1.6.6
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/rzg/Library/Caches/Homebrew/downloads/fe7da8805b9556958179f399831e79761541d4d21930d561151f4d1832444a30--jd-gui-osx-1.6.6.tar
/usr/bin/env /usr/bin/xargs -0 -- /bin/chmod -h u+w
/usr/bin/env /usr/bin/xargs -0 -- /usr/bin/xattr -w com.apple.quarantine 0181\;65700b6f\;Homebrew\\x20Cask\;42FD67D0-1EA5-4F31-AEBC-4D2EAE6DDA76
==> Creating metadata directory: /opt/homebrew/Caskroom/jd-gui/.metadata/1.6.6/20231206055353.462
==> Creating metadata subdirectory: /opt/homebrew/Caskroom/jd-gui/.metadata/1.6.6/20231206055353.462/Casks
==> Installing artifacts
==> Installing artifact of class Cask::Artifact::App
==> Moving App 'JD-GUI.app' to '/Applications/JD-GUI.app'
🍺  jd-gui was successfully installed!

Output of brew doctor and brew config

HOMEBREW_VERSION: 4.1.24
ORIGIN: https://github.com/Homebrew/brew
HEAD: ab6a7ed5a122b6d4f9d441ef76c86032398ced5f
Last commit: 5 hours ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 96429d0c4d7356e72396b83523ea4c74a4eb3253
Core tap last commit: 7 months ago
Core tap branch: colmap
Core tap JSON: 06 Dec 05:48 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.Bk40vCSTFO/org.xquartz:0
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 14.1.2-arm64
CLT: 15.0.0.0.1.1694021235
Xcode: 15.0.1
Rosetta 2: false

Output of brew tap

homebrew/cask
homebrew/core
homebrew/services
smokris/getwindowid
yt-dlp/taps
@rgov
Copy link
Contributor Author

rgov commented Dec 6, 2023

The main executable for JD-GUI is the script at JD-GUI.app/Contents/macOS/universalJavaApplicationStub.sh. This script is failing to detect the Java runtime, and throwing the aforementioned error dialog.

The script reads the JavaX/JVMVersion key from JD-GUI.app/Contents/Info.plist, which contains 1.8+. Then it invokes /usr/libexec/java_home -F -v 1.8+ which errors that the specified version is not found.

It's unclear to me if + is really supported in the java_home utility. For instance -v 21 works, but -v 21+ does not.

@rgov
Copy link
Contributor Author

rgov commented Dec 6, 2023

It's hacky but I changed the required Java version to 21 to see if it would run with the newer JRE. I quickly hit this exception, but the workaround of adding --add-exports java.desktop/com.apple.eawt=ALL-UNNAMED to the java command invocation by the universalJavaApplicationStub.sh script worked OK.

In summary, this program is broken on modern macOS, but can be fixed with some patches to the included universalJavaApplicationStub.sh. Someone has shown how here:

g1a55er/jd-gui@5e74301

While the project is very useful and ought to remain in Homebrew, unfortunately it is not actively maintained, so this workaround would have to be implemented in the formula.

@bevanjkay
Copy link
Member

@rgov homebrew-cask simply distributes the packages/binaries as provided by upstream. Because we do not build anything, there is not way or precedent from patches to be applied.
The way forward is to see if the fixes can be released by the upstream developers.

@rgov
Copy link
Contributor Author

rgov commented Dec 6, 2023

That's a fair point, I didn't think about casks not being patched.

@rgov rgov closed this as completed Dec 6, 2023
@rgov
Copy link
Contributor Author

rgov commented Dec 6, 2023

Unfortunately maybe that means the cask should be pulled. It doesn't run as-is.

@rgov rgov reopened this Dec 6, 2023
@krehel
Copy link
Member

krehel commented Dec 7, 2023

Looks like there hasn't been an update in 4 years (last release 2019-12-25).

If this is broken without a reasonable workaround and it affects everyone who uses it, I could support removal.

@rgov - since you know more than we do in this instance, when you say it "doesn't run as-is", can you help us understand the breadth of non-functionality? Would it be all recent macOS versions, all Intel, ARM, etc? We only want to pull if this is legitimately broken for an overwhelming majority of users who would download it.

@rgov
Copy link
Contributor Author

rgov commented Dec 7, 2023

I believe it has been broken since Big Sur, and that this brokenness affects both architectures. This is based on GitHub issues filed to the project since 2020 that match my investigation above.

@bevanjkay
Copy link
Member

It looks like the cask is quite popular ~5,000 downloads in the last year. So it's interesting that this is the first report we have seen of it being non-functional.

@rgov
Copy link
Contributor Author

rgov commented Dec 8, 2023

https://github.com/java-decompiler/jd-gui/issues?q=is%3Aissue+%22Mac%22+OR+%22macOS%22+OR+%22OS+X%22+OR+%22osx%22+ Most of the recent ones refer to how universalJavaApplicationStub.sh is broken.

I agree it's a very useful tool and it's a shame to drop it. I think the formula could be converted to a non-cask formula that builds it with the necessary patches applied -- if it is kosher to build .app bundles like this one would.

I installed JDK 8 using zulu8 from homebrew/cask-versions, and then issued JAVA_HOME=$(/usr/libexec/java_home -v 1.8) ./gradlew build and it produced a working .app. However I don't know if Homebrew supports depends_on with a cask from a tap like that.

I spent a little bit trying to get it to build with Temurin 21, but it doesn't seem to be able to run the old Gradle, and it requires too many build script changes to support newer Gradle.

@rgov rgov changed the title jd-gui does not depend on jd-gui does not run since Big Sur Dec 8, 2023
@1366613
Copy link

1366613 commented Dec 27, 2023

I'm using macOS Sonoma 14.3 and JD-GUI itself appears to be able to run if invoked directly via java -jar /Applications/JD-GUI.app/Contents/Resources/Java/jd-gui-1.6.6-min.jar

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale Issue which has not received any feedback for some time. label Jan 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
@sonique6784
Copy link
Contributor

sonique6784 commented Feb 5, 2024

I investigated this issue and noticed that the MainClass is not properly defined in the main JD-GUI project, leading to this issue.
I opened a PR on JD-GUI: java-decompiler/jd-gui#440
@rgov please consider re-opening this issue.

@rgov
Copy link
Contributor Author

rgov commented Feb 5, 2024

@sonique6784 I cannot reopen the issue. The Homebrew team cannot do much more than decide whether to remove the formula. The JD-GUI author is unresponsive so we cannot get PRs merged there, either.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated stale Issue which has not received any feedback for some time.
Projects
None yet
Development

No branches or pull requests

5 participants