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

Unable to set JAVA_HOME in IntelliJ using H2 database

I created a project with the H2 database source code. I am trying to build the code but it keeps saying JAVA_HOME is not set so it won't build. However I set the JDK path in the project structure seen here. Does anyone know how to fix this issue?
rileyw
  • 1
0
votes
1 answer

Writing an integrated C/Java program and keep getting "fatal error: 'jni.h' file not found"

I am on MacOS and am having a problem that has been asked before on here numerous times. After several hours of trying all solutions, I am unable to get this error fatal error: 'jni.h' file not found to go away. I included in the file I am trying…
CHuck
  • 11
  • 2
0
votes
1 answer

I am getting JAVA_HOME not set error on azure python webapp

i am trying to install jdk on python webapp so that I can use Sparksession in my python code. But jdk gets installed in /usr/lib directory instead of /home directory and anything outside /home directory does not persist. That is why even if I use…
0
votes
0 answers

javaw.exe error and 'Open Object' has encountered a problem

I have a problem, that none of the Java applications works. A few days ago every application worked and was fine. My computer fell down but I couldn't see any damange on it. Now I wanted to show an application in java and none of the applications…
Razielruss
  • 139
  • 1
  • 7
0
votes
1 answer

I am getting this error as shown in body, while building a apk file in ubuntu, please help me to solve this error

chinmay@chinmay-Latitude-E6420:~/MyFiles/FlutterExercise/again$ flutter build apk Building without sound null safety For more information see https://dart.dev/null-safety/unsound-null-safety ERROR: JAVA_HOME is set to an invalid directory: …
0
votes
1 answer

WSL Not able to find file or directory due to space

The error I was originally getting was that wsl was not able to find JAVA_HOME. After I ran the command export JAVA_HOME="/mnt/c/Program Files/JAVA/jdk-15.0.2" And now the error it gives me is: ERROR: JAVA_HOME is set to an invalid directory:…
0
votes
1 answer

Requirements check failed for JDK (Android target: not installed)

Good day, I am very new with Cordova and Java on my MacBook I am trying to create my first snartphone app and I installed Cordova following this page. It's look like all things went well, excepted now when I try to run my app. I only did those…
pierrot10
  • 129
  • 4
  • 13
0
votes
1 answer

/opt/kafka/kafka_2.12-2.6.0/bin/kafka-run-class.sh: line 318: /usr/lib/jvm/java-8-openjdk-amd64 /bin/java: No such file or directory

When I start Kafka on my machine this error appeared. giangnt@node2:/opt/kafka/kafka_2.12-2.6.0/bin$ nohup: ignoring input and appending output to 'nohup.out' [1]+ Exit 127 nohup ./kafka-server-start.sh…
0
votes
1 answer

File Not Found Error When Running Apache Tomcat7

I try to run the tomcat using ./startup.sh under bin folder. The console print out following: Using CATALINA_BASE: /c/Users/zzhang/Desktop/apache-tomcat-7.0.107-src Using CATALINA_HOME: /c/Users/zzhang/Desktop/apache-tomcat-7.0.107-src Using…
Terry Zhang
  • 4,541
  • 8
  • 23
  • 29
0
votes
1 answer

Switch java home using /usr/libexec/java_home stop working after MacOS upgrade to Big Sur

I have a simple script to switch between different JDK versions. However, after MacOs upgrade to Big Sur, it stop working. Not sure if it's related to OS upgrade or not. The script setjavahome.sh: export JAVA_HOME=`/usr/libexec/java_home -v…
Jianwu Chen
  • 5,336
  • 3
  • 30
  • 35
0
votes
2 answers

How to update JAVA_HOME for the entire system, not just my terminal?

When I swap my JAVA_HOME to point to another env and close terminal and open it back up, I can echo it and it shows the right path. However some other applications (name IntelliJ IDEA) will hold the first JAVA_HOME until I log my user out. Simply…
c_idle
  • 1,448
  • 4
  • 22
  • 40
0
votes
1 answer

no goals specified exception when installing maven

Looks like this has been a repeating challenge to set up maven, but I'm also having my own challenges on this...! I'm a newbie to maven and java, would appreciate any help here! Here's my current set up on MacOS v10.15.7 As maven suggested I first…
byc
  • 121
  • 10
0
votes
1 answer

Why does /usr/libexec/java_home not print out anything?

I have macOS Big Sur (11.0.1) installed and I wonder why the /usr/libexec/java_home command does not print out anything at all in zsh. Only using the -h option prints out the help but any other option -V, -X, ...does not print out anything.…
du-it
  • 2,561
  • 8
  • 42
  • 80
0
votes
1 answer

Problem format hdfs during installing hadoop

I get this error below when I try to format my HDFS by runing this command:$HADOOP_HOME/bin/hdfs namenode -format in my Ubuntu 18.4 machine: /home/mohamedamine/Downloads/hadoopWork/hadoop/bin/hdfs: line 304:…
Sekmani52
  • 55
  • 8
0
votes
0 answers

JAVA_HOME setting doesn't show up in Workspace Settings to complete W3C Validation Extension Installation

I followed all the steps to install the W3C Validation Extension. I have the JAVA_HOME variable in my Environment Variables with value of C:\Program Files\Java\jdk-15.0.1 to which I appended ;%JAVA_HOME%\bin as required. Then I went to the User…