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

Mac OS JAVA_HOME env variable not found error #82

Open
AddictArts opened this issue Dec 8, 2021 · 11 comments
Open

Mac OS JAVA_HOME env variable not found error #82

AddictArts opened this issue Dec 8, 2021 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@AddictArts
Copy link

Build the app with JDK15, run it and get the error message.

@theapache64
Copy link
Owner

Can you enter the command java -version in your terminal and paste the output here?

@SteinerOk
Copy link

I try to launch stackzy on MacOS 12.1, but receive this error:

image

@rickclephas
Copy link

I am not quite sure yet where the JAVA_HOME should be set for this to work automatically but you can open the app with the following command:

JAVA_HOME=$(/usr/libexec/java_home -v 15) open /path/to/Stackzy.app

@theapache64
Copy link
Owner

I think you've JDK installed, but JAVA_HOME is not set. Maybe I shouldn't rely on JAVA_HOME at all.

private fun checkJdk(onExist: () -> Unit) {
val isJdkExists = System.getenv("JAVA_HOME") != null
if (isJdkExists) {
onExist()
} else {
_syncFailedMsg.value = "Ohh no! It looks like you don't have JDK installed 😥"
}
}

@SteinerOk Can you enter echo $JAVA_HOME in your terminal?

theapache64 added a commit that referenced this issue Jan 8, 2022
@theapache64
Copy link
Owner

@SteinerOk @AddictArts Can you guys take a pull from master and try run ./gradlew run now? I've made some changes

@SteinerOk
Copy link

@theapache64, you are right :(
image

@SteinerOk
Copy link

@theapache64 I launched via JAVA_HOME=$(/usr/libexec/java_home -v 15) open /path/to/Stackzy.app, but got new error:
image

@rickclephas
Copy link

rickclephas commented Jan 8, 2022

I think you've JDK installed, but JAVA_HOME is not set. Maybe I shouldn't rely on JAVA_HOME at all.

Even with JAVA_HOME set in ~/.zshenv, ~/.zshrc or ~/.zprofile I got the same error.
Maybe it should be set somewhere else for it to affect applications as well?

Can you guys take a pull from master and try run ./gradlew run now? I've made some changes

I am seeing #80 when running ./gradlew run.
Actually ./gradlew run fails with:

Execution failed for task ':run'.
> Process 'command '/Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home/bin/java'' finished with non-zero exit value 134

However ./gradlew createDistributable does create the app which no longer shows the error message 👍🏻 .

@theapache64
Copy link
Owner

@rickclephas Interesting.
I've created an uberJar for macOS. Can you guys download this jar and run java -jar /path/to/jar ?

@rickclephas @SteinerOk @AddictArts

@theapache64 theapache64 self-assigned this Jan 11, 2022
@theapache64 theapache64 added the bug Something isn't working label Jan 11, 2022
@rickclephas
Copy link

@theapache64 I am using macOS 12.1 (MBP M1 Pro) with JDK 15 (Azul) and get the following error with that jar:

Caused by: org.jetbrains.skiko.LibraryLoadException: Cannot find libskiko-macos-arm64.dylib.sha256, proper native dependency missing.
	at org.jetbrains.skiko.Library.load(Library.kt:72)
	at org.jetbrains.skia.impl.Library$Companion.staticLoad(Library.jvm.kt:12)
	at org.jetbrains.skia.Image.<clinit>(Image.kt:144)

@theapache64
Copy link
Owner

@rickclephas Ohh you're using the M1. That needs a separate binary I guess.

This was referenced Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants