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.
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.
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
New on Linux, I try to install the JavaEE 6 SDK, first step to install GlassFFish:
http://www.oracle.com/technetwork/java/javaee/downloads/java-ee-sdk-6u4-jdk-7u11-downloads-1900532.html
When I run
sh java_ee_sdk-6u4-jdk7-linux-x64.sh
on my server, I get prompted that I should have Java installed:
Could not locate a suitable jar utility.
Please ensure that you have Java 6 or newer installed on your system
and accessible in your PATH or by setting JAVA_HOME
This is where I am confused:
is it the Java from the JDK package? But I am in the process of installing it, so of course I don't have it installed yet!
is it the Java from the JRE then? Should I install it first (and set up the environment variables etc.)?
Thx for any clarification!
In order to use any java code, including Java Development Kit, JDK, you'll need to have Java Runtime Environment, JRE. Most of the JDK package comes with JRE. JRE contains API to run Java classes.
I am new to using Linux. I installed grails by setting env variable GRAILS_HOME and added ot to PATH variable. I also exported both and when I typed in grails command.. It worked fine. When I closed that terminal session and opened a another new session, all the env variables that I had set up has all gone.
I was wondering how to have them available for all sessions.
Any help is appreciated
Thanks
Edit the .bashrc file of the user launching Grails.
Add the same lines as your commands:
GRAILS_HOME=/home/of/grails
export GRAILS_HOME
PATH=$PATH:$GRAILS_HOME/bin
you need to add $GRAILS_HOME/bin to the PATH (rather than $GRAILS_HOME)
Update
The best way to install Grails on Linux/Mac is to use GVM.
GVM is a tool for managing parallel Versions of multiple Software Development Kits on most Unix based systems. It provides a convenient command line interface for installing, switching, removing and listing Candidates.
In addition to Grails, you can also use GVM to manage your installation of
Groovy
Griffon
Gradle
vert.x
If you have an Ubuntu (or equal) installation. You could add a repository to it. It should do all the stuff for you:
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails
you need to set them under ~/.bashrc file and then type source ~/.bashrc in your terminal so you don't have to close and re-open it again.
In /etc/profile.d/ create a script name grails.sh:
export GRAILS_HOME=/opt/grails
export PATH=$GRAILS_HOME/bin:$PATH
Change /opt/grails to where you unzipped grails.
This will make it available for all users.
If you are on ubuntu define the GRAILS_HOME variable with its installation path in /etc/environment and edit the system path variable as shown in second line
GRAILS_HOME=/opt/grails
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/grails2/bin:"
Groovy Grails Installation:
Before starting up install JAVA on linux system
Check java version using command
$> java -version
Install grails on Linux using Installing-a-grails-development-environment-on-linux
Before installing grails will need to install GVM (Grails version manager) from GVM Tool Installation
After installation of GVM from the above link, we will be able to run Grails sample application. Check it out with command
$> grails -version
Check Environment variable is set or not for Java as well as Grails with command
$> printenv
Create demo application and run the server for Grails using:
$> grails create-app demo
Go to path
$> cd demo/
Run the server
$> grails run-app
Run the server on specific port 9090
$> grails run-app -Dserver.port=9090
Tools and running environment set up for Groovy Grails:
Install GGTS (Groovy Grails Tool Suit) using GGTS with Eclipse IDE and tool
Select Eclipse package on linux from the above link:
YouTube Video Tutorial:
All Grails documentation video tutorials for the installations and running sample application is present here YouTube Channel