You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kevin <th...@gmail.com> on 2011/03/24 18:43:16 UTC

Cannot set JAVA_HOME for jsvc/Tomcat 7.0.11... i've tried EVERYTHING

Hi, I'm pulling my hair trying to install Tomcat 7.0.11 on my machine.

 

Here's my info at a glance:

 

OS: Ubuntu 10.10

Tomcat version: 7.0.11

Tomcat main folder path: /usr/local/apache-tomcat-7.0.11/

JDK version (via the java -version command) : 1.6.0.24

JDK location: /usr/lib/jvm/java-6-sun

 

I'm running in to a problem trying to run Tomcat as a daemon via jsvc.
Before I installed Tomcat I set $JAVA_HOME in:

 

/etc/environment

 

to:

 

/usr/lib/jvm/java-6-sun      (logged out then back in, then used $echo
$JAVA_HOME to verify it was set)

 

Then I installed Tomcat, un-tar'd the commons-daemon-native.tar.gz, and
"./configure" 'd it. It complained about JAVA_HOME not being set, so I had
to "./configure" it again with:    

 

--with-java=/usr/lib/jvm/java-6-sun

 

Then used "make".  Copied it to:

 

usr/local/apache-tomcat-7.0.11/bin

 

.and try to execute:

 

/bin/jsvc -cp ./bin/bootstrap.jar:./bin/tomcat-juli.jar \

-outfile ./logs/catalina.out -errfile ./logs/catalina.err \

org.apache.catalina.startup.Bootstrap

 

which gives me the dreaded "Cannot locate Java Home" error.  It tried
setting it in ~/.bashrc with the line:

 

export JAVA_HOME=/usr/lib/jvm/java-6-sun 

 

and logged out and back in. Still to no dice.

 

I honestly don't know what to do and am at a loss right now. I think it
might have to do with the jdk, but I installed it straight from the package
manager. 

I'm pretty sure only the JDK comes with javac, and using javac -version
produces 1.6.0_24. So. I'm pretty sure I have both the JRE and JDK

 

Can someone, anyone, try to help me? I honestly don't know what to do
anymore.


Re: Cannot set JAVA_HOME for jsvc/Tomcat 7.0.11... i've tried EVERYTHING

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kevin,

On 3/24/2011 1:43 PM, Kevin wrote:
> OS: Ubuntu 10.10
> 
> Tomcat version: 7.0.11
> 
> Tomcat main folder path: /usr/local/apache-tomcat-7.0.11/
> 
> JDK version (via the java -version command) : 1.6.0.24
> 
> JDK location: /usr/lib/jvm/java-6-sun

What does 'which java' return?

I wonder if you're being too specific about the JAVA_HOME. For instance,
I have Java 1.6 installed via Debian's package manager and my JAVA_HOME
is set to "/usr", though Java is really installed under
"/usr/lib/jvm/java-6-sun/".

I haven't tried using jsvc under this environment, but I'll give it a try.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2LwCIACgkQ9CaO5/Lv0PBLMACff2snyjjxkLvsJCDsxHJS1pDB
QWQAnj1fF0r+zNjAYpr/QuAg7U7HGfEk
=zNT+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Cannot set JAVA_HOME for jsvc/Tomcat 7.0.11... i've tried EVERYTHING

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/3/24 Kevin <th...@gmail.com>:
> Hi, I'm pulling my hair trying to install Tomcat 7.0.11 on my machine.
>
> Here's my info at a glance:
> OS: Ubuntu 10.10
> Tomcat version: 7.0.11
> Tomcat main folder path: /usr/local/apache-tomcat-7.0.11/
> JDK version (via the java -version command) : 1.6.0.24
> JDK location: /usr/lib/jvm/java-6-sun
>
> I'm running in to a problem trying to run Tomcat as a daemon via jsvc.
> Before I installed Tomcat I set $JAVA_HOME in:
> /etc/environment
> to:
> /usr/lib/jvm/java-6-sun      (logged out then back in, then used $echo
> $JAVA_HOME to verify it was set)
>

1) Are you able to start Tomcat without jsvc with that JAVA_HOME?

./bin/catalina.sh start

2) Enable debug logging in jsvc: add "-debug" to the command line

http://commons.apache.org/daemon/jsvc.html

That will print what JRE it actually tries to use.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Cannot set JAVA_HOME for jsvc/Tomcat 7.0.11... i've tried EVERYTHING

Posted by Mark Shifman <ma...@yale.edu>.
add -home <directory> as an argument to jsvc.

if you type /bin/jsvc --help at a command line there are a bunch of other parameters
you may find helpful.

also if you look in /jsvc-src/native there are a couple of Tomcat?.sh files
(pretty old but you will get the idea) that you can modify to start and stop tomcat via jsvc.
mas



On 03/24/2011 01:43 PM, Kevin wrote:
> Hi, I'm pulling my hair trying to install Tomcat 7.0.11 on my machine.
> 
>  
> 
> Here's my info at a glance:
> 
>  
> 
> OS: Ubuntu 10.10
> 
> Tomcat version: 7.0.11
> 
> Tomcat main folder path: /usr/local/apache-tomcat-7.0.11/
> 
> JDK version (via the java -version command) : 1.6.0.24
> 
> JDK location: /usr/lib/jvm/java-6-sun
> 
>  
> 
> I'm running in to a problem trying to run Tomcat as a daemon via jsvc.
> Before I installed Tomcat I set $JAVA_HOME in:
> 
>  
> 
> /etc/environment
> 
>  
> 
> to:
> 
>  
> 
> /usr/lib/jvm/java-6-sun      (logged out then back in, then used $echo
> $JAVA_HOME to verify it was set)
> 
>  
> 
> Then I installed Tomcat, un-tar'd the commons-daemon-native.tar.gz, and
> "./configure" 'd it. It complained about JAVA_HOME not being set, so I had
> to "./configure" it again with:    
> 
>  
> 
> --with-java=/usr/lib/jvm/java-6-sun
> 
>  
> 
> Then used "make".  Copied it to:
> 
>  
> 
> usr/local/apache-tomcat-7.0.11/bin
> 
>  
> 
> .and try to execute:
> 
>  
> 
> /bin/jsvc -cp ./bin/bootstrap.jar:./bin/tomcat-juli.jar \
> 
> -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
> 
> org.apache.catalina.startup.Bootstrap
> 
>  
> 
> which gives me the dreaded "Cannot locate Java Home" error.  It tried
> setting it in ~/.bashrc with the line:
> 
>  
> 
> export JAVA_HOME=/usr/lib/jvm/java-6-sun 
> 
>  
> 
> and logged out and back in. Still to no dice.
> 
>  
> 
> I honestly don't know what to do and am at a loss right now. I think it
> might have to do with the jdk, but I installed it straight from the package
> manager. 
> 
> I'm pretty sure only the JDK comes with javac, and using javac -version
> produces 1.6.0_24. So. I'm pretty sure I have both the JRE and JDK
> 
>  
> 
> Can someone, anyone, try to help me? I honestly don't know what to do
> anymore.
> 
> 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shifman@yale.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org