-
-
Notifications
You must be signed in to change notification settings - Fork 630
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
SDKMAN: JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME #431
Comments
Ups, I haven't got defined the variable. I have not said anything. |
Also remember, do not execute the |
I know this issue is closed but it would be good to specify some sort of solutions This could happen to anyone who´s starting to use gradle or any other project, declaring a environment variable is something common to do in console. Just be sure to install GIT BASH on your machine so you can use UNIX commands on your windows machine then you just write
thats it |
I add JAVA_HOME to my java.config file under JAVA_CONF="/etc/java/java.conf" Where is my javac??? |
@szcc try installing Java with SDKMAN. SDKMAN will dynamically set the @YoruNoTori sorry for not seeing and replying your message. SDKMAN can also be used to install and manage Java, so no need to export |
Thanks for answering my question. I installed java by "sdk install java" yesterday but the JAVA_HOME did not setup by sdkman. when I try to run "grails run-app" I got error java home not found. Then I edited java.config file under JAVA_CONF="/etc/java/java.conf" and JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-1.b16.el7_3.x86_64". |
Please do reach out on our gitter user-issues channel where we can help
you. This is not a bug but a local configuration issue on your machine.
…On Tue, 30 Jan 2018, 21:38 szcc, ***@***.***> wrote:
Thanks for answering my question. I installed java by "sdk install java"
yesterday but the JAVA_HOME did not setup by sdkman. when I try to run
"grails run-app" I got error java home not found. Then I edited java.config
file under JAVA_CONF="/etc/java/java.conf" and
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-1.b16.el7_3.x86_64".
rerun my grails "run-app" I got "not a directory" error.
Now I have to work around it. install sdk 1.8 and set up java home to
point it. The idea to use sdkman is manage grails-groovy and java
together.....
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#431 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI0Bo9rc98HzcnnXfIIGyueJYNNF3RKks5tP33JgaJpZM4JIz2w>
.
|
thank you. will do |
Hi. I am facing this issue when trying to setup a build system with sublime test. I am using SDKMAN 5.7.3+337 |
I had exactly the same issue. After install JDK 1.7, JAVA_HOME is still pointing to 1.8 which I installed manually through oracle's .dmg file on Mac. sdkman seems not doing what it is claiming to do. It just installed a version of java to: .sdkman/candidates/java directory, but the OS is still pointing to 1.8 which is located at /Library/Java/VirualMachines . |
@fdchiu you can easily set JAVA_HOME like below
|
@minhtran83 SDKMAN is already responsible for setting the JAVA_HOME, so you shouldn't be doing it yourself. The problem here is most probably to do with the type of shell being used (login vs interactive), which can lead to inconsistencies in shell state. |
@marc0der it is?
I get an empty result in zsh after removing the explicit setting of |
@clehene there really isn't any magic here. You can simply use a text editor to read what As stated in the previous comment, most likely you are experiencing this due to a login shell being used, as opposed to an interactive shell. Also worth noting that most users aren't experiencing what you are, so this is most probably due to an issue in your own environment. |
This is bang on. Thanks for clarifying that. I didn't know this and we were unnecessarily setting SDKMAN FTW!! |
You just need to set |
This worked for me. |
As mentioned above, don't manually set the for example:
|
In my case, after executing What I had it was java and maven working ok, both were installed with |
It's 2023 and this still happens. No JAVA HOME. |
Yeah the issue is you have to do Here is the line of bash that I found to actually work, since this tool obviously doesn't want to be too friendly to use out-of-the-box:
|
This is contrary to what I'm seeing right now when facing the issue. Taken from here: https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch (261 upvotes, so the assumption I'm making here is that this how to 'properly' check it). Running both commands gives me:
My .bashrc file contains the below right at the end of it:
In the interest of actually providing some feedback and not just complaining (otherwise we'll never get a resolution to these types of things), I did a little more digging, because I thought it was strange that I was sometimes able to use the command 'java --version' completely fine, and other times it wasn't. Sometimes I noticed it would come back with:
Note: '$MY_HOME' is literally a drop in replacement that I've chosen to exclude for this purpose, but is the correct location for what I would expect
My follow up questions to @marc0der:
tldr; for anyone stumbling across this:
edit: formatting |
This is worked for me |
I found after installing Java 17 Correto, I could not run mvn. the use command solved this for me. sdk use java 17.0.11-amzn set my JAVA_HOME path. Hope this helps someone else. |
Thanks. saved my day! |
This worked for me
|
Hi all,
I'm using sdkman to install groovy. I've followed install instructions from http://sdkman.io/install.html
When I execute "/home/aaron/.sdkman/bin/sdkman-init.sh" I got:
Any ideas? Thanks!
I'm using Ubuntu 14.04LTS (64)
Cheers
The text was updated successfully, but these errors were encountered: