[GH-ISSUE #737] install-certificates-java.sh Doesn't work with JVMs installed via SDKMAN #732

Open
opened 2026-03-03 19:21:23 +03:00 by kerem · 12 comments
Owner

Originally created by @jeremyross on GitHub (Dec 22, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/737

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version? 2.15.0 (21500)

macOS Version? 10.15.7 (

Steps to reproduce

  1. Run install-certificates-java.sh

Expected behavior

Installs cert into JVM

/usr/libexec/java_home only returns JVMs installed by Mac OS. SDKMAN is a popular alternative way of installing and managing JVMs. I was able to modify install-certificates-java.sh and get this working:

home=/Users/jeremyross/.sdkman/candidates/java/current

A better solution would be to take into account /usr/libexec/java_home, SDKMAN, and probably homebrew installs as well.

Originally created by @jeremyross on GitHub (Dec 22, 2020). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/737 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version? 2.15.0 (21500) ### macOS Version? 10.15.7 ( ### Steps to reproduce 1) Run install-certificates-java.sh ### Expected behavior Installs cert into JVM `/usr/libexec/java_home` only returns JVMs installed by Mac OS. SDKMAN is a popular alternative way of installing and managing JVMs. I was able to modify install-certificates-java.sh and get this working: ``` home=/Users/jeremyross/.sdkman/candidates/java/current ``` A better solution would be to take into account `/usr/libexec/java_home`, SDKMAN, and probably homebrew installs as well.
Author
Owner

@NghiaTranUIT commented on GitHub (Dec 22, 2020):

Thanks for the solution. I will checkout the SDKMAN and support it 🙌

<!-- gh-comment-id:749581708 --> @NghiaTranUIT commented on GitHub (Dec 22, 2020): Thanks for the solution. I will checkout the SDKMAN and support it 🙌
Author
Owner

@NghiaTranUIT commented on GitHub (Dec 24, 2020):

It's fixed with this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.15.1_Support_SDKMAN_JAVA.dmg

Thank you for opening the ticket 🎉

<!-- gh-comment-id:750845616 --> @NghiaTranUIT commented on GitHub (Dec 24, 2020): It's fixed with this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.15.1_Support_SDKMAN_JAVA.dmg Thank you for opening the ticket 🎉
Author
Owner

@jeremyross commented on GitHub (Aug 18, 2021):

This is not working. The script fails on this line:

HOME=$(/usr/libexec/java_home)

with this message:

Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.

So, the script never gets to the part where it checks JAVA_HOME and SDKMAN.

<!-- gh-comment-id:901390497 --> @jeremyross commented on GitHub (Aug 18, 2021): This is not working. The script fails on this line: ``` HOME=$(/usr/libexec/java_home) ``` with this message: > Unable to find any JVMs matching version "(null)". > No Java runtime present, try --request to install. So, the script never gets to the part where it checks JAVA_HOME and SDKMAN.
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 19, 2021):

Thanks for getting back @jeremyross. I will revisit the script to see how to fix it 👍

If you don't mind, you can manually fix the script at

/Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Versions/A/Resources/install-certificates-java.sh

By removing the part:

# Default directory
HOME=/usr/libexec/java_home
if [ -f "$HOME" ]; then
    HOME=$(/usr/libexec/java_home)
    if [[ -z "$HOME" ]]; then
        echo "Could not find /usr/libexec/java_home!"
    elif [[ -n "$HOME" ]]; then
        echo "=> Found $HOME"
        install_certificate $HOME
    fi
fi

It will work with the SDKMAN

<!-- gh-comment-id:901548820 --> @NghiaTranUIT commented on GitHub (Aug 19, 2021): Thanks for getting back @jeremyross. I will revisit the script to see how to fix it 👍 If you don't mind, you can manually fix the script at ``` /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Versions/A/Resources/install-certificates-java.sh ``` By removing the part: ``` # Default directory HOME=/usr/libexec/java_home if [ -f "$HOME" ]; then HOME=$(/usr/libexec/java_home) if [[ -z "$HOME" ]]; then echo "Could not find /usr/libexec/java_home!" elif [[ -n "$HOME" ]]; then echo "=> Found $HOME" install_certificate $HOME fi fi ``` It will work with the SDKMAN
Author
Owner

@jamesdh commented on GitHub (Aug 28, 2022):

Pinging this issue to remind someone that it's still an issue. SDKMAN is a very popular tool among Java developers for installing modern JDK's.

<!-- gh-comment-id:1229475448 --> @jamesdh commented on GitHub (Aug 28, 2022): Pinging this issue to remind someone that it's still an issue. SDKMAN is a very popular tool among Java developers for installing modern JDK's.
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 29, 2022):

Thanks @jamesdh for reminder. I will look on it and send a beta soon 👍

Just wondering:

  • Which SDKMan version you're using?
  • And the path? echo $SDKMAN_DIR
<!-- gh-comment-id:1229604543 --> @NghiaTranUIT commented on GitHub (Aug 29, 2022): Thanks @jamesdh for reminder. I will look on it and send a beta soon 👍 Just wondering: - Which SDKMan version you're using? - And the path? `echo $SDKMAN_DIR`
Author
Owner

@jamesdh commented on GitHub (Aug 29, 2022):

@NghiaTranUIT SDKMAN 5.16.0. It's worth mentioning that SDKMAN automatically keeps itself up to date, so most people that use it will be on either the newest version or maybe one version back.

Via the SDKMAN setup script, SDKMAN_DIR="$HOME/.sdkman", hence in my case on macOS it's /Users/jamesdh/.sdkman

<!-- gh-comment-id:1230346027 --> @jamesdh commented on GitHub (Aug 29, 2022): @NghiaTranUIT SDKMAN 5.16.0. It's worth mentioning that SDKMAN automatically keeps itself up to date, so most people that use it will be on either the newest version or maybe one version back. Via the [SDKMAN setup script](https://get.sdkman.io), `SDKMAN_DIR="$HOME/.sdkman"`, hence in my case on macOS it's `/Users/jamesdh/.sdkman`
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 30, 2022):

Hey @jamesdh let's try this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.8.0_Fix_sdkman.dmg

It works fine with sdkman 👍

Screen Shot 2022-08-30 at 15 52 50
<!-- gh-comment-id:1231368729 --> @NghiaTranUIT commented on GitHub (Aug 30, 2022): Hey @jamesdh let's try this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.8.0_Fix_sdkman.dmg It works fine with sdkman 👍 <img width="682" alt="Screen Shot 2022-08-30 at 15 52 50" src="https://user-images.githubusercontent.com/5878421/187394093-a304a7f0-1905-4089-9c70-0e0591875e16.png">
Author
Owner

@jamesdh commented on GitHub (Sep 1, 2022):

@NghiaTranUIT if I do brew uninstall proxyman will that sufficiently remove any previously installed certificates so that I can retry the install w/ your beta build?

<!-- gh-comment-id:1234495811 --> @jamesdh commented on GitHub (Sep 1, 2022): @NghiaTranUIT if I do `brew uninstall proxyman` will that sufficiently remove any previously installed certificates so that I can retry the install w/ your beta build?
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 1, 2022):

Yes, it's sufficient. It will delete all Proxyman data, certificate in the disk + Keychain (Ref: github.com/Homebrew/homebrew-cask@212b287c3e/Casks/proxyman.rb (L20))

You can simply do it by the GUI: Visit Help Menu -> Advanced -> Factory Reset.


Note: It's brew uninstall proxyman, not proximal

<!-- gh-comment-id:1234500913 --> @NghiaTranUIT commented on GitHub (Sep 1, 2022): Yes, it's sufficient. It will delete all Proxyman data, certificate in the disk + Keychain (Ref: https://github.com/Homebrew/homebrew-cask/blob/212b287c3e8775f2bf320d2be09087ba7e713e6f/Casks/proxyman.rb#L20) You can simply do it by the GUI: Visit Help Menu -> Advanced -> Factory Reset. ---------- Note: It's `brew uninstall proxyman`, not `proximal` ✅
Author
Owner

@jamesdh commented on GitHub (Sep 1, 2022):

@NghiaTranUIT can confirm it appears fixed!

<!-- gh-comment-id:1234514744 --> @jamesdh commented on GitHub (Sep 1, 2022): @NghiaTranUIT can confirm it appears fixed!
Author
Owner

@karljamoralin commented on GitHub (Dec 10, 2024):

Hi @NghiaTranUIT ! Is the fix for this already in one of the stable releases? Yes, it works with version 5.11.0

<!-- gh-comment-id:2532576040 --> @karljamoralin commented on GitHub (Dec 10, 2024): ~~Hi @NghiaTranUIT ! Is the fix for this already in one of the stable releases?~~ Yes, it works with version `5.11.0`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#732
No description provided.