The JAVA_HOME environment variable is not defined This environment variable is needed to run this program

884 views
Skip to first unread message

Erik Manwaring

unread,
Apr 17, 2012, 3:42:56 PM4/17/12
to xnat_di...@googlegroups.com
Hello all,

I am setting up 1.5 on a RedHat server and followed the instructions
up to Step 5 before running into problems.

Here is a copy of my build.properties with password(s) xxxx'd out:
-------------------------------------------------------------------------------------------------


#WINDOWS USERS: The '\' character is not supported by Maven. Do not
use the '\' character in your file paths. Replace any '\' characters
with the '/'. The '/' works as a file path separator on UNIX and
WINDOWS.

maven.appserver.home=/var/lib/tomcat6

xdat.project.name=xnat
xdat.project.template=xnat
xdat.project.db.name=xnat
xdat.project.db.driver=org.postgresql.Driver
xdat.project.db.connection.string=jdbc:postgresql://localhost/xnat
xdat.project.db.user=xnat
xdat.project.db.password=XXXXXXXXXX

#IMAGE FILE LOCATION (FOR USE WITH THE xnat TEMPLATE)
#Location where image data will be stored.
xdat.archive.location=/home/xnat/xnat_data/archive

#Location where image data may be stored temporarily before it is
stored into the archive.
xdat.prearchive.location=/home/xnat/xnat_data/prearchive

#Location where cached image data should be stored
xdat.cache.location=/home/xnat/xnat_data/cache

xdat.smtp.server=smtp.temple.edu

xdat.admin_email=erik.ma...@gmail.com
xdat.url=http://localhost:8080/xnat

# 'xdat.require_login' must be set to 'true' or 'false'. It governs
whether or not users will be
# prompted to login when visiting the site. If true, users will be
required to login. If false,
# users will be automatically logged in using an XNAT guest account.
xdat.require_login=true


# 'xdat.enable_new_registrations' must be set to 'true' or 'false'.
Users are provided with a
# link on the Login.vm page to register for a new account. If this
variable is true, that newly
# registered account will be automatically enabled and the user will
be allowed to immediately login.
# If this is false, then an email will be sent to the admin
(xdat.admin_email) requesting that the
# account be enabled, and the user will be unable to login until the
account is enabled.
xdat.enable_new_registrations=false


============================================================================


I received the following output when running setup.sh
-------------------------------------------------------------------------------------------------


Using XDAT Installation: /usr/local/src/xnat
Using JAVA_HOME: /usr/java/jdk1.7.0_03

Verify Java Version (with java -version) java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.6)
(rhel-1.43.1.10.6.el6_2-x86_64) OpenJDK 64-Bit Server VM (build
20.0-b11, mixed mode)

