You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Lakshmi Narayanan K." <ln...@gmail.com> on 2005/04/28 09:20:14 UTC

How to run tomcat without specifying a JDK location?

Hi All,

I am currently using Tomcat 5.0.28 coupled with JDK 1.4.2_02 to run
the tomcat service. I have noticed that unless the path to a JDK is
specified in JAVA_HOME, the tomcat does not start. On Windows, the
setclasspath.bat file has the following entries:

    :noJavaHome
    echo The JAVA_HOME environment variable is not defined correctly
    echo This environment variable is needed to run this program
    echo NB: JAVA_HOME should point to a JDK not a JRE
    goto exit

But the tomcat documentation available at:
     < http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html > 
states this: "Java location: The installer will use the registry or
the JAVA_HOME environment variable to determine the base path of the
JDK or a JRE. If only a JRE (or an incorrect path) is specified,
Tomcat will run but will be unable to compile JSP pages at runtime.
Either all webapps will need to be precompiled (this can be easily
done using the Tomcat deployer), or the lib\tools.jar file from a JDK
installation must be copied to the common\lib path of the Tomcat
installation."

If this is possible, why is it that the Windows installer for Tomcat
does not accept the location of JRE (it accepts ONLY a JDK), and why
does the batch files state that only a JDK should be provided, and not
a JRE?

In case anyone has successfully been able to start Tomcat without
specifying a JDK, please help me. Eagerly awaiting your replies.

Many thanks in advance and Warm Regards, 

Lakshmi Narayanan K.
" When the buying stops, the killing can too! "

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


Re: How to run tomcat without specifying a JDK location?

Posted by "Lakshmi Narayanan K." <ln...@gmail.com>.
Hi Jason, 

Thank you very much for replying. It worked. I modified
setclasspath.bat to NOT check for the presence of jdb and javac. I was
then able to start Tomcat by using 'catalina run' and 'catalina
start'. Now I have a few more questions:

1) What is the role of the tools.jar file? Does it help in compilation
of JSP's? I mean, is tools.jar enough to compile JSP's without a JDK?

2) On Windows, I have registered tomcat to run a system service. If we
modify setclasspath.bat, how do we make the service startup not depend
on the JDK. How to specify just the JRE? Can we modify the service
parameters (using tomcat5w) to point to the JRE's jvm.dll? Is that
just enough?

Eagerly awaiting your replies...

Warm Regards,

/kLn

On 4/29/05, Jason Bainbridge <jb...@gmail.com> wrote:
> > > JSP are compiled at runtime and need a compiler for this purpose -> JDK!
> 
> Actually that is't correct, we run JSP's that aren't pre-compiled (our
> application is servlet based but we have a few utility JSP's that we
> write/use for support) and still use just a JRE. I think from memory
> you just need to edit one of the .bat files either catalina.bat or
> setclasspath.bat if I remember correctly but I can't remember exactly
> what needed to be edited and I'm not in front of one of the servers
> right now.
> 
> Regards,
> --
> Jason Bainbridge
> http://kde.org - webmaster@kde.org
> Personal Site - http://jasonbainbridge.com

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


Re: How to run tomcat without specifying a JDK location?

Posted by Jason Bainbridge <jb...@gmail.com>.
On 4/29/05, Lakshmi Narayanan K. <ln...@gmail.com> wrote:
> Hi,
> 
> Yes, I was able to figure that out. But, it the following which
> puzzles me. I'd already pasted this in my initial mail, but here it is
> again:
> > > But the tomcat documentation available at:
> > >      < http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html >
> > > states this: "Java location: The installer will use the registry or
> > > the JAVA_HOME environment variable to determine the base path of the
> > > JDK or a JRE. If only a JRE (or an incorrect path) is specified,
> > > Tomcat will run but will be unable to compile JSP pages at runtime.
> > > Either all webapps will need to be precompiled (this can be easily
> > > done using the Tomcat deployer), or the lib\tools.jar file from a JDK
> > > installation must be copied to the common\lib path of the Tomcat
> > > installation."
> 
> In light of this, how do I just tell tomcat that it isn't needed to do
> ANY JSP processing, just serve my servlets.
> 
> Once again, eagerly awaiting your reply,
> 
> Regards,
> 
> - Lakshmi Narayanan K.
> On 4/29/05, Oto Bossert <o....@gmail.com> wrote:
> > Yoo,
> >
> > JSP are compiled at runtime and need a compiler for this purpose -> JDK!

