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

"Java home is different." when building gradle project on Intelij

I tried to import a gradle project on InteliJ but I get this error when it's building : `Java home is different. Expecting: 'C:\Program Files\Java\jdk-1.8' but was: 'C:\Program Files\Java\jdk-1.8\jre'. Please configure the JDK to match the expected…
Florian
  • 1
  • 3
0
votes
1 answer

How can i remove an email from an string using a String class>

Which string class is to use when we want to remove an email address from a string. need help and i am a newbie in java. thanks
shohag
  • 1
0
votes
0 answers

Installation Android SDK tools / Java SE Development Kit not found

enter image description here Setting a variable JAVA_HOME (+Path): C:\Program Files\Java C:\Program Files\Java\jdk-20 C:\Program Files\Java\jdk-20\bin Attempt to leave only for the user and only for system Other solutions from: Here Here and many…
0
votes
0 answers

JAVA_HOME is set to an invalid directory: How to set JAVA_HOME path for flutter?

I am trying to install flutter at my window 10. but i hava problems like this enter image description here I googled it for 10 days, i reinstall java and set the path of java .. C:\Program Files\Java\jdk-20; C:\Program…
nuguri
  • 1
  • 1
0
votes
3 answers

Unable to fix: JAVA_HOME is set to an invalid directory

I am taking a spring boot course and am up to a stage where the program is being run from the command window. I thought I had downloaded maven correctly but if I type mvn package I get: 'mvm' is not recognized as an internal or external command,…
Patrick
  • 1
  • 1
0
votes
0 answers

How can set different JAVA_HOME for each application?

I want use multiple application in Debian that each of them work with different version of java. In /etc/profile I can add only have JAVA_HOME and add JAVA_HOME/bin of that version to path. Is there any way that I can determine the version of java…
Tavakoli
  • 1,303
  • 3
  • 18
  • 36
0
votes
0 answers

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Android\Android Studio1\jre

its showing me this error in react native please help, i am setting it up but it is not opening virtual phone screen
0
votes
0 answers

Error with Gradle task assembleDebug failed with exit code 1

Gradle task assembleDebug failed with exit code 1 I tried to run the main.dart code but it gave me an error saying, JAVA_HOME has been set to an invalid directory: C:\Program Files\Java\jdk-19\bin
0
votes
1 answer

JAVA_HOME is set to an invalid directory , WHY?

I have set JAVA_HOME in my system ERROR: JAVA_HOME is set to an invalid directory: C:\Users\Yazan\Downloads\jdk-19.0.2 Please set the JAVA_HOME variable in your environment to match the location of your Java installation. in android studio and I…
Yazan
  • 9
  • 3
0
votes
1 answer

Flutter doctor --android-licenses error: A JNI error has occurred, please check your installation and try again

I set JAVA_HOME and install android SDK command-line Tools but I still get an error Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError:…
Mahan
  • 33
  • 6
0
votes
1 answer

java path error in android studio setup for flutter while asking to review the android licenses

flutter doctor --android-licenses ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_202 Please set the JAVA_HOME variable in your environment to match the location of your Java installation. i tried uninstalling jdk and…
0
votes
0 answers

could not find java - Windows Server

I installed Java SRE and JDK. I rebooted the server. I am still getting the "could not find java; set JAVA_HOME or ensure java is in PATH" error. What else should I look for to solve this? Thanks Here's my PS output. I shortened the Path to just…
Kris Kilton
  • 938
  • 9
  • 11
0
votes
1 answer

Ionic Uncaught (in promise): ReferenceError: cordova is not defined

I don't know anything about Ionic, but I was asked to configure the development environment and run an existing ionic angular app. Can someone please help me to make this work. P.S.: The project/app I'm trying to run in my environment is working and…
miskaka
  • 59
  • 4
0
votes
1 answer

mac os Terminal name issue

i'm new in macOs environment and after trying to set java home path a have now my terminal like that every time i launch it: Last login: Wed Feb 1 22:03:04 on ttys001 export JAVA_HOME=$(/Users/myname/libexec/java_home) myname@157 ~ % please someone…
adiv
  • 27
  • 5
0
votes
2 answers

Why "Failed to load JVM DLL"?

I updated android studio from Dolphin to Electric Eel and now it won't start, giving the following error message: Failed to load JVM DLL C:\Program Files\Android\Android Studio\jbr\\bin\server\jvm.dll If you already have a JDK installed, define a…