I just installed Grails through sdkman, ie: sdk install grails
Evrything seems to have worked fine,
But when I type grails -version this error comes out:
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-1.7.0- openjdk-i386
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I'm on linux mint Raffaela
I know this should be an error of JAVA_HOME pointing to the wrong place, but I can't figure out why, this set up works just fine with my Android Studio for example...
Any ideas?
Thanks in advance!
Check your path to java:
echo $JAVA_HOME
Looks like there are wrong path in gradle settings
Related
I am trying to install Groovy on windows 10. I have Java 17.0.4.1 installed and trying to install groovy 4.0.5 & here is the link (https://groovy.jfrog.io/ui/native/dist-release-local/groovy-windows-installer/groovy-4.0.5/) after installation I opened command prompt typed "groovy --version" its returning empty.
I have looked at the Environment variable under System variables GROOVY_HOME is created and also the Path.
this image is from the Path:
I am not able to understand why the "groovy --version" is giving empty. Please help me with this issue.
I also faced similar issue today !!
Below are my findings and solved my problem if these can help
My JDK installed in system : C:\Program Files\Java\jdk1.8.0_201
I set Environment Variable : JAVA_HOME and value : C:\Program Files\Java\jdk1.8.0_201
I installed using installer - groovy-4.0.7.msi
I set Environment Variable : GROOVY_HOME and value : %GROOVY_HOME%bin
groovy -version
Groovy Version: 4.0.7 JVM: 1.8.0_201 Vendor: Oracle Corporation OS: Windows 10
Apology I am not able to share screen shot. Hope this might help.
I am trying to install Groovy on windows using WSL.
After installing sdkman, I run
$ sdk install groovy
Downloading: groovy 3.0.9
In progress...
############################## 100.0%
Installing: groovy 3.0.9
Done installing!
Setting groovy 3.0.9 as default.
Then I want to check, if it works, but i got this.
$ groovy -version
groovy: JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME.
Do you know where the sdk installs groovy?
Should I install anything else?
How to set path to JAVA_HOME?
I found only very old (6-7 years) post on this topic.
Additionally, I want to use vscode as editor/IDE. Do you recommend any plugins?
If you have installed Java in host then you need to export the environment variable correctly or else you need to install Java in WSL.
http://groovy-lang.org/install.html
I have tried to install groovy using (SDKMAN type) above link in ubuntu 16.04 but when i'm trying to verify the installed groovy version. groovy -version
I'm getting below error
groovy: JAVA_HOME is not defined correctly, can not execute:
Can anyone help me on this ?
I copied the latest java 1.8 to a red hat Linux server. I ran the command java -version and it returned version 1.7.0_131. I updated .bashrc and the jre to the latest version 1.8. When I run the command version java -version it still says its version 1.7.0_31. What I need to know where is this being picked up from. I have checked .profile, .bashrc and JAVA_HOME they all are pointing to the location where I update to 1.8. Greatly appreciate all your help.
Type which java and you will probably see (at least after you have followed all the symlinks) that the Java executable is taken from somewhere else than your newly set JAVA_HOME. You need to create the appropriate symlinks to version 1.8, too, like this:
ln -s /your/path/to/v18/bin/java /usr/bin/java
Be aware that existing applications might use the 1.7 Java version and you might break them when you set /usr/bin/java (or whatever path the which command showed you) to the 1.8 version.
Fyi, JAVA_HOME is not meant to be used by your shell to locate the Java command. It is to be used by other software that require Java to know where to find it.
Do it like this once
export JAVA_HOME=/jdk/path
If you use it continuously, add the above code to your .bashrc file or profile. Then open new terminal or run below code
source .bashrc
Getting below exception while executing startup.sh for Tomcat. How is this caused and how can I solve it?
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
I'm using RedHat Linux, tomcat version is 6.0.26
When I use java simply I face the same exception.
I set the JAVA_HOME and path varaible in /etc/profile as
JAVA_HOME=/usr/java/jdk1.6.0_30
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
look at this blog
This is probably java configuration issue.
Make sure JAVA_HOME is setup correctly
Can you post output of this command?
java -version
Are you able to run any other java app? Or problem just with tomcat?