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.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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.

nsincaglia
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?

When I type:
>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-user@ip-10-142-161-212 ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[ec2-user@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
[ec2-user@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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: 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.

nsincaglia
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

On Apr 19, 2017, at 4:02 PM, Nick Sincaglia <[hidden email]> wrote:

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?

When I type:
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-user@ip-10-142-161-212 ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[ec2-user@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
[ec2-user@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
[hidden email]
http://www.nuemeta.com
Skype: nsincaglia







Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: +1-630-303-7035
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: 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.

Dmitriy Shabanov
Hi Nick,


On Thu, Apr 20, 2017 at 1:53 AM, Nick Sincaglia <[hidden email]> wrote:
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

On Apr 19, 2017, at 4:02 PM, Nick Sincaglia <[hidden email]> wrote:

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?

When I type:
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-user@ip-10-142-161-212 ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[ec2-user@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
[ec2-user@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: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank">+1-630-303-7035
[hidden email]
http://www.nuemeta.com
Skype: nsincaglia







Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank">+1-630-303-7035
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: 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.

nsincaglia
Yep. That did the trick. 

Thanks for the help!

Nick

On Apr 19, 2017, at 6:46 PM, Dmitriy Shabanov <[hidden email]> wrote:

Hi Nick,


On Thu, Apr 20, 2017 at 1:53 AM, Nick Sincaglia <[hidden email]> wrote:
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

On Apr 19, 2017, at 4:02 PM, Nick Sincaglia <[hidden email]> wrote:

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?

When I type:
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-user@ip-10-142-161-212 ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[ec2-user@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
[ec2-user@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: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank" class="">+1-630-303-7035
[hidden email]
http://www.nuemeta.com
Skype: nsincaglia







Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank" class="">+1-630-303-7035
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: 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.

Joe Wicentowski
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.

On Wed, Apr 19, 2017 at 8:26 PM Nick Sincaglia <[hidden email]> wrote:
Yep. That did the trick. 

Thanks for the help!

Nick

On Apr 19, 2017, at 6:46 PM, Dmitriy Shabanov <[hidden email]> wrote:

Hi Nick,


On Thu, Apr 20, 2017 at 1:53 AM, Nick Sincaglia <[hidden email]> wrote:
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

On Apr 19, 2017, at 4:02 PM, Nick Sincaglia <[hidden email]> wrote:

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?

When I type:
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-user@ip-10-142-161-212 ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[ec2-user@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
[ec2-user@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: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank">+1-630-303-7035
[hidden email]
http://www.nuemeta.com
Skype: nsincaglia







Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank">+1-630-303-7035
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
--
Sent from my iPhone

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: 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.

nsincaglia
Hi Joe,

I just tried running ./build.sh without ‘sudo’ and I get:

[ec2-user@ip-10-31-66-185 exist-3.1.1]$ ./build.sh
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

On Apr 19, 2017, at 8:04 PM, Joe Wicentowski <[hidden email]> wrote:

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.

On Wed, Apr 19, 2017 at 8:26 PM Nick Sincaglia <[hidden email]> wrote:
Yep. That did the trick. 

Thanks for the help!

Nick

On Apr 19, 2017, at 6:46 PM, Dmitriy Shabanov <[hidden email]> wrote:

Hi Nick,


On Thu, Apr 20, 2017 at 1:53 AM, Nick Sincaglia <[hidden email]> wrote:
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

On Apr 19, 2017, at 4:02 PM, Nick Sincaglia <[hidden email]> wrote:

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?

When I type:
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-user@ip-10-142-161-212 ~]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[ec2-user@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
[ec2-user@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: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank" class="">+1-630-303-7035
[hidden email]
http://www.nuemeta.com
Skype: nsincaglia







Nick Sincaglia
President/Founder
NueMeta LLC
Digital Media & Technology
Phone: <a href="tel:+1%20630-303-7035" value="+16303037035" target="_blank" class="">+1-630-303-7035
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
[hidden email]
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
[hidden email]
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
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: 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.

Joe Wicentowski
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

On Wed, Apr 19, 2017 at 9:13 PM, Nick Sincaglia <[hidden email]> wrote:

> Hi Joe,
>
> I just tried running ./build.sh without ‘sudo’ and I get:
>
> [ec2-user@ip-10-31-66-185 exist-3.1.1]$ ./build.sh
> 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
>
> On Apr 19, 2017, at 8:04 PM, Joe Wicentowski <[hidden email]> wrote:
>
> 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.
>
> On Wed, Apr 19, 2017 at 8:26 PM Nick Sincaglia <[hidden email]>
> wrote:
>>
>> Yep. That did the trick.
>>
>> Thanks for the help!
>>
>> Nick
>>
>> On Apr 19, 2017, at 6:46 PM, Dmitriy Shabanov <[hidden email]> wrote:
>>
>> Hi Nick,
>>
>> You need this patch https://github.com/eXist-db/exist/pull/1345
>>
>> On Thu, Apr 20, 2017 at 1:53 AM, Nick Sincaglia <[hidden email]>
>> wrote:
>>>
>>> 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
>>>
>>> On Apr 19, 2017, at 4:02 PM, Nick Sincaglia <[hidden email]>
>>> wrote:
>>>
>>> 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?
>>>
>>> When I type:
>>>
>>> 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-user@ip-10-142-161-212 ~]$ echo $JAVA_HOME
>>> /usr/java/jdk1.8.0_65
>>> [ec2-user@ip-10-142-161-212 ~]$ cd /mnt/data/exist-3.1.1/
>>> [ec2-user@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
>>> [hidden email]
>>> http://www.nuemeta.com
>>> Skype: nsincaglia
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Nick Sincaglia
>>> President/Founder
>>> NueMeta LLC
>>> Digital Media & Technology
>>> Phone: +1-630-303-7035
>>> [hidden email]
>>> 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
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open