Discussion:
[Exist-open] eXist-db 3.1.1 BUILD FAILED JAVA_HOME environment variable not set. Please set it and start the build again. If run from commandline just prepend it.
Nick Sincaglia
2017-04-19 21:02:03 UTC
Permalink
I am unable to build eXist-db 3.1.1 from source. The build.sh script says my JAVA_HOME environment variable is not set. I believe I am following the instructions here:
http://exist-db.org/exist/apps/doc/building.xml

Which says "Before starting the build, your JAVA_HOME environment variable should be set to point to the root directory of the JAVA JDK (note: JDK, not JRE!).”

According to the Oracle Java documentation:
http://docs.oracle.com/javase/6/docs/technotes/tools/linux/jdkfiles.html

It says jdk1.8.0_65 is "Root directory of the JDK software installation”.

So, am I correct in setting JAVA_HOME to /usr/java/jdk1.8.0_65?
echo $JAVA_HOME
I get the following:
/usr/java/jdk1.8.0_65

However, the build still fails (see below).

How do I get the build.sh script to see my JAVA_HOME environment variable? What am I doing wrong?

How do I prepend JAVA_HOME if I am running it from command line?

I am running Amazon Linux.

[ec2-***@ip-10-142-161-212 ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[ec2-***@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
[ec2-***@ip-10-142-161-212 exist-3.1.1]$ sudo ./build.sh
WARNING: JAVA_HOME not found in your environment.
Starting Ant...

java
Buildfile: /mnt/data/exist-3.1.1/build.xml

git.details:
[copy] Copying 1 file to /mnt/data/exist-3.1.1

prepare:
[echo] --------------------------------------------
[echo] eXist 3.1.1 build
[echo] --------------------------------------------
[echo] Git commit: fe05cf7
[echo] Git branch: master
[echo]
[echo] Apache Ant(TM) version 1.9.7 compiled on April 9 2016
[echo] ---------------------------------------------
[echo]
[echo] basedir=/mnt/data/exist-3.1.1
[copy] Copying 1 file to /mnt/data/exist-3.1.1/webapp/WEB-INF

compile:
[echo] Compiling with Java 1.8 from 1.8 source to 1.8 target, debug on, optimize on, deprecation off
[javac] Compiling 1 source file to /mnt/data/exist-3.1.1/build/classes

check.aspects.uptodate:

compile-aspectj:

jar:
[copy] Copying 1 file to /mnt/data/exist-3.1.1/build/classes/org/exist
[echo] Creating exist.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist.jar
[echo] Creating start.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/start.jar
[echo] Creating exist-optional.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist-optional.jar

wrapper:

create-conf:
[echo] Creating wrapper config files for installer and direct local repo use...

BUILD FAILED
/mnt/data/exist-3.1.1/build/scripts/build-impl.xml:735: The following error occurred while executing this line:
/mnt/data/exist-3.1.1/tools/yajsw/build.xml:42: JAVA_HOME environment variable not set. Please set it and start the build again. If run from commandline just prepend it.

Total time: 5 seconds


Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035
***@nuemeta.com
http://www.nuemeta.com
Skype: nsincaglia
Nick Sincaglia
2017-04-19 22:53:14 UTC
Permalink
Another piece of information I would like to add is, I have eXist-db 3.0 RC1 source code in another folder and I am able to build that source code even though I am getting the JAVA_HOME warning.

Is the new build.sh script more strict about the JAVA_HOME environment variable or is it something else that could be causing this issue.

Nick
Post by Nick Sincaglia
http://exist-db.org/exist/apps/doc/building.xml
Which says "Before starting the build, your JAVA_HOME environment variable should be set to point to the root directory of the JAVA JDK (note: JDK, not JRE!).”
http://docs.oracle.com/javase/6/docs/technotes/tools/linux/jdkfiles.html
It says jdk1.8.0_65 is "Root directory of the JDK software installation”.
So, am I correct in setting JAVA_HOME to /usr/java/jdk1.8.0_65?
echo $JAVA_HOME
/usr/java/jdk1.8.0_65
However, the build still fails (see below).
How do I get the build.sh script to see my JAVA_HOME environment variable? What am I doing wrong?
How do I prepend JAVA_HOME if I am running it from command line?
I am running Amazon Linux.
/usr/java/jdk1.8.0_65
WARNING: JAVA_HOME not found in your environment.
Starting Ant...
java
Buildfile: /mnt/data/exist-3.1.1/build.xml
[copy] Copying 1 file to /mnt/data/exist-3.1.1
[echo] --------------------------------------------
[echo] eXist 3.1.1 build
[echo] --------------------------------------------
[echo] Git commit: fe05cf7
[echo] Git branch: master
[echo]
[echo] Apache Ant(TM) version 1.9.7 compiled on April 9 2016
[echo] ---------------------------------------------
[echo]
[echo] basedir=/mnt/data/exist-3.1.1
[copy] Copying 1 file to /mnt/data/exist-3.1.1/webapp/WEB-INF
[echo] Compiling with Java 1.8 from 1.8 source to 1.8 target, debug on, optimize on, deprecation off
[javac] Compiling 1 source file to /mnt/data/exist-3.1.1/build/classes
[copy] Copying 1 file to /mnt/data/exist-3.1.1/build/classes/org/exist
[echo] Creating exist.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist.jar
[echo] Creating start.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/start.jar
[echo] Creating exist-optional.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist-optional.jar
[echo] Creating wrapper config files for installer and direct local repo use...
BUILD FAILED
/mnt/data/exist-3.1.1/tools/yajsw/build.xml:42: JAVA_HOME environment variable not set. Please set it and start the build again. If run from commandline just prepend it.
Total time: 5 seconds
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035
http://www.nuemeta.com
Skype: nsincaglia
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035
***@nuemeta.com
http://www.nuemeta.com
Skype: nsincaglia
Dmitriy Shabanov
2017-04-19 23:46:46 UTC
Permalink
Hi Nick,

You need this patch https://github.com/eXist-db/exist/pull/1345
Post by Nick Sincaglia
Another piece of information I would like to add is, I have eXist-db 3.0
RC1 source code in another folder and I am able to build that source code
even though I am getting the JAVA_HOME warning.
Is the new build.sh script more strict about the JAVA_HOME environment
variable or is it something else that could be causing this issue.
Nick
I am unable to build eXist-db 3.1.1 from source. The build.sh script says
my JAVA_HOME environment variable is not set. I believe I am following the
http://exist-db.org/exist/apps/doc/building.xml
Which says "Before starting the build, your JAVA_HOME environment variable
should be set to point to the root directory of the JAVA JDK (note: JDK,
not JRE!).”
http://docs.oracle.com/javase/6/docs/technotes/tools/linux/jdkfiles.html
It says jdk1.8.0_65 is "Root directory of the JDK software installation”.
So, am I correct in setting JAVA_HOME to /usr/java/jdk1.8.0_65?
echo $JAVA_HOME
/usr/java/jdk1.8.0_65
However, the build still fails (see below).
How do I get the build.sh script to see my JAVA_HOME environment variable?
What am I doing wrong?
How do I prepend JAVA_HOME if I am running it from command line?
I am running Amazon Linux.
/usr/java/jdk1.8.0_65
WARNING: JAVA_HOME not found in your environment.
Starting Ant...
java
Buildfile: /mnt/data/exist-3.1.1/build.xml
[copy] Copying 1 file to /mnt/data/exist-3.1.1
[echo] --------------------------------------------
[echo] eXist 3.1.1 build
[echo] --------------------------------------------
[echo] Git commit: fe05cf7
[echo] Git branch: master
[echo]
[echo] Apache Ant(TM) version 1.9.7 compiled on April 9 2016
[echo] ---------------------------------------------
[echo]
[echo] basedir=/mnt/data/exist-3.1.1
[copy] Copying 1 file to /mnt/data/exist-3.1.1/webapp/WEB-INF
[echo] Compiling with Java 1.8 from 1.8 source to 1.8 target, debug
on, optimize on, deprecation off
[javac] Compiling 1 source file to /mnt/data/exist-3.1.1/build/classes
[copy] Copying 1 file to /mnt/data/exist-3.1.1/build/classes/org/exist
[echo] Creating exist.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist.jar
[echo] Creating start.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/start.jar
[echo] Creating exist-optional.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist-optional.jar
[echo] Creating wrapper config files for installer and direct local repo use...
BUILD FAILED
/mnt/data/exist-3.1.1/build/scripts/build-impl.xml:735: The following
/mnt/data/exist-3.1.1/tools/yajsw/build.xml:42: JAVA_HOME environment
variable not set. Please set it and start the build again. If run from
commandline just prepend it.
Total time: 5 seconds
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035 <+1%20630-303-7035>
http://www.nuemeta.com
Skype: nsincaglia
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035 <+1%20630-303-7035>
http://www.nuemeta.com
Skype: nsincaglia
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
--
Dmitriy Shabanov
Nick Sincaglia
2017-04-20 00:24:15 UTC
Permalink
Yep. That did the trick.

Thanks for the help!

Nick
Post by Dmitriy Shabanov
Hi Nick,
You need this patch https://github.com/eXist-db/exist/pull/1345 <https://github.com/eXist-db/exist/pull/1345>
Another piece of information I would like to add is, I have eXist-db 3.0 RC1 source code in another folder and I am able to build that source code even though I am getting the JAVA_HOME warning.
Is the new build.sh script more strict about the JAVA_HOME environment variable or is it something else that could be causing this issue.
Nick
http://exist-db.org/exist/apps/doc/building.xml <http://exist-db.org/exist/apps/doc/building.xml>
Which says "Before starting the build, your JAVA_HOME environment variable should be set to point to the root directory of the JAVA JDK (note: JDK, not JRE!).”
http://docs.oracle.com/javase/6/docs/technotes/tools/linux/jdkfiles.html <http://docs.oracle.com/javase/6/docs/technotes/tools/linux/jdkfiles.html>
It says jdk1.8.0_65 is "Root directory of the JDK software installation”.
So, am I correct in setting JAVA_HOME to /usr/java/jdk1.8.0_65?
echo $JAVA_HOME
/usr/java/jdk1.8.0_65
However, the build still fails (see below).
How do I get the build.sh script to see my JAVA_HOME environment variable? What am I doing wrong?
How do I prepend JAVA_HOME if I am running it from command line?
I am running Amazon Linux.
/usr/java/jdk1.8.0_65
WARNING: JAVA_HOME not found in your environment.
Starting Ant...
java
Buildfile: /mnt/data/exist-3.1.1/build.xml
[copy] Copying 1 file to /mnt/data/exist-3.1.1
[echo] --------------------------------------------
[echo] eXist 3.1.1 build
[echo] --------------------------------------------
[echo] Git commit: fe05cf7
[echo] Git branch: master
[echo]
[echo] Apache Ant(TM) version 1.9.7 compiled on April 9 2016
[echo] ---------------------------------------------
[echo]
[echo] basedir=/mnt/data/exist-3.1.1
[copy] Copying 1 file to /mnt/data/exist-3.1.1/webapp/WEB-INF
[echo] Compiling with Java 1.8 from 1.8 source to 1.8 target, debug on, optimize on, deprecation off
[javac] Compiling 1 source file to /mnt/data/exist-3.1.1/build/classes
[copy] Copying 1 file to /mnt/data/exist-3.1.1/build/classes/org/exist
[echo] Creating exist.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist.jar
[echo] Creating start.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/start.jar
[echo] Creating exist-optional.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist-optional.jar
[echo] Creating wrapper config files for installer and direct local repo use...
BUILD FAILED
/mnt/data/exist-3.1.1/tools/yajsw/build.xml:42: JAVA_HOME environment variable not set. Please set it and start the build again. If run from commandline just prepend it.
Total time: 5 seconds
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035 <tel:+1%20630-303-7035>
http://www.nuemeta.com <http://www.nuemeta.com/>
Skype: nsincaglia
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035 <tel:+1%20630-303-7035>
http://www.nuemeta.com <http://www.nuemeta.com/>
Skype: nsincaglia
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot <http://sdm.link/slashdot>
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open <https://lists.sourceforge.net/lists/listinfo/exist-open>
--
Dmitriy Shabanov
Joe Wicentowski
2017-04-20 01:04:12 UTC
Permalink
Also, I notice you used `sudo` to build eXist. This is unnecessary and
explains why you had the problem with the JAVA_HOME environment variable;
user account environment variables aren't passed to sudo processes, unless
you go through some rather onerous contortions to allow them through.
Post by Nick Sincaglia
Yep. That did the trick.
Thanks for the help!
Nick
Hi Nick,
You need this patch https://github.com/eXist-db/exist/pull/1345
Post by Nick Sincaglia
Another piece of information I would like to add is, I have eXist-db 3.0
RC1 source code in another folder and I am able to build that source code
even though I am getting the JAVA_HOME warning.
Is the new build.sh script more strict about the JAVA_HOME environment
variable or is it something else that could be causing this issue.
Nick
I am unable to build eXist-db 3.1.1 from source. The build.sh script says
my JAVA_HOME environment variable is not set. I believe I am following the
http://exist-db.org/exist/apps/doc/building.xml
Which says "Before starting the build, your JAVA_HOME environment
variable should be set to point to the root directory of the JAVA JDK
(note: JDK, not JRE!).”
http://docs.oracle.com/javase/6/docs/technotes/tools/linux/jdkfiles.html
It says jdk1.8.0_65 is "Root directory of the JDK software installation”.
So, am I correct in setting JAVA_HOME to /usr/java/jdk1.8.0_65?
echo $JAVA_HOME
/usr/java/jdk1.8.0_65
However, the build still fails (see below).
How do I get the build.sh script to see my JAVA_HOME environment
variable? What am I doing wrong?
How do I prepend JAVA_HOME if I am running it from command line?
I am running Amazon Linux.
/usr/java/jdk1.8.0_65
WARNING: JAVA_HOME not found in your environment.
Starting Ant...
java
Buildfile: /mnt/data/exist-3.1.1/build.xml
[copy] Copying 1 file to /mnt/data/exist-3.1.1
[echo] --------------------------------------------
[echo] eXist 3.1.1 build
[echo] --------------------------------------------
[echo] Git commit: fe05cf7
[echo] Git branch: master
[echo]
[echo] Apache Ant(TM) version 1.9.7 compiled on April 9 2016
[echo] ---------------------------------------------
[echo]
[echo] basedir=/mnt/data/exist-3.1.1
[copy] Copying 1 file to /mnt/data/exist-3.1.1/webapp/WEB-INF
[echo] Compiling with Java 1.8 from 1.8 source to 1.8 target, debug
on, optimize on, deprecation off
[javac] Compiling 1 source file to /mnt/data/exist-3.1.1/build/classes
[copy] Copying 1 file to /mnt/data/exist-3.1.1/build/classes/org/exist
[echo] Creating exist.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist.jar
[echo] Creating start.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/start.jar
[echo] Creating exist-optional.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist-optional.jar
[echo] Creating wrapper config files for installer and direct local repo use...
BUILD FAILED
/mnt/data/exist-3.1.1/build/scripts/build-impl.xml:735: The following
/mnt/data/exist-3.1.1/tools/yajsw/build.xml:42: JAVA_HOME environment
variable not set. Please set it and start the build again. If run from
commandline just prepend it.
Total time: 5 seconds
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035 <+1%20630-303-7035>
http://www.nuemeta.com
Skype: nsincaglia
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035 <+1%20630-303-7035>
http://www.nuemeta.com
Skype: nsincaglia
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
--
Dmitriy Shabanov
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
--
Sent from my iPhone
Joe Wicentowski
2017-04-20 02:06:50 UTC
Permalink
Hi Nick,

Ah, well, if it works with sudo (after Dmitriy's suggestion) but not
without sudo, then by all means, stick with the successful route via
sudo!

It's been a while since I set up a machine on EC2, and I can't seem to
find documentation for how we are doing it now. We're also using
Amazon Linux, but there are a number of ways to install the Java JDK,
and without knowing your method and what our current method is, I
can't give you any good advice. Maybe others here can. But then
again, if you're up and running using `sudo build.sh`, then you're
really all set.

Joe
Hi Joe,
Starting Ant...
/usr/lib/jvm/jre/bin/java
Error: Could not find or load main class
org.apache.tools.ant.launch.Launcher
But when I type 'sudo ./build.sh’ it successfully builds now that I have
applied the patch that Dmitriy suggested.
I ssh into my AWS EC2 instance as ec2-user. Is there a way of running the
build.sh command that will work better?
Nick
Also, I notice you used `sudo` to build eXist. This is unnecessary and
explains why you had the problem with the JAVA_HOME environment variable;
user account environment variables aren't passed to sudo processes, unless
you go through some rather onerous contortions to allow them through.
Post by Nick Sincaglia
Yep. That did the trick.
Thanks for the help!
Nick
Hi Nick,
You need this patch https://github.com/eXist-db/exist/pull/1345
Post by Nick Sincaglia
Another piece of information I would like to add is, I have eXist-db 3.0
RC1 source code in another folder and I am able to build that source code
even though I am getting the JAVA_HOME warning.
Is the new build.sh script more strict about the JAVA_HOME environment
variable or is it something else that could be causing this issue.
Nick
I am unable to build eXist-db 3.1.1 from source. The build.sh script says
my JAVA_HOME environment variable is not set. I believe I am following the
http://exist-db.org/exist/apps/doc/building.xml
Which says "Before starting the build, your JAVA_HOME environment
JDK, not JRE!).”
http://docs.oracle.com/javase/6/docs/technotes/tools/linux/jdkfiles.html
It says jdk1.8.0_65 is "Root directory of the JDK software installation”.
So, am I correct in setting JAVA_HOME to /usr/java/jdk1.8.0_65?
echo $JAVA_HOME
/usr/java/jdk1.8.0_65
However, the build still fails (see below).
How do I get the build.sh script to see my JAVA_HOME environment
variable? What am I doing wrong?
How do I prepend JAVA_HOME if I am running it from command line?
I am running Amazon Linux.
/usr/java/jdk1.8.0_65
WARNING: JAVA_HOME not found in your environment.
Starting Ant...
java
Buildfile: /mnt/data/exist-3.1.1/build.xml
[copy] Copying 1 file to /mnt/data/exist-3.1.1
[echo] --------------------------------------------
[echo] eXist 3.1.1 build
[echo] --------------------------------------------
[echo] Git commit: fe05cf7
[echo] Git branch: master
[echo]
[echo] Apache Ant(TM) version 1.9.7 compiled on April 9 2016
[echo] ---------------------------------------------
[echo]
[echo] basedir=/mnt/data/exist-3.1.1
[copy] Copying 1 file to /mnt/data/exist-3.1.1/webapp/WEB-INF
[echo] Compiling with Java 1.8 from 1.8 source to 1.8 target, debug
on, optimize on, deprecation off
[javac] Compiling 1 source file to /mnt/data/exist-3.1.1/build/classes
[copy] Copying 1 file to
/mnt/data/exist-3.1.1/build/classes/org/exist
[echo] Creating exist.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist.jar
[echo] Creating start.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/start.jar
[echo] Creating exist-optional.jar ...
[jar] Building jar: /mnt/data/exist-3.1.1/exist-optional.jar
[echo] Creating wrapper config files for installer and direct local repo use...
BUILD FAILED
/mnt/data/exist-3.1.1/build/scripts/build-impl.xml:735: The following
/mnt/data/exist-3.1.1/tools/yajsw/build.xml:42: JAVA_HOME environment
variable not set. Please set it and start the build again. If run from
commandline just prepend it.
Total time: 5 seconds
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035
http://www.nuemeta.com
Skype: nsincaglia
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035
http://www.nuemeta.com
Skype: nsincaglia
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
--
Dmitriy Shabanov
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
--
Sent from my iPhone
Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035
http://www.nuemeta.com
Skype: nsincaglia
Loading...