Nick Sincaglia
2017-04-19 21:02:03 UTC
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?
/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
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