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

brownratpig 09-23-2015 03:52 AM

I can quote the whole of the shell script for install here:
#!/bin/bash
EDITION=community
RETVAL=0
NOASK="false"
DEBUG_LOGS="true"
NOLICENSE="false"
NODE=0
DATABASE_SERVER_NAME="localhost"
DATABASE_PORT="7403"
REMOTE_DATA_BASE=local
INSTALL_FOLDER=""
ERROR_OK=0
SILENT_NODE=0
IP=""
REDHAT_VERSION=64
VERSION=7.4
MINOR_VERSION=1
REVO_VERSION=7.4.1
REVO_BIN_STRING=Revo-$VERSION
R_VERSION=R-3.1.2
LINUX_VERSION=5
TOMCAT_VERSION=7.0.34
TOMCAT_SSL_PORT=7401
TOMCAT_PORT=7400
TOMCAT_SHUTDOWN_PORT=7402
RSERVE_PORT=7404
RSERVE_CANCEL_PORT=7405
USER='wnhoami'
GROUP='id -g -n $USER'
IS_ROOT=0
R=1
RBIN="/usr/bin/R"
R_HOME=/usr/lib64/R
LINUX=redhat
DB_PATH=""
##HOST_NAME=`/sbin/ifconfig | grep --max-count=1 -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
##HOST_NAME=`/sbin/ifconfig | grep --max-count=1 -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
HOST_NAME=localhost

checkRoot() {
uid=`id -u`
if [ 0 -eq $uid ] ; then
IS_ROOT=1



A couple things jump out @ me:
This should be installed as root, I know that's bad practice in some senses, but mb "USER="whoami"" and IS_ROOT=0 are problems. The version of R is also wrong.

Also - the fact that it shebangs from /bin/bash...should that be a directory that is either root or related to the Java directory or where my bashrc and profile files are?

brownratpig 09-23-2015 03:55 AM

Quote:

Originally Posted by pan64 (Post 5424371)
bash -xv <script>
will create a log and you can check the program flow or post the result

So where it screws up it returns:
checkPrerequisites
analyzeJava
'[' -z '' ']'
javaMessage ' '
echo

---------- Post added 09-23-15 at 03:56 AM ----------

Quote:

Originally Posted by brownratpig (Post 5424378)
So where it screws up it returns:
checkPrerequisites
analyzeJava
'[' -z '' ']'
javaMessage ' '
echo

Just going to try again with IS_ROOT=1

pan64 09-23-2015 03:57 AM

Usually things are installed as root, there is nothing wrong with that. You need to check the documentation if that software should (or should not) be installed as root.
shebang is ok, it is not related to java at all and the location of the files you mentioned. But it is not the whole script, just the beginning.
I have no idea what is that R

brownratpig 09-23-2015 03:59 AM

Quote:

Originally Posted by brownratpig (Post 5424378)
So where it screws up it returns:
checkPrerequisites
analyzeJava
'[' -z '' ']'
javaMessage ' '
echo

---------- Post added 09-23-15 at 03:56 AM ----------



Just going to try again with IS_ROOT=1

I see now - the whole script that is used for install is spelled out above the license agreement. Looking for Java section now.

brownratpig 09-23-2015 04:14 AM

3 Attachment(s)
There's a lot of stuff here. I'm going to post everything Java related in the install script in .jpeg files...don't sweat a quick response on this one. I appreciate the help.
(edit: I guess it's only 3 jpeg's)
Attachment 19659

Attachment 19660

Attachment 19661

brownratpig 09-23-2015 04:17 AM

Quote:

Originally Posted by pan64 (Post 5424381)
Usually things are installed as root, there is nothing wrong with that. You need to check the documentation if that software should (or should not) be installed as root.
shebang is ok, it is not related to java at all and the location of the files you mentioned. But it is not the whole script, just the beginning.
I have no idea what is that R

R is the functional statistical computing language which is kind of the backbone of the software. DeployR is based on R but does a lot more stuff. So it requires a separate install of R as a prerequisite (mentioned in deployr install link in my first post, and which I think I've done correctly. But there's no way to know because all checks for R in the script come after the Java check that is failed :) lol. So that might be a problem too but one thing at a time. It is 5:17 am where I am so going to sleep now but ty v much for your help and time.

pan64 09-23-2015 04:22 AM

Actually I would prefer the log file (bash -xv <Script>) those pictures do not help.

brownratpig 09-23-2015 04:23 AM

Quote:

Originally Posted by brownratpig (Post 5424388)
There's a lot of stuff here. I'm going to post everything Java related in the install script in .jpeg files...don't sweat a quick response on this one. I appreciate the help.
(edit: I guess it's only 3 jpeg's)
Attachment 19659

Attachment 19660

Attachment 19661

The part that is screwing up is end of pg 2 to middle of pg 3..."Please set JAVA_HOME. See the deployr installation instructions for more details."

brownratpig 09-23-2015 04:25 AM

Quote:

Originally Posted by pan64 (Post 5424393)
Actually I would prefer the log file (bash -xv <Script>) those pictures do not help.

Should I pipe bash -xv (script) somewhere? When I do that command, I get the script spelled out as in the pics above the license agreement.

brownratpig 09-23-2015 04:26 AM

I don't know how to make that command give me a log file, or where that log file would be.

brownratpig 09-23-2015 04:40 AM

AWS support just got back to me - they were able to install it without any trouble and gave me all the input and output they used. So Ill try that, let you know if it works, and be back tmrw.


All times are GMT -5. The time now is 01:46 AM.