Questions tagged [java-home]

JAVA_HOME is an environment variable which should point to the root directory of the JDK installation.

JAVA_HOME is an environment variable which indicates the directory where the Java Development Kit (JDK) software is installed.

Setting JAVA_HOME depends on the operating system:

UNIX

  • Korn and bash shells:

    export JAVA_HOME=jdk-install-dir
    
    export PATH=$JAVA_HOME/bin:$PATH
    
  • Bourne shell:

    JAVA_HOME=jdk-install-dir
    
    export JAVA_HOME
    
    PATH=$JAVA_HOME/bin:$PATH
    
    export PATH
    
  • C shell:

    setenv JAVA_HOME jdk-install-dir
    
    setenv PATH $JAVA_HOME/bin:$PATH
    
    export PATH=$JAVA_HOME/bin:$PATH
    

Windows

  1. Right click My Computer > Properties > Advanced system settings
  2. On the Advanced tab, select Environment Variables..., and then add/edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.8.0_60.

or

  1. Go to Control Panel\All Control Panel Items\User Accounts using Explorer
  2. Click on Change my environment variables
  3. Add/edit the JAVA_HOME variable to point to where the JDK software is located
613 questions
0
votes
1 answer

Maven ONLY works without changes in bash profile (JAVA_HOME or PATH) (Mac OS)

When I am trying to type in the bash profile the required commands it says that JAVA_HOME should point at a J.D.K. (Adopt Open J.D.K) and not at a J.R.E. It only worked, when i left the bash profile completely empty. But that was not what i should…
user14408564
0
votes
3 answers

JAVA_HOME path not pointing to correct path

I am using a VPN environment for code. Everything was working fine, but now I am not able to execute maven commands. The error that I get is : NB: JAVA_HOME should point to a JDK not a JRE Now when I run the following : %JAVA_HOME% I get the…
arqam
  • 3,582
  • 5
  • 34
  • 69
0
votes
2 answers

How to change the Javac version?

On Windows 10, I successfully changed my java version to JDK 1.8: C:\Users\Boommeister69>java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed…
Boommeister
  • 1,591
  • 2
  • 15
  • 54
0
votes
2 answers

JAVA_HOME is not defined correctly on Ubuntu when trying to run Ballerina code?

I have already set JAVA_HOME in the environment variables file as shown below. I also built ballerina from the source and extracted the zip with the Runtime and the tools as per the Ballerina documentation. However when I try to give this…
Suleka_28
  • 2,761
  • 4
  • 27
  • 43
0
votes
1 answer

JAVA_HOME not working to run gradlew build ( for Alloy Model Checker)

I am installing Alloy Model Checker (https://github.com/AlloyTools/org.alloytools.alloy). I cannot run gradlew build. $ C:\Alloy\org.alloytools.alloy>gradlew build ERROR: JAVA_HOME is set to an invalid directory: C:\Program…
Griselle Z
  • 127
  • 1
  • 9
0
votes
1 answer

Different java version in .sh file and terminal MAC

I'm trying to set JAVA_HOME in macOS 10.14. Currently there are 2 jdk versions (jdk-11.0.8.jdk, jdk-14.0.2.jdk) installed in /Library/Java/JavaVirtualMachines and I've exported env variable in .bash_profile export JAVA_HOME=`/usr/libexec/java_home…
Hikmat G.
  • 2,591
  • 1
  • 20
  • 40
0
votes
0 answers

Robotframework Appium - JAVA_HOME is not set currently

I've created a similar test on my windows machine and i've set JAVA_HOME in my environment variables. Now I am trying to do this on my MacOS. When typing echo $JAVA_HOME I do get a…
majinster
  • 56
  • 1
  • 4
0
votes
4 answers

Windows 10 java -version differs from JAVA_HOME

I'm struggling with Java installation on my Windows 10 machine. If I look at my JAVA_HOME the path is set for Java 13, but when I type in java -version I get a Java 8 as result. What am I doing wrong? EDIT: I added the JAVA_HOME to my user…
LStrike
  • 1,598
  • 4
  • 26
  • 58
0
votes
1 answer

'java' executable not found in JAVA_HOME on jenkins

I am working with .net core 3.1 and for that i have created a docker file also which has some tools like nodejs, openjdk-11 etcfor the Jenkins. This docker file have been pushed onto the AWS ECR (docker image is based on linux container). Main thing…
Har devgun
  • 533
  • 6
  • 25
0
votes
0 answers

.zshrc JAVA_HOME returning blank on new terminal but works when do source explicitly mac OS (catalina)

This is in continuation of my previous two stack-overflow questions echo $JAVA_HOME returns blank in MacOS catalina despite having set it properly in zshrc and Not able to change the JDK in Mac OS using Jenv and looks like I found the issue. Issue…
user12056260
0
votes
1 answer

Java_Home not present in Maven

I am new to Maven and had it configured in my machine. I just noticed that when doing mvn --version, Java Home was not present in the cmd output. Here is the output: Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home:…
0
votes
0 answers

Setting up JAVA HOME on macOS Catalina

I'm just starting out with Java and trying to setup JAVA_HOME on Mac OS Catalina, so the default terminal is zsh instead of bash. Where do I setup JAVA_HOME, in zprofile or in .zshrc ? Thanks in advance :)
0
votes
0 answers

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? while build in jenkins

I am getting compilation error while building a code in jenkins. I am using java 1.8 but can not see any mistake as I have configured JAVA_HOME path and maven path shown below.I have only one subfolder ie jre inside openjdk1.8 folder. I am confused…
0
votes
2 answers

Error message: Installing OpenDaylight "java_home"

I need to install OpenDaylight controller, I've followed the steps, but I got this error message dalal@dalal:~$ sudo ./distribution-karaf-0.4.0-Beryllium/bin/karaf karaf: JAVA_HOME not set; results may…
Its ME
  • 3
  • 3
0
votes
1 answer

JAVA_HOME is not set. (RuntimeError) while installing rjb gem for ruby in WSL

I am trying to install the gem rjb and I have come across this error extconf.rb:53:in
': JAVA_HOME is not set. (RuntimeError). The following is the entire error log. $sudo gem install rjb -v '1.4.9' --source 'https://rubygems.org/' [sudo]…