chmod: changing permissions of
`/usr/local/src/xnat/plugin-resources/maven-1.0.2/bin/maven':
Operation not permitted Executing
/usr/local/src/xnat/plugin-resources/maven-1.0.2/bin/maven xdat:setup
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2

Plugin cache will be regenerated
org.apache.maven.MavenException: Unable to extract plugin:
/usr/local/src/xnat/plugin-resources/maven-1.0.2/plugins/maven-linkcheck-plugin-1.3.4.jar
at org.apache.maven.plugin.PluginManager.unpackPlugin(PluginManager.java:1075)
at org.apache.maven.plugin.PluginManager.expandPluginFiles(PluginManager.java:321)
at org.apache.maven.plugin.PluginManager.initialize(PluginManager.java:288)
at org.apache.maven.MavenSession.initializePluginManager(MavenSession.java:204)
at org.apache.maven.MavenSession.initialize(MavenSession.java:171)
at org.apache.maven.cli.App.doMain(App.java:475)
at org.apache.maven.cli.App.main(App.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
--- Nested Exception ---
java.io.FileNotFoundException:
/usr/local/src/xnat/plugin-resources/cache/maven-linkcheck-plugin-1.3.4/META-INF/MANIFEST.MF
(No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at org.apache.maven.util.Expand.extractFile(Expand.java:147)
at org.apache.maven.util.Expand.expandFile(Expand.java:85)
at org.apache.maven.util.Expand.execute(Expand.java:67)
at org.apache.maven.plugin.PluginManager.unpackPlugin(PluginManager.java:1071)
at org.apache.maven.plugin.PluginManager.expandPluginFiles(PluginManager.java:321)
at org.apache.maven.plugin.PluginManager.initialize(PluginManager.java:288)
at org.apache.maven.MavenSession.initializePluginManager(MavenSession.java:204)
at org.apache.maven.MavenSession.initialize(MavenSession.java:171)
at org.apache.maven.cli.App.doMain(App.java:475)
at org.apache.maven.cli.App.main(App.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)

You have encountered an unknown error running Maven. Please help us to
correct this problem by following these simple steps:
- read the Maven FAQ at http://maven.apache.org/faq.html
- run the same command again with the '-e' parameter, eg maven -e jar
- search the maven-user archives for the error at
http://nagoya.apache.org/eyebrowse/SummarizeList?listName=us...@maven.apache.org
- post the output of maven -e to JIRA at
http://jira.codehaus.org/BrowseProject.jspa?id=10030 (you must sign up first)
- run 'maven --info' and post the output as the environment to the bug above


Total time: 0 seconds
Finished at: Tue Apr 17 15:24:51 EDT 2012


============================================================================


Has anyone seen this type of error before? I looked through previous
posts to the group but couldn't find anything that resembles it.


Thank you for any help you can provide,

Erik

Herrick, Rick

unread,
Apr 17, 2012, 4:06:52 PM4/17/12
to xnat_di...@googlegroups.com
Erik,

A couple of things:

* Your subject mentions a JAVA_HOME error, but I don't see anything in the actual error message about JAVA_HOME. Is that a typo or is there some information that I'm missing?
* I just checked the jar file in question and was able to properly pull the MANIFEST.MF file. Can you give this a try (from your xnat_builder folder):

jar tf plugin-resources/maven-1.0.2/plugins/maven-linkcheck-plugin-1.3.4.jar

That should produce output like this:

META-INF/
META-INF/MANIFEST.MF
org/
org/apache/
org/apache/maven/
org/apache/maven/linkcheck/
org/apache/maven/linkcheck/validation/
plugin-resources/
META-INF/NOTICE.txt
org/apache/maven/linkcheck/FileToCheck.class
org/apache/maven/linkcheck/LinkCheck$1.class
org/apache/maven/linkcheck/LinkCheck.class
org/apache/maven/linkcheck/LinkCheckCli.class
org/apache/maven/linkcheck/LinkCheckResult.class
org/apache/maven/linkcheck/validation/FileLinkValidator.class
org/apache/maven/linkcheck/validation/HTTPLinkValidator.class
org/apache/maven/linkcheck/validation/LinkValidationItem.class
org/apache/maven/linkcheck/validation/LinkValidationResult.class
org/apache/maven/linkcheck/validation/LinkValidator.class
org/apache/maven/linkcheck/validation/LinkValidatorCache.class
org/apache/maven/linkcheck/validation/LinkValidatorManager.class
org/apache/maven/linkcheck/validation/MailtoLinkValidator.class
plugin-resources/linkcheck-temp.xml
plugin-resources/linkcheck.jsl
plugin.jelly
plugin.properties
project.properties
project.xml
META-INF/LICENSE.txt

You should also be able to do this:

jar xf plugin-resources/maven-1.0.2/plugins/maven-linkcheck-plugin-1.3.4.jar META-INF/MANIFEST.MF
cat META-INF/MANIFEST.MF

Which would give you:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3
Created-By: Apache Maven
Built-By: carlos
Package: org.apache.maven
Build-Jdk: 1.4.2_04
Extension-Name: maven-linkcheck-plugin
Specification-Title: Check xdoc links
Specification-Vendor: Apache Software Foundation
Implementation-Title: org.apache.maven
Implementation-Vendor: Apache Software Foundation
Implementation-Version: 1.3.4

Let me know if that works for you. If not, you may try checking the permissions on that jar and/or its containing folders. Also, it's conceivable that something got corrupted or messed up during transfer or extraction.

If this does work... well, let me know if that does work. I'm not sure what would be going on in that case.

Hello all,

maven.appserver.home=/var/lib/tomcat6

xdat.smtp.server=smtp.temple.edu

xdat.admin_email=erik.ma...@gmail.com
xdat.url=http://localhost:8080/xnat


============================================================================


============================================================================

Erik

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To post to this group, send email to xnat_di...@googlegroups.com.
To unsubscribe from this group, send email to xnat_discussi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xnat_discussion?hl=en.


________________________________

The material in this message is private and may contain Protected Healthcare Information (PHI). If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Erik Manwaring

unread,
Apr 17, 2012, 4:32:08 PM4/17/12
to xnat_di...@googlegroups.com
Yes Rick - I put the wrong subject in there - sorry about that!

Here's the output I am seeing from the commands you sent:

[erik@hawk xnat]$ jar tf
plugin-resources/maven-1.0.2/plugins/maven-linkcheck-plugin-1.3.4.jar

---------------------------------------

[erik@hawk xnat]$ jar xf
plugin-resources/maven-1.0.2/plugins/maven-linkcheck-plugin-1.3.4.jar
META-INF/MANIFEST.MF cat META-INF/MANIFEST.MF
java.io.IOException: META-INF : could not create directory
at sun.tools.jar.Main.extractFile(Main.java:946)
at sun.tools.jar.Main.extract(Main.java:905)
at sun.tools.jar.Main.run(Main.java:254)
at sun.tools.jar.Main.main(Main.java:1167)


Looks like the second is different from your output.

Herrick, Rick

unread,
Apr 17, 2012, 4:34:23 PM4/17/12
to xnat_di...@googlegroups.com
It looks like you probably have some permissions issues trying to write into your xnat_builder folder. Try something like this in your xnat_builder folder:

chmod -R u+w *

This will go through your entire builder installation and make everything writable.

---------------------------------------

> orImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:601)
>        at com.werken.forehead.Forehead.run(Forehead.java:551)
>        at com.werken.forehead.Forehead.main(Forehead.java:581)
>
> You have encountered an unknown error running Maven. Please help us to correct this problem by following these simple steps:
> - read the Maven FAQ at http://maven.apache.org/faq.html
> - run the same command again with the '-e' parameter, eg maven -e jar
> - search the maven-user archives for the error at

> http://nagoya.apache.org/eyebrowse/SummarizeList?listName=users@maven.

Erik Manwaring

unread,
Apr 17, 2012, 4:40:55 PM4/17/12
to xnat_di...@googlegroups.com
Rick,

Changed the permissions as you requested - reran setup.sh

Using XDAT Installation: /usr/local/src/xnat
Using JAVA_HOME: /usr/java/jdk1.7.0_03

Verify Java Version (with java -version)
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.6) (rhel-1.43.1.10.6.el6_2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

chmod: changing permissions of
`/usr/local/src/xnat/plugin-resources/maven-1.0.2/bin/maven':
Operation not permitted
Executing /usr/local/src/xnat/plugin-resources/maven-1.0.2/bin/maven xdat:setup
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2

