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
-1
votes
2 answers

I'm not able to change JAVA_HOME environment variable that's why I have tried deleting it but still in cmd its showing JAVA_HOME env var value

I'm not able to delete JAVA_HOME environment variable from my system. I'm using windows 10. I don't have anything as JAVA_HOME in my system variables but still in cmd if we echo %JAVA_HOME% it shows some path that didn't even exits. How to resolve…
Dexter
  • 19
  • 3
-1
votes
2 answers

How to set JAVA_HOME environment variable in macOS

I am new to macOS. I know this question has been asked a lot before but all mentioned methods are not work for me. I have tried https://www.youtube.com/watch?v=_gdpclEE-kA one also but it displayed an error like no such file or directory.(java…
thash97
  • 21
  • 1
-1
votes
1 answer

I was trying to run yarn,but am getting this issue.Yarn is installed but cant even access the version

yarn --version The system cannot find the path specified. Error: JAVA_HOME is incorrectly set. Please update C:\Users\shriy\Downloads\hadoop-3.1.0\etc\hadoop\hadoop-env.cmd '-Dhadoop.log.dir' is not recognized as an internal or external…
-1
votes
1 answer

How can I change the JAVA_HOME directory permanently on MAC?

I have a problem with my JAVA_HOME directory. Every time I want to use gradle I need to set my JAVA_HOME directory again and again. I know how to export it to the right directory but after I close my terminal, I have to do it all over again. What I…
riceplant
  • 21
  • 9
-1
votes
1 answer

Windows 7 ignores my JAVA_HOME created by my account

How do I persuade Windows to use the JDK of my account instead of default java placed in the system (admin) "Windows\System32" which run java 1.6. When i tape : where java i got the two paths (my java and system one). when i run echo %JAVA_HOME% i…
Mirlo
  • 625
  • 9
  • 26
-1
votes
2 answers

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

On executing sudo ./startup.sh in CentOS, I am getting the following error: "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined" But I have already defined it in bashrc in the following way: export…
Manish
  • 11
  • 1
  • 1
  • 2
-1
votes
1 answer

How to debug a Java error of "HOME is incorrectly set"?

C:\Users\nilotpal.datta>hdfs namenode -format Error: JAVA_HOME is incorrectly set. Please update C:\hadoop-2.8.0\etc\hadoop\hadoop-env.cmd '-Dhadoop.security.logger' is not recognized as an internal or external command, operable program or…
-1
votes
1 answer

Can't run sdkmanager.bat, error message JAVA_HOME is not set

I am trying to install android sdk through command line tools, in most of the tutorials it says that I should run android.bat from tools folder but cmd opens and then closes after a second or two, so I tried with the sdkmanager.bat from…
-1
votes
1 answer

JAVA_HOME doesn't take effect in Linux

please see my command output below: steven81@LinuxVMzhexin:~$ echo $JAVA_HOME /usr/local/jdk-10.0.1 steven81@LinuxVMzhexin:~$ cd /usr/local/jdk-10.0.1/ steven81@LinuxVMzhexin:/usr/local/jdk-10.0.1$ ls -l total 32 drwxr-xr-x 2 root root 4096…
user2575502
  • 703
  • 12
  • 28
-1
votes
2 answers

macOS shell: JAVA_HOME is empty inside script

I have macOS 10.11.6. The JAVA_HOME is set in the .bash_profile as export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) export PATH=$JAVA_HOME/bin:$PATH From command line, I can see it >echo…
Bing Lu
  • 3,232
  • 7
  • 30
  • 38
-1
votes
1 answer

Maven - JAVA_HOME location and Compilation failure executing javac

---skippable part--- Hi all, first time here and hopefully I'm not writing a clone of anything else. I spent days looking for cases like mine and all the things I tried failed to work, or couldn't simply find the correct solution for me. I'm trying…
GondraKkal
  • 87
  • 2
  • 16
-1
votes
1 answer

javac is not recognised as internal or external command

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_31 PATH = %JAVA_HOME%\bin; CLASSPATH=%JAVA_HOME%\lib;.; In cmd, java -version is working fine but javac is not. It is giving error.
Shiva Garg
  • 826
  • 9
  • 17
-1
votes
1 answer

Is it necessary to modify PATH, CLASSPATH, and JAVA_HOME in order to use Eclipse?

Is it necessary to modify PATH, CLASSPATH, and JAVA_HOME in order to use Eclipse? When writing some code in Eclipse, does one need to change the PATH to add jdk/bin path in Windows environment variables? Does it work if one doesn't set PATH when…
canmurat
  • 159
  • 11
-1
votes
4 answers

linux red hat enterprise linux

I installed jdk1.6.0_16 on enterprise linux 4 and I also set teh JAVA_HOME in my ~/.bash_profile echo $JAVA_HOME correctly shows the new path of the java file export JAVA_HOME=/jdk16/jdk1.6.0_16/bin/java The bin directory is also int he…
user229432
  • 97
  • 2
  • 4
  • 11
-1
votes
2 answers

How to fix JAVA_HOME not set on Ubuntu when hadoop-env.sh is already set?

I already set the hadoop-env.sh to : # export JAVA_HOME=/usr/lib/jvm/java-6-sun but still have the same error when I start the hadoop : Warning: $HADOOP_HOME is deprecated. starting namenode, logging to…
user1943422
  • 11
  • 1
  • 3
1 2 3
40
41