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
0 answers

JAVA_HOME is empty and PATH is default inside the screen/script

I installed java 18 using this tutorial: https://computingforgeeks.com/install-oracle-java-18-on-ubuntu-debian/ Scripts (.sh) running at reboot from crontab doesn't have any JAVA_HOME and default PATH variables. When I run these scripts manually it…
andreasdc
  • 71
  • 1
  • 4
0
votes
1 answer

WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE

what happend: i can't solve the warnings fjw@MacBook-Pro googletest % [master] bazel info WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE. WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE. bazel-bin:…
fjw
  • 1
  • 1
0
votes
1 answer

No suitable Java Virtual Machine could be found on your system on Mac

I'm trying to open "knowage.sh" with terminal on Mac, but I have this problem: No suitable Java Virtual Machine could be found on your system. The version of the JVM must be at least 1.8 and at most 1.8. Please define INSTALL4J_JAVA_HOME to point…
0
votes
0 answers

IntellJ deploy war to Weblogic failing: The JRE was not found in directory C:\PROGRA~1\Java\JDK18~1.0_2. (JAVA_HOME)

I have just removed version 1.8.0_202 version of java and reinstalled a newer version 1.8.0_321. Now IntelliJ is failing to "Deploy/Run WAR on Weblogic". It is failing with The JRE was not found in directory C:\PROGRA~1\Java\JDK18~1.0_2.…
se22as
  • 2,282
  • 5
  • 32
  • 54
0
votes
1 answer

I want to get the path to jdk to set JAVA_HOME in ubuntu

I want to run a jar file on a ubuntu server without writing the full path. Therefore, I would like to edit the .zshrc. I would appreciate it if you could tell us how to set JAVA_HOME and PATH. I am currently trying that with reference to this web…
0
votes
0 answers

Visual Studio Code => JAVA_HOME is not set and no 'java' command could be found in your PATH

I really need help right now. So basically i already set JAVA_HOME path in Environment Variables to C:\Program Files\Java\jdk1.7.0_80, for the Path is %JAVA_HOME%\bin, and i set it all up in the System Variabels. Yet when i test it in terminal it's…
0
votes
1 answer

How to fix 'The JAVA_HOME environment variable is not defined correctly' error when JAVA_HOME variable is set correctly?

I'm trying to set up a project in my new laptop. While doing so, I faced this error even though the JAVA_HOME variable is set correctly. Error: C:\WINDOWS\system32>mvn -version The JAVA_HOME environment variable is not defined correctly This…
justcurious
  • 839
  • 3
  • 12
  • 29
0
votes
0 answers

Why "java -version" is not changing? on Mac?

I am running below command to see available versions. /usr/libexec/java_home -V and the result is: (I have deleted java8 folder from VirtualMachines directory) Matching Java Virtual Machines (2): 11.0.13, x86_64: "Amazon Corretto 11" …
abidinberkay
  • 1,857
  • 4
  • 36
  • 68
0
votes
1 answer

How to solve "JAVA_HOME is set to an invalid directory" error in Xamarin Android UITest?

I have Xamarin.UITests for ios and android. And I run its in two devices as async with command line on the androids. (with this command: dotnet "C:\Users\PCName\Desktop\AppName\RunMobileTest\bin\Debug\netcoreapp2.2\RunMobileTest.dll") I run it about…
0
votes
0 answers

JHipster cannot build after deleting JDK Version

I installed the latest JDK 17, only to notice that my JHipster Version was not compatible with it. Naturally, I decided to delete the JDK. Unfortunately, after that Ubuntu did not seem to recognize my other installed Java Versions. I ended up adding…
0
votes
1 answer

Java folder disappeared from program files Windows10

A few weeks ago I installed Java, set JAVA_HOME on my computer and the JDK in my IDE. Everything worked fine, until today. I got an error when starting my IDE, "Cannot run program" and the path I installed my Java. I checked the path and it's really…
Orit Tlv
  • 1
  • 1
0
votes
0 answers

Maven in Eclipse. Error while generating Javadoc: Unable to find javadoc command: The environment variable JAVA_HOME is not correctly set

I have been searching for the fix for this for 3 days. I have read a lot of posts (including here) that describe how to fix it, but none seem to work. The class I am in was given starter code and we were required to import into eclipse as a new…
0
votes
1 answer

Windows 10 JAVA_HOME environment variable ignored

When I run java -version from the command line it returns jre1.8.0_91. I've used setx from the command line and edited the environment variable for JAVA_HOME. The command line seem to be overridden or ignoring the environment variable. All JDK…
Sherum
  • 63
  • 7
0
votes
0 answers

java.io.IOException CreateFile failed with error 3

I have a windows 10 machine, and I have JDK 1.8 installed in it. I also have scala 2.11.12. I have installed SBT 1.2.8 and all 3 are visible in the control panel. The JAVA_HOME is properly set. However when I try to run sbt sbtVersion I get error…
user9920500
  • 606
  • 7
  • 21
0
votes
0 answers

When is setting $JAVA_HOME required/helpful?

Some tutorials set $JAVA_HOME env variable on MacBook Pro (macOS Big Sur-Zsh) and some don't. When is setting $JAVA_HOME required/helpful?