Home > database >  Warning: JAVA_HOME environment variable is not set
Warning: JAVA_HOME environment variable is not set

Time:10-31

My OS is Windows 10. I had an error when starting the .\artemis in the Windows PowerShell. It said:

Warning: JAVA_HOME environment variable is not set.

I already setting the JAVA_HOME's path at C:\Program Files\Java\jdk-19\bin. This is the result for echo %JAVA_HOME%:

C:\Program Files\Java\jdk-19\

I tried to test the mvn -v:

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:\apache-maven-3.8.1\bin\..
Java version: 19.0.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-19
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

(it should not be shown if the JAVA_HOME is not set tho)

I tried the java -version:

java version "19.0.1" 2022-10-18
Java(TM) SE Runtime Environment (build 19.0.1 10-21)
Java HotSpot(TM) 64-Bit Server VM (build 19.0.1 10-21, mixed mode, sharing)

The javac -version:

javac 19.0.1

Can someone explain how to fix it?

I forgot to mention it when I use git bash to run ./artemis the result is

./artemis: line 93: C:\Program Files\Java\jdk-19;/bin/java: No such file or directory

CodePudding user response:

Did you try using the short name? It’s been some time since I used windows. If I recall correctly I used to use PROGRA~1 instead of “Program files”.

CodePudding user response:

Install and set Java SDK 11 as JAVA_HOME. Most applications will not work with SDK 18 or higher.

Artemis notes:

Note on Java versions: The old v17.0.1 version of the Artemis software required Java version 1.8 to run. All recent releases from v18.0.0 onwards require a minimum of Java 9 and ideally Java 11. This must be installed first.

Extracted from http://sanger-pathogens.github.io/Artemis/

  • Related