Actually that is't correct, we run JSP's that aren't pre-compiled (our
application is servlet based but we have a few utility JSP's that we
write/use for support) and still use just a JRE. I think from memory
you just need to edit one of the .bat files either catalina.bat or
setclasspath.bat if I remember correctly but I can't remember exactly
what needed to be edited and I'm not in front of one of the servers
right now.

Regards,
-- 
Jason Bainbridge
http://kde.org - webmaster@kde.org
Personal Site - http://jasonbainbridge.com

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


Re: How to run tomcat without specifying a JDK location?

Posted by "Lakshmi Narayanan K." <ln...@gmail.com>.
Hi,

Thanks very much for replying.

I don't think that just modifying JAVA_HOME to point to a JRE will
work. The file "catalina.bat" internally calls "setclasspath.bat"
which in turn checks for the presence of the following:
    * "%JAVA_HOME%\bin\java.exe"
    * "%JAVA_HOME%\bin\javaw.exe"
    * "%JAVA_HOME%\bin\jdb.exe"
    * "%JAVA_HOME%\bin\javac.exe"

Following are the lines of code that say so:
    if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
    if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
    if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
    if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
    goto okJavaHome
    :noJavaHome
    echo The JAVA_HOME environment variable is not defined correctly
    echo This environment variable is needed to run this program
    echo NB: JAVA_HOME should point to a JDK not a JRE
    goto exit

I even checked in the latest version of the setclasspath.bat file obtained from:
< http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/setclasspath.bat
>
But the same code is present.

So, once again, eagerly awaiting your replies.

Warm Regards,

- Lakshmi Narayanan K.



On 4/29/05, Oto Bossert <o....@gmail.com> wrote:
> Yoo,
> 
> Have a look at the startup script and look for JAVA_HOME,
> you can modify this script to point to JRE location.... WITHOUT
> setting JAVA_HOME...
> 
> Greetings O.
> 
> On 4/29/05, Lakshmi Narayanan K. <ln...@gmail.com> wrote:
> > Hi,
> >
> > Yes, I was able to figure that out. But, it the following which
> > puzzles me. I'd already pasted this in my initial mail, but here it is
> > again:
> > > > But the tomcat documentation available at:
> > > >      < http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html >
> > > > states this: "Java location: The installer will use the registry or
> > > > the JAVA_HOME environment variable to determine the base path of the
> > > > JDK or a JRE. If only a JRE (or an incorrect path) is specified,
> > > > Tomcat will run but will be unable to compile JSP pages at runtime.
> > > > Either all webapps will need to be precompiled (this can be easily
> > > > done using the Tomcat deployer), or the lib\tools.jar file from a JDK
> > > > installation must be copied to the common\lib path of the Tomcat
> > > > installation."
> >
> > In light of this, how do I just tell tomcat that it isn't needed to do
> > ANY JSP processing, just serve my servlets.
> >
> > Once again, eagerly awaiting your reply,
> >
> > Regards,
> >
> > - Lakshmi Narayanan K.
> > On 4/29/05, Oto Bossert <o....@gmail.com> wrote:
> > > Yoo,
> > >
> > > JSP are compiled at runtime and need a compiler for this purpose -> JDK!
> > >
> > > Greetings O.
> > >
> > > On 4/28/05, Lakshmi Narayanan K. <ln...@gmail.com> wrote:
> > > > Hi All,
> > > >
> > > > I am currently using Tomcat 5.0.28 coupled with JDK 1.4.2_02 to run
> > > > the tomcat service. I have noticed that unless the path to a JDK is
> > > > specified in JAVA_HOME, the tomcat does not start. On Windows, the
> > > > setclasspath.bat file has the following entries:
> > > >
> > > >     :noJavaHome
> > > >     echo The JAVA_HOME environment variable is not defined correctly
> > > >     echo This environment variable is needed to run this program
> > > >     echo NB: JAVA_HOME should point to a JDK not a JRE
> > > >     goto exit
> > > >
> > > > But the tomcat documentation available at:
> > > >      < http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html >
> > > > states this: "Java location: The installer will use the registry or
> > > > the JAVA_HOME environment variable to determine the base path of the
> > > > JDK or a JRE. If only a JRE (or an incorrect path) is specified,
> > > > Tomcat will run but will be unable to compile JSP pages at runtime.
> > > > Either all webapps will need to be precompiled (this can be easily
> > > > done using the Tomcat deployer), or the lib\tools.jar file from a JDK
> > > > installation must be copied to the common\lib path of the Tomcat
> > > > installation."
> > > >
> > > > If this is possible, why is it that the Windows installer for Tomcat
> > > > does not accept the location of JRE (it accepts ONLY a JDK), and why
> > > > does the batch files state that only a JDK should be provided, and not
> > > > a JRE?
> > > >
> > > > In case anyone has successfully been able to start Tomcat without
> > > > specifying a JDK, please help me. Eagerly awaiting your replies.
> > > >
> > > > Many thanks in advance and Warm Regards,
> > > >
> > > > Lakshmi Narayanan K.
> > > > " When the buying stops, the killing can too! "
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> >
> > --
> > Warm Regards,
> >
> > Lakshmi Narayanan K.
> > " When the buying stops, the killing can too! "
> >
> 


