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

changing the default jvm in windows

I installed java 8 and I need java 7. So when I changed JAVA_HOME, CLASSPATH and path I thought the default jvm would automatically change, but it didn't. How can I change it?
Heifa
  • 11
  • 1
  • 1
0
votes
0 answers

JAVA_HOME incorrectly set |JVM terminated exit code 2

While formatting the name node, I'm getting this error: "JAVA_HOME incorrectly set." My JAVA_HOME was C:\Program Files\Java\jdk1.8.0_45. As per some solutions on the net, I copied the Java folder to the C:\ and directly changed env variable to…
spark_dream
  • 326
  • 2
  • 8
  • 23
0
votes
1 answer

Error: JAVA_HOME is set to an invalid directory for installing maven

I have been trying to install Maven on my machine win 7 (64 bit)for the first time.I have a problem setting the path environment System variable . iam getting error JAVA_HOME is set to an invalid directory. i have tried each and every method ehich…
Ravi Varanasi
  • 69
  • 2
  • 3
  • 13
0
votes
1 answer

This java mosquito keeps biting me- NoClassDefFoundError. Spray ! Spray ! Spray ! ..& Nothing happens

I am trying to use a bunch of JAVA apps and I keep hitting this wall. I looked up and followed pretty much everything out there that could cure it. But this is a JAVA super bug mosquito. Pl tell what is happening C:\Users\Administrator>java…
0
votes
1 answer

How to get JBoss 7.1.3 to use my $JAVA_HOME environment varaible?

I'm using Mac 10.9.5 with JBoss 7.1.3.Final. I am launching JBoss through the termianl (bash shell), like so Daves-MacBook-Pro:core davea$ cd $JBOSS_HOME/bin Daves-MacBook-Pro:bin davea$ sudo sh standalone.sh Within the shell, I can see that…
Dave
  • 15,639
  • 133
  • 442
  • 830
0
votes
4 answers

How to reset the system variable: CLASSPATH for JAVA?

I am using Windows 7 and I modified the CLASSPATH and now, in the cmd window, my JAVA cannot work properly: it can compile classes properly, but when I try to run it using:"java CLASS", the system always says "Could not find or load main class" The…
Delibz
  • 99
  • 2
  • 9
0
votes
1 answer

How to run Elasticsearch as a service on Ubuntu 15.04

I'm trying to setup Elasticsearch. Everything's running fine on Ubuntu 14.10 but when I upgrade OS to Ubuntu 15.04, it always failed to start Elasticsearch as a service. (but I can still run it directly by command: sudo…
hgminh
  • 1,178
  • 1
  • 8
  • 26
0
votes
1 answer

How can I reuse environment variables in Windows?

I used to use like this. JAVA_HOME=C:\... Path=...;%JAVA_HOME%\bin And I want to use two separated variables for JAVA_HOME and tried this. JAVA7_HOME=C:\... JAVA8_HOME=C:\... JAVA_HOME=%JAVA8_HOME% Path=...;%JAVA_HOME%\bin And it seems not work.…
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184
0
votes
1 answer

Talend : Set up talend 5.6.1 to use java 1.7 jdk on macosx

Using Talend Big Data Studio. Trying to use neo4jConnection for version 2.x.x, shows error "Component required Java 1.7" I have setup JAVA_HOME path variable in my .bash_profile Also selected Preferences in Talend to point to Java 1.7 JRE. Can…
Paulena
  • 33
  • 5
0
votes
1 answer

Why is my JAVA_HOME variable that I setup not working?

I'm trying to install and use Android Studio. However, when I run the program after installing, it gives me this error: I went into my control panel and added an Environment Variable under System variables that looks like this: I restarted my…
anon
0
votes
1 answer

OSX - setting JAVA_HOME to various versions

My work Mac was upgraded by the company's 'managed software updates' (sigh) that switched it to Java 8. This wreaked havoc with subsequent releases of deployed applications for the clients that are still running Java 7. I use the shell (via 'ant')…
kevdev
  • 177
  • 2
  • 12
0
votes
1 answer

Could not load classfile

I am getting the below runtime exception when I try to run a Java program Exception in thread "main" java.lang.RuntimeException: Could not load classfile: java.util.concurrent.ConcurrentMap at soot.coffi.Util.resolveFromClassFile(Util.java:75) at…
nave
  • 428
  • 5
  • 19
0
votes
2 answers

Android Studio JAVA_HOME variable not working on Windows 8

I just installed Android Studio, and it asked me to set up my JAVA_HOME variable. I set it to "C:\Program Files (x86)\Java\jdk1.8.0_20" my PATH variable is set to "C:\Program Files (x86)\Java\jdk1.8.0_20\bin" and when I type "java -version" in my…
Phil Gibson
  • 96
  • 1
  • 1
  • 11
0
votes
1 answer

Java Screen with Custom JAVA_HOME and LD_LIBRARY_PATH

I have a appilcation that needs Java 32bit on my Debian 64bit server. Is running fine now with this in the .profile or in the SH file. export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_25/ export…
0
votes
1 answer

why need we add $path at the end when we config jdk variables in ubuntu;

When we config JDK environment varibales in Ubuntu. We always do like this: export PATH=${JAVA_HOME}/bin:$PATH why need we add the $PATH??