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 not working for Maven

I have tried setting up my JAVA_HOME with the path I have got from using the command where Java. But still when I am trying to launch mvn.bat it's not working. I have tried setting up JAVA_HOME with all the below paths: C:\Program…
Soumik Deb
  • 21
  • 2
0
votes
1 answer

JAVA_HOME is lost in script on remote unix machine

I have a script (script1.sh) in a unix machine that calls a other script (script2.sh) in other unix remote machine: ssh user@machine /opt/.../script2.sh param1 param2 There is a trust relationship between both machines. If I run the script2, it…
Jose Antonio
  • 578
  • 1
  • 8
  • 34
0
votes
2 answers

Not able to start Android studio

I have gone through all these links. Android Studio can't Start Error to run Android Studio i have also set Path- C:\Program Files\Java\jdk1.7.0_05\bin JAVA_HOME -C:\Program Files\Java\jdk1.7.0_05 My android studio is in this path -…
RAGHU RAM
  • 11
  • 1
  • 1
0
votes
2 answers

error while trying to set $JAVA_HOME (linux)

I'm trying to set up Minecraft Forge SDK. I need to set up the JAVA_HOME variable: kiwi@kiwi-gigabyte:~/Desktop/forge-1.7.10-10.13.0.1180-src$ export $JAVA_HOME '/usr/lib/jvm/java-7-openjdk-i386/bin' bash: export:…
thekiwi5000
  • 137
  • 7
0
votes
1 answer

Detect os type and set JAVA_HOME

I would like to detect the os type in a bash script and set JAVA_HOME accordingly. if [[ $(type -t apt-get) == "file" ]]; then os="apt" elif [[ $(type -t yum) == "file" ]]; then os="yum" else echo "Could not determine os." …
jquery
  • 437
  • 1
  • 4
  • 6
0
votes
2 answers

Installing ant; clearly misunderstanding JAVA_HOME

I am installing ant on a Windows XP machine, and am following the instructions at Apache's manual site. It said to set JAVA_HOME, so I checked, saw there was no environment variable named JAVA_HOME, made one, and set it to "C:\Program…
StormShadow
  • 1,589
  • 4
  • 25
  • 33
0
votes
1 answer

Java Home Directory

I am looking for my java home directory. When I tried "whereis java" I got java: /usr/share/java but then when I did ls -lah /usr/share/java I got: total 12K drwxr-xr-x 2 root root 4.0K Aug 13 04:37 . drwxr-xr-x 100 root root 4.0K Aug 13 04:38…
user2590144
  • 281
  • 2
  • 7
  • 16
0
votes
0 answers

Batch script for creating an array and store values and co

Hi I need a batch script which want to Create an array store a list of values(1.6_445,1.6_555,1.6_745,1.7).Then it needs to Echo the java vesion from the system and the value of the java vesion needs to compare the values with values in the array…
Van
  • 635
  • 1
  • 6
  • 10
0
votes
1 answer

A script to check the java version and java home

I'm a MR tool admin I need a batch script to satisfy the below requirements It must check whether Java home is set in Computer > properties (right click) > Advanced system settings > Advanced > Environment Variables. If Java home is available it…
Van
  • 635
  • 1
  • 6
  • 10
0
votes
1 answer

Batch script to check the java home

I need to check that whether java home is available in my system and if java home is not availkable it needs to display an error message and want to check the java version is less than 1.7.If it is greater than 1.7 it needs to display an error.is it…
Chanthu
  • 774
  • 7
  • 15
0
votes
1 answer

Error while running a program on Android Studio

Error in android while trying to start Virtual Device Manager: Cannot launch AVD manager. Output: "C:\PROGRA~2\Android\ANDROI~2\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command, operable program or batch…
IBSiC
  • 1
  • 2
0
votes
0 answers

Setting ANT_HOME and JAVA_HOME on cmd

I have batch scripts , the problem is when I run setup.bat it sets JAVA_HOME , ANT_HOME temporarily then I can run build.bat. If I run build.bat only ant calls gives error. Any idea what is going on here ? Setup.bat @echo off REM -----…
user3498019
  • 95
  • 1
  • 2
  • 10
0
votes
1 answer

JAVA_HOME does not point to the JDK in KonyStudio

I have running a simple app in Konystudio. i got the follwing error [exec-shell] com.sun.tools.javac.Main is not on the classpath. [exec-shell] Perhaps JAVA_HOME does not point to the JDK. [exec-shell] It is currently set to "C:\Program…
Yuvaraja
  • 715
  • 6
  • 22
0
votes
2 answers

sed command to find a string but replace that line with another line.?

I am using chef recipes for setting java_home. For that i am using sed command for finding JAVA_HOME string in bash_profile and then going to replace that line with export JAVA_HOME="a/b/java" so how to replace that line with sed command.
sandip divekar
  • 1,628
  • 5
  • 22
  • 40
0
votes
1 answer

Can't run groovyc from Ant build.xml

I am trying to run groovyc from inside an Ant build.xml file. Here's my project directory structure: myapp/ src/main/java src/main/groovy DemoController lib/main groovy-all-2.2.2.jar …
AdjustingForInflation
  • 1,571
  • 2
  • 26
  • 50