-- 
Warm Regards,

Lakshmi Narayanan K.
" When the buying stops, the killing can too! "

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


Re: How to run tomcat without specifying a JDK location?

Posted by "Lakshmi Narayanan K." <ln...@gmail.com>.
Hi,

Yes, I was able to figure that out. But, it the following which
puzzles me. I'd already pasted this in my initial mail, but here it is
again:
> > But the tomcat documentation available at:
> >      < http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html >
> > states this: "Java location: The installer will use the registry or
> > the JAVA_HOME environment variable to determine the base path of the
> > JDK or a JRE. If only a JRE (or an incorrect path) is specified,
> > Tomcat will run but will be unable to compile JSP pages at runtime.
> > Either all webapps will need to be precompiled (this can be easily
> > done using the Tomcat deployer), or the lib\tools.jar file from a JDK
> > installation must be copied to the common\lib path of the Tomcat
> > installation."

In light of this, how do I just tell tomcat that it isn't needed to do
ANY JSP processing, just serve my servlets.

Once again, eagerly awaiting your reply,

Regards,

- Lakshmi Narayanan K.
On 4/29/05, Oto Bossert <o....@gmail.com> wrote:
> Yoo,
> 
> JSP are compiled at runtime and need a compiler for this purpose -> JDK!
> 
> Greetings O.
> 
> On 4/28/05, Lakshmi Narayanan K. <ln...@gmail.com> wrote:
> > Hi All,
> >
> > I am currently using Tomcat 5.0.28 coupled with JDK 1.4.2_02 to run
> > the tomcat service. I have noticed that unless the path to a JDK is
> > specified in JAVA_HOME, the tomcat does not start. On Windows, the
> > setclasspath.bat file has the following entries:
> >
> >     :noJavaHome
> >     echo The JAVA_HOME environment variable is not defined correctly
> >     echo This environment variable is needed to run this program
> >     echo NB: JAVA_HOME should point to a JDK not a JRE
> >     goto exit
> >
> > But the tomcat documentation available at:
> >      < http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html >
> > states this: "Java location: The installer will use the registry or
> > the JAVA_HOME environment variable to determine the base path of the
> > JDK or a JRE. If only a JRE (or an incorrect path) is specified,
> > Tomcat will run but will be unable to compile JSP pages at runtime.
> > Either all webapps will need to be precompiled (this can be easily
> > done using the Tomcat deployer), or the lib\tools.jar file from a JDK
> > installation must be copied to the common\lib path of the Tomcat
> > installation."
> >
> > If this is possible, why is it that the Windows installer for Tomcat
> > does not accept the location of JRE (it accepts ONLY a JDK), and why
> > does the batch files state that only a JDK should be provided, and not
> > a JRE?
> >
> > In case anyone has successfully been able to start Tomcat without
> > specifying a JDK, please help me. Eagerly awaiting your replies.
> >
> > Many thanks in advance and Warm Regards,
> >
> > Lakshmi Narayanan K.
> > " When the buying stops, the killing can too! "
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> 


-- 
Warm Regards,

Lakshmi Narayanan K.
" When the buying stops, the killing can too! "

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