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

Mismatching JVM versions in deploying web-app between Eclipse and Tomcat

I have a web-app, built and compiled in Eclipse, which I want to deploy to my Tomcat 6 (I want to do it manually) and I get a UnsupportedClassVersionError exception which means the JVM tomcat is running is older than the one my eclipse is running.…
Ittai
  • 5,625
  • 14
  • 60
  • 97
0
votes
2 answers

Why this version of java?

On my Red Hat server, java -version outputs; $ java -version java version "1.6.0_27" Java(TM) SE Runtime Environment (build 1.6.0_27-b07) Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode) $ However, neither PATH, nor JAVA_HOME…
Yiğit
  • 160
  • 1
  • 1
  • 8
0
votes
2 answers

JAVA_HOME error in Titanium Studio on Linux Mint

I will try and keep this as concise as possible since I need to get this figured out quickly. Back when I setup Titanium Studio 2.1.1.201207271312 on Linux Mint 13 64-bit system, I had all kinds of problems installing a version of Java Titanium…
0
votes
1 answer

get java_home value from servers with bash script

I'm confused. I want find JAVA_HOME value in server and type this code in bash script. ssh username@server "echo ${JAVA_HOME}" and try ssh username@server "echo $JAVA_HOME" or ssh username@server 'echo $JAVA_HOME' and all of they not worked; I…
vahid
  • 446
  • 6
  • 21
0
votes
1 answer

setting java_home weird error

I have an ubuntu machine.. In my ~/.bashrc I have set java_home as export JAVA_HOME=/usr/java/jdk1.7.0_04/bin/java export PATH=$JAVA_HOME/bin:$PATH but still when i do $which java I get /usr/bin/java what can be the reason? Any help would be…
frazman
  • 32,081
  • 75
  • 184
  • 269
0
votes
1 answer

How to pass JAVA_HOME to Tomcat via WSO2

I have WSO2 Apps Server running as a Service on Windows 7. JAVA_HOME is set to C:\Program Files\Java\jdk1.7.0_05 I can access the admin screens at https://localhost:9443 and that's all running sweet I've uncommented the line in wrapper.conf…
wild
  • 311
  • 4
  • 11
0
votes
1 answer

set tomcat path

I'm facing a problem in setting the path of tomcat. I used a batch file to set the path, which is cd\ set JAVA_HOME=C:\Sun\SDK\jdk set CATALINA_HOME=c:\Tomcat5.5 set PATH=%CATALINA_HOME%\bin;%JAVA_HOME%\bin;%path% set…
Pranjut
  • 1,747
  • 5
  • 18
  • 31
0
votes
1 answer

Issues with IzPack Install on Ubuntu 12.04

I just installed Ubuntu 12.04 on my computer and am trying to get IzPack working correctly to no avail. I've installed IzPack just fine, but setting the JAVA_HOME environment variable is causing problems. I installed the JDK (I need to compile with…
CODe
  • 2,253
  • 6
  • 36
  • 65
-1
votes
1 answer

Execute "java -jar" from another JAR but using different java versions xD

My project is made using JDK 17. From this JAR I need to exec another JAR (by a cmd command). The problem is that for the second JAR I need JRE < 1.8 I've tried with Runtime.getRuntime().exec(cmd); and with ProcessBuilder but I can't make it work.…
AurysVrV
  • 67
  • 1
  • 10
-1
votes
1 answer

Java_home path cannot be set

I am using linux subsystem with Debian 10. I installed Java 17 and set the Java homepath to jdk 17. The JAVA_HOME Path ist still java-11, but this isnt even installed. echo %JAVA_HOME% set set JAVA_HOME=/usr/lib/jvm/java-17-oracle echo…
-1
votes
2 answers

How to resolve Error: JAVA_HOME is not defined correctly

I have a wso2 identity server and I am trying to restart it on putty, however when I navigate into the bin folder by typing the command cd /usr/lib64/wso2/wso2is/5.11.0/bin and then type sh wso2server.sh to start the server I get the following…
-1
votes
1 answer

java_home issue on macbook 12.3.1 Monterey (M1)

java_home is not setup, Unable to locate a Java Runtime on Mac M1 (12.3.1 - Monterey) openjdk is installed: java --version openjdk 11.0.15 2022-04-19 OpenJDK Runtime Environment Homebrew (build 11.0.15+0) OpenJDK 64-Bit Server VM Homebrew (build…
Mandar Pande
  • 12,250
  • 16
  • 45
  • 72
-1
votes
2 answers

How to set JAVA_HOME to custom path in BATCH

How to set custom JAVA_HOME if JAVA_HOME does not exist yet. if "%JAVA_HOME%" == "" ( echo Setting JAVA_HOME set jdk=%~dp0openjdk-10.5.10 echo %jdk% SETX /M JAVA_HOME "%jdk%" SETX /m PATH "%path%;%jdk%" )
-1
votes
2 answers

How to check if JAVA_HOME is too old?

I want to check if JAVA_HOME is set and if it is older than JAVA 10. How to check it correctly ? I must have this check inside this if statement. This script does not detect JAVA version. set EXPECTED_JAVA_VERSION=10 if not defined "%JAVA_HOME%" ( …
-1
votes
1 answer

java_home is not read by hadoop

I installed java8 with brew install --cask adoptopenjdk/openjdk/adoptopenjdk8 but i think i messed things up, when i type echo $JAVA_HOME it gives /usr/bin/java when i type java -version it gives java version "1.8.0_311" Java(TM) SE Runtime…