Plugin cache will be regenerated
org.apache.maven.MavenException: Unable to extract plugin:

/usr/local/src/xnat/plugin-resources/maven-1.0.2/plugins/maven-linkcheck-plugin-1.3.4.jar
at org.apache.maven.plugin.PluginManager.unpackPlugin(PluginManager.java:1075)
at org.apache.maven.plugin.PluginManager.expandPluginFiles(PluginManager.java:321)
at org.apache.maven.plugin.PluginManager.initialize(PluginManager.java:288)

at org.apache.maven.MavenSession.initializePluginManager(MavenSession.java:204)


at org.apache.maven.MavenSession.initialize(MavenSession.java:171)
at org.apache.maven.cli.App.doMain(App.java:475)
at org.apache.maven.cli.App.main(App.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


at java.lang.reflect.Method.invoke(Method.java:601)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
--- Nested Exception ---
java.io.FileNotFoundException:
/usr/local/src/xnat/plugin-resources/cache/maven-linkcheck-plugin-1.3.4/META-INF/MANIFEST.MF
(No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at org.apache.maven.util.Expand.extractFile(Expand.java:147)
at org.apache.maven.util.Expand.expandFile(Expand.java:85)
at org.apache.maven.util.Expand.execute(Expand.java:67)
at org.apache.maven.plugin.PluginManager.unpackPlugin(PluginManager.java:1071)

at org.apache.maven.plugin.PluginManager.expandPluginFiles(PluginManager.java:321)
at org.apache.maven.plugin.PluginManager.initialize(PluginManager.java:288)

at org.apache.maven.MavenSession.initializePluginManager(MavenSession.java:204)


at org.apache.maven.MavenSession.initialize(MavenSession.java:171)
at org.apache.maven.cli.App.doMain(App.java:475)
at org.apache.maven.cli.App.main(App.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


at java.lang.reflect.Method.invoke(Method.java:601)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)

You have encountered an unknown error running Maven. Please help us to correct
this problem by following these simple steps:
- read the Maven FAQ at http://maven.apache.org/faq.html
- run the same command again with the '-e' parameter, eg maven -e jar
- search the maven-user archives for the error at

http://nagoya.apache.org/eyebrowse/SummarizeList?listName=us...@maven.apache.org


- post the output of maven -e to JIRA at
http://jira.codehaus.org/BrowseProject.jspa?id=10030 (you must sign up first)
- run 'maven --info' and post the output as the environment to the bug above


Total time: 0 seconds
Finished at: Tue Apr 17 16:38:06 EDT 2012


-----------------------------------------------------------------------
reran the other 2 commands and still seeing this error:


[erik@hawk xnat]$ jar xf
plugin-resources/maven-1.0.2/plugins/maven-linkcheck-plugin-1.3.4.jar
META-INF/MANIFEST.MF cat META-INF/MANIFEST.MF
java.io.IOException: META-INF : could not create directory
at sun.tools.jar.Main.extractFile(Main.java:946)
at sun.tools.jar.Main.extract(Main.java:905)
at sun.tools.jar.Main.run(Main.java:254)
at sun.tools.jar.Main.main(Main.java:1167)

Herrick, Rick

unread,
Apr 18, 2012, 7:48:42 AM4/18/12
to xnat_di...@googlegroups.com
OK, it's definitely a permissions issue, of such an extent that you can't change the permissions:

chmod: changing permissions of
`/usr/local/src/xnat/plugin-resources/maven-1.0.2/bin/maven':
Operation not permitted

You probably need to run chown and chmod on there as well, with sudo to get the permissions to change the permissions:

sudo chown -R <user>:<user> *
sudo chmod -R u+w *

In that first command, the <user> should be whatever user name you're working as and/or are running XNAT under.


Rick Herrick
Sr. Programmer/Analyst
Neuroinformatics Research Group
Washington University School of Medicine
(314) 827-4250

________________________________________
From: xnat_di...@googlegroups.com [xnat_di...@googlegroups.com] on behalf of Erik Manwaring [erik.ma...@gmail.com]
Sent: Tuesday, April 17, 2012 3:40 PM

Erik Manwaring

unread,
Apr 20, 2012, 5:05:34 PM4/20/12
to xnat_di...@googlegroups.com
Rick,

Thanks that seemed to help but now I have a new error:


Using XDAT Installation: /usr/local/src/xnat
Using JAVA_HOME: /usr/java/jdk1.7.0_03

Verify Java Version (with java -version) java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.6)
(rhel-1.43.1.10.6.el6_2-x86_64) OpenJDK 64-Bit Server VM (build
20.0-b11, mixed mode)

Executing /usr/local/src/xnat/plugin-resources/maven-1.0.2/bin/maven


xdat:setup __ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2

Plugin cache will be regenerated

Attempting to download commons-jelly-tags-xml-20030211.142705.jar.
31K downloaded
Attempting to download commons-jelly-tags-interaction-20030211.143817.jar.
4K downloaded
Attempting to download commons-io-20030203.000550.jar.
59K downloaded
Attempting to download commons-net-1.1.0.jar.
139K downloaded
Attempting to download commons-httpclient-2.0.jar.
217K downloaded
Attempting to download commons-lang-2.0.jar.
165K downloaded
Attempting to download commons-logging-1.0.3.jar.
30K downloaded
Attempting to download jsch-0.1.5.jar.
79K downloaded
Attempting to download commons-jelly-20030902.160215.jar.
150K downloaded
Attempting to download commons-jelly-tags-velocity-20030303.205659.jar.
7K downloaded
Attempting to download velocity-1.4-dev.jar.
505K downloaded
build:start:

xdat:setup:
[echo] HOME: /usr/local/src/xnat
Unable to connected to 'jdbc:postgresql://localhost/xnat'
Please resolve the PostgreSQL issue (specified below).

BUILD FAILED
File...... /usr/local/src/xnat/maven.xml Element... ant:TestDB
Line...... 1130 Column.... 177 A connection error has occurred:
org.postgresql.util.PSQLException: FATAL: Ident authentication failed
for user "xnat"

Total time: 12 seconds
Finished at: Fri Apr 20 16:47:47 EDT 2012

I checked the password for the user xnat in the postgres db that's the
admin of the xnat db and made sure it was the same. It still happened
though.

Any assistance is appreciated.


Thank you,
Erik

Erik Manwaring

unread,
Apr 26, 2012, 10:57:20 AM4/26/12
to xnat_di...@googlegroups.com
Thank you for pointing me in the right direction!

With Redhat I had to change settings in our Postgres pg_hba.conf file
to TRUST and everything worked.


Thanks!
Erik
Reply all
Reply to author
Forward
0 new messages