LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "Please set JAVA_HOME" (but I'm sure I did) (https://www.linuxquestions.org/questions/linux-newbie-8/please-set-java_home-but-im-sure-i-did-4175554217/)

brownratpig 09-22-2015 03:42 PM

"Please set JAVA_HOME" (but I'm sure I did)
 
Installing Deployr on RHEL 7:
http://deployr.revolutionanalytics.c...admin/install/
Installed Java from Josee's link @ bottom: https://groups.google.com/forum/#!se...g/_jzuuKXuDAAJ, jre1.8.0_60
set JAVA_HOME to export JAVA_HOME=/usr/java/jre1.8.0_60
$JAVA_HOME/bin/java -version returns output of:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
added @ end of /etc/profile:
export JAVA_HOME=/usr/java/jre1.8.0_60
export PATH="$JAVA_HOME/bin:$PATH"
source /etc/profile
hard reboot OS
Still get "Please set JAVA_HOME" on start of Deployr install.
????? AWS and MSFT support recommend exactly what I did...

Thanks for any advice.

theAdmiral 09-22-2015 08:53 PM

Is this an initial Java installation? Have you tried running, say, a Java "Hello, World!" program from the command line, for example with you in your /home/ directory? Although I doubt it, you could be dealing with a bug. But, this test may help you rule something out---whether you are sure that you are sure that the environment variable is set.

brownratpig 09-22-2015 09:32 PM

Yes an initial install. And I only did JRE, not JDK or server JRE, as recommended by MSFT for this install. How do I run that Hello World program...sounds like a great idea?

Thanks for the reply!

brownratpig 09-23-2015 01:55 AM

It occurred to me: the deployr install docs say only to download jre, and not the jdk. Does that make any sense? Don't I have to have JDK too? And JAVA_HOME pertains to JDK, and JRE_HOME pertains to JRE? Can I install JDK after JRE without screwing anything up? Or do I install them both at once and delete the old one first?

pan64 09-23-2015 02:31 AM

JRE stands java runtime environment, is used to run java programs. JDK stands for java development environment and is used to create java programs. Obviously JKD contains JRE too.
You can install JDK next to JRE, that should not be a problem. If you have not installed JDK, you cannot set JAVA_HOME to JDK (that simply make no sense), instead, you need yo set it to JRE (or install JDK too).

brownratpig 09-23-2015 02:54 AM

Yes - unfortunately, I had JAVA_HOME to jre (when there was no jdk). Installed JDK and set it instead to jdk, still didn't work. Very annoying, $JAVA_HOME/bin/java -version returns output of:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

But I still get "Please set JAVA_HOME" error on trying to install my software.

pan64 09-23-2015 03:04 AM

in that case please describe exactly what have you entered.

brownratpig 09-23-2015 03:11 AM

Quote:

Originally Posted by pan64 (Post 5424352)
in that case please describe exactly what have you entered.

It's in my first post, except now it's jdk where it was once jre.
Otherwise identical, didn't work before or after change to jdk.

brownratpig 09-23-2015 03:12 AM

Quote:

Originally Posted by brownratpig (Post 5424126)
Installing Deployr on RHEL 7:
http://deployr.revolutionanalytics.c...admin/install/
Installed Java from Josee's link @ bottom: https://groups.google.com/forum/#!se...g/_jzuuKXuDAAJ, jre1.8.0_60
set JAVA_HOME to export JAVA_HOME=/usr/java/jre1.8.0_60
$JAVA_HOME/bin/java -version returns output of:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
added @ end of /etc/profile:
export JAVA_HOME=/usr/java/jre1.8.0_60
export PATH="$JAVA_HOME/bin:$PATH"
source /etc/profile
hard reboot OS
Still get "Please set JAVA_HOME" on start of Deployr install.
????? AWS and MSFT support recommend exactly what I did...

Thanks for any advice.



Maybe need to put $PATH @ start of PATH? (instead of at end)
I went ahead and tried to add export JAVA_HOME=/usr/java/jdk1.8.0_60 and export PATH to bashrc as well...no difference.

pan64 09-23-2015 03:23 AM

probably it needs JDK, JRE is not enough. In that case you need to set JAVA_HOME to JDK, and check $JAVA_HOME/bin/javac

brownratpig 09-23-2015 03:28 AM

Quote:

Originally Posted by pan64 (Post 5424359)
probably it needs JDK, JRE is not enough. In that case you need to set JAVA_HOME to JDK, and check $JAVA_HOME/bin/javac

$JAVA_HOME/bin/javac returns a guide for usage on javac

As for setting JAVA_HOME = jdk path, I mentioned above twice that I have already tried this.

brownratpig 09-23-2015 03:31 AM

Quote:

Originally Posted by brownratpig (Post 5424362)
$JAVA_HOME/bin/javac returns a guide for usage on javac

As for setting JAVA_HOME = jdk path, I mentioned above twice that I have already tried this.

If you mean $JAVA_HOME/bin/java -version, I have shown the output multiple times above, it shows as though it is set correctly.
The issue lies elsewhere.

pan64 09-23-2015 03:33 AM

you need to read the documentation of Deployr, probably incorrect version or ??? - or - if the installer was a readable shell script you can check what's happened

brownratpig 09-23-2015 03:39 AM

Quote:

Originally Posted by pan64 (Post 5424365)
you need to read the documentation of Deployr, probably incorrect version or ??? - or - if the installer was a readable shell script you can check what's happened

Deployr support told me to set it the way I have thus far, then threw up their hands and effectively said, "we don't know." However, the installer is a readable shell script. But won't I be seeing the script before it runs, rather than the error broken down after the fact?

pan64 09-23-2015 03:45 AM

bash -xv <script>
will create a log and you can check the program flow or post the result


All times are GMT -5. The time now is 05:15 AM.