You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thangavel Sankaranarayanan <ts...@in.ibm.com> on 2008/10/17 15:28:29 UTC

JAVA_HOME is not found but tomcat is running. possible?

Hi all ,

I have a tomcat 4.x version (Perhaps it is a old version ,it is in
production and we cant upgrade as of now).

It is running as a window service in Windows2000 server.
in the service icon i can find the  path to executable:


C:\Products\Apache Tomcat 4.1\bin\tomcat.exe

My doubt is ,does tomcat.exe needs JAVA_HOME or JRE_HOME defined to run
tomcat in this case as we are not starting tomcat using Startup.bat or
Catalina.bat.

If so,In my system i couldn't find any environmental varible set for
JAVA_HOME or JRE_HOME... i can find only CATALINA_OPTS in it.

It is also not defined in any of the .bat file as well...please help me on
this.thanks





Regards,
Thangavel Sankaranarayanan



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


RE: JAVA_HOME is not found but tomcat is running. possible?

Posted by Thangavel Sankaranarayanan <ts...@in.ibm.com>.
Hi Martin,

This is my startup.bat. Here it is doing the job of setting the
CATALINA_HOME if it is not defined and calling CATALINA.bat..
I can find JAVA_HOME ENV variable found in many places in CATALINA.bat. But
i can find any JAVA_HOME variable in the list of environment variables or
in any of the scripts .( which is assigning a value for it)

rem Guess CATALINA_HOME if not defined
if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=.
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
set CATALINA_HOME=..
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat

rem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
echo Cannot find %EXECUTABLE%
echo This file is needed to run this program
goto end
:okExec

rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs

call "%EXECUTABLE%" start %CMD_LINE_ARGS%

:end


Regards,
Thangavel Sankaranarayanan



                                                                           
             Martin Gainty                                                 
             <mgainty@hotmail.                                             
             com>                                                       To 
                                       Tomcat Users List                   
             10/17/2008 07:30          <us...@tomcat.apache.org>           
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         RE: JAVA_HOME is not found but      
               "Tomcat Users           tomcat is running. possible?        
                   List"                                                   
             <users@tomcat.apa                                             
                 che.org>                                                  
                                                                           
                                                                           
                                                                           





doesnt sound right ..here is an excerpt from setclasspath.sh

# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
  # Bugzilla 37284
  if $darwin && [ -d
"/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" ]; then
    export
JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home"
  else
    echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is
defined"
    echo "At least one of these environment variable is needed to run this
program"
    exit 1
  fi
fi
if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
  echo "JAVA_HOME should point to a JDK in order to run in debug mode."
  exit 1
fi
if [ -z "$JRE_HOME" ]; then
  JRE_HOME="$JAVA_HOME"
fi

As you can clearly see you will need to have either JRE_HOME or JAVA_HOME
environment vars set before executing
Since all of this is conjecture and speculation..do you have the source for
tomcat.exe so we can find out whats going on?

Thanks,
Martin Gainty
GMT+5
(e)mgainty@hotmail.com
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.


> Subject: JAVA_HOME is not found but tomcat is running. possible?
> To: users@tomcat.apache.org
> From: tsankara@in.ibm.com
> Date: Fri, 17 Oct 2008 18:58:29 +0530
>
> Hi all ,
>
> I have a tomcat 4.x version (Perhaps it is a old version ,it is in
> production and we cant upgrade as of now).
>
> It is running as a window service in Windows2000 server.
> in the service icon i can find the  path to executable:
>
>
> C:\Products\Apache Tomcat 4.1\bin\tomcat.exe
>
> My doubt is ,does tomcat.exe needs JAVA_HOME or JRE_HOME defined to run
> tomcat in this case as we are not starting tomcat using Startup.bat or
> Catalina.bat.
>
> If so,In my system i couldn't find any environmental varible set for
> JAVA_HOME or JRE_HOME... i can find only CATALINA_OPTS in it.
>
> It is also not defined in any of the .bat file as well...please help me
on
> this.thanks
>
>
>
>
>
> Regards,
> Thangavel Sankaranarayanan
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

_________________________________________________________________
Stay organized with simple drag and drop from Windows Live Hotmail.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_102008


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


RE: JAVA_HOME is not found but tomcat is running. possible?

Posted by Martin Gainty <mg...@hotmail.com>.
doesnt sound right ..here is an excerpt from setclasspath.sh

# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
  # Bugzilla 37284
  if $darwin && [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" ]; then
    export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home"
  else
    echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
    echo "At least one of these environment variable is needed to run this program"
    exit 1
  fi
fi
if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
  echo "JAVA_HOME should point to a JDK in order to run in debug mode."
  exit 1
fi
if [ -z "$JRE_HOME" ]; then
  JRE_HOME="$JAVA_HOME"
fi

As you can clearly see you will need to have either JRE_HOME or JAVA_HOME environment vars set before executing
Since all of this is conjecture and speculation..do you have the source for tomcat.exe so we can find out whats going on?

Thanks,
Martin Gainty 
GMT+5
(e)mgainty@hotmail.com
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Subject: JAVA_HOME is not found but tomcat is running. possible?
> To: users@tomcat.apache.org
> From: tsankara@in.ibm.com
> Date: Fri, 17 Oct 2008 18:58:29 +0530
> 
> Hi all ,
> 
> I have a tomcat 4.x version (Perhaps it is a old version ,it is in
> production and we cant upgrade as of now).
> 
> It is running as a window service in Windows2000 server.
> in the service icon i can find the  path to executable:
> 
> 
> C:\Products\Apache Tomcat 4.1\bin\tomcat.exe
> 
> My doubt is ,does tomcat.exe needs JAVA_HOME or JRE_HOME defined to run
> tomcat in this case as we are not starting tomcat using Startup.bat or
> Catalina.bat.
> 
> If so,In my system i couldn't find any environmental varible set for
> JAVA_HOME or JRE_HOME... i can find only CATALINA_OPTS in it.
> 
> It is also not defined in any of the .bat file as well...please help me on
> this.thanks
> 
> 
> 
> 
> 
> Regards,
> Thangavel Sankaranarayanan
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Stay organized with simple drag and drop from Windows Live Hotmail.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_102008

Re: Building Tomcat With IcedTea

Posted by Ole Ersoy <ol...@gmail.com>.
Chuck,

That must be it (Even though the build instructions for Tomcat 6 say 1.5.x or later).  Thanks again for the heads up.  

- Ole


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


RE: Building Tomcat With IcedTea

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ole Ersoy [mailto:ole.ersoy@gmail.com]
> Subject: Building Tomcat With IcedTea
>
> I'm trying to build tomcat with IcedTea.  I get the following
> types of errors while DBCP is being built:

Are you using JDK 6 for your Tomcat builds?  Tomcat must be built with JDK 5 due to incompatibilities introduced by Sun in JDK 6.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

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


Building Tomcat With IcedTea

Posted by Ole Ersoy <ol...@gmail.com>.
Hi,

I'm trying to build tomcat with IcedTea.  I get the following types of errors while DBCP is being built:

    [javac] /usr/share/java/tomcat6-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/cpdsadapter/PoolablePreparedStatementStub.java:34: isClosed() in org.apache.tomcat.dbcp.dbcp.DelegatingStatement cannot implement isClosed() in java.sql.Statement; attempting to assign weaker access privileges; was public
    [javac] class PoolablePreparedStatementStub extends PoolablePreparedStatement {
    [javac] ^
    [javac] /usr/share/java/tomcat6-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/datasources/PerUserPoolDataSource.java:52: org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSource is not abstract and does not override abstract method isWrapperFor(java.lang.Class<?>) in java.sql.Wrapper
    [javac] public class PerUserPoolDataSource
    [javac]        ^
    [javac] /usr/share/java/tomcat6-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/datasources/SharedPoolDataSource.java:45: org.apache.tomcat.dbcp.dbcp.datasources.SharedPoolDataSource is not abstract and does not override abstract method isWrapperFor(java.lang.Class<?>) in java.sql.Wrapper
    [javac] public class SharedPoolDataSource
    [javac]        ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 15 errors


Anyone know of any workarounds?

Thanks,
- Ole




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


Re: JAVA_HOME is not found but tomcat is running. possible?

Posted by Len Popp <le...@gmail.com>.
When it's running as a service, Tomcat gets the location of Java from
the registry, not from JAVA_HOME.
You can change this and other settings using tomcat4w.exe.
-- 
Len



On Fri, Oct 17, 2008 at 09:28, Thangavel Sankaranarayanan
<ts...@in.ibm.com> wrote:
> Hi all ,
>
> I have a tomcat 4.x version (Perhaps it is a old version ,it is in
> production and we cant upgrade as of now).
>
> It is running as a window service in Windows2000 server.
> in the service icon i can find the  path to executable:
>
>
> C:\Products\Apache Tomcat 4.1\bin\tomcat.exe
>
> My doubt is ,does tomcat.exe needs JAVA_HOME or JRE_HOME defined to run
> tomcat in this case as we are not starting tomcat using Startup.bat or
> Catalina.bat.
>
> If so,In my system i couldn't find any environmental varible set for
> JAVA_HOME or JRE_HOME... i can find only CATALINA_OPTS in it.
>
> It is also not defined in any of the .bat file as well...please help me on
> this.thanks
>
>
>
>
>
> Regards,
> Thangavel Sankaranarayanan
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: JAVA_HOME is not found but tomcat is running. possible?

Posted by André Warnier <aw...@ice-sa.com>.
Thangavel Sankaranarayanan wrote:
> Hi all ,
> 
> I have a tomcat 4.x version (Perhaps it is a old version ,it is in
> production and we cant upgrade as of now).
> 
> It is running as a window service in Windows2000 server.
> in the service icon i can find the  path to executable:
> 
> 
> C:\Products\Apache Tomcat 4.1\bin\tomcat.exe
> 
> My doubt is ,does tomcat.exe needs JAVA_HOME or JRE_HOME defined to run
> tomcat in this case as we are not starting tomcat using Startup.bat or
> Catalina.bat.
> 
> If so,In my system i couldn't find any environmental varible set for
> JAVA_HOME or JRE_HOME... i can find only CATALINA_OPTS in it.
> 
> It is also not defined in any of the .bat file as well...please help me on
> this.thanks
> 
Check if you also have a tomcatw.exe in the same directory.
If yes, then it is probably an instance of this :

http://commons.apache.org/daemon
read, then click on the "procrun" link at the bottom of the page.

It sounds a bit obscure, so roughly :

The Java JVM, per se, does not run very nicely as a Windows Service, 
because it lacks the interfaces that a Windows Service needs to properly 
respond to Windows messages like "shut down service".
So procrun.exe is a program that "wraps" the JVM into a shell that does 
have these interfaces.
tomcatw.exe is just the GUI program prunmgr.exe, renamed to tomcatw.exe.
It is the GUI setup tool for procrun.exe, allowing you to tell it where 
to get its JVM, what parameters to start it with, etc..
Much like the startup.sh and catalina.sh do under Unix/Linux.
Double-click on tomcatw.exe, then select the Java panel, and you'll see 
what I am talking about.

So basically, under Windows, if you want to run Tomcat as a service, you 
do as follows :
- configure your JVM environment using tomcatw.exe (prunmgr)
- use tomcat.exe (procrun) as the executable for the Service that 
Windows will run
This tomcat.exe will start the JVM, and in the JVM Tomcat (bootstrap.jar)
This tomcat.exe will also catch the signal Windows is sending when it's 
time to shut down, and properly stop Tomcat and the JVM.

Now you see why you don't find an environment variable JAVA_HOME ?
tomcat.exe (in reality procrun) does not need it, because it finds the 
same information somewhere else (where tomcatw.exe (prunmgr) put it).
(And I am not quite sure where it puts it, probably the Registry).



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