You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bobi St <te...@yahoo.de> on 2011/08/01 23:27:23 UTC

Re: Tomcat 7: Why is JDK needed ?

Thanks to all for the replies.
So we dont need JDK_HOME, and the message

>>>>> Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
>>>>> At least one of these environment variable is needed to run this program
is obsolete.
Best regards,

From: Bobi St
Date: Thu, 21 Jul 2011 19:58:53

why is Why is JDK needed also for Tomcat 7 ? Does it use a compiler, or why not simply using for example jre6 ?!?
I have to install always extra JDK because of it ...

	> Von: Justin Randall 
	> 21. Juli, 2011 21:01 Uhr

	> It uses the Java compiler for activities such as compiling JSPs into Servlets into Java class files.

	> All versions of Tomcat require the JDK.

		>> I see. This makes sense.
		>> P.s. On the other hand the ---or--- in the error message is misleading: neither JDK_HOME ---nor--- JRE_HOME is set...

			>>> Von: Konstantin Kolinko 
			>>> 21. Juli, 2011 21:09 Uhr

			>>> Wrong. All currently supported versions (5.5, 6.0, 7.0)
			>>> do not use JDK compiler by default even if it is available.
			>>> See documentation for details.

			>>> All of them can run with JRE.

			>>> It is good to have JDK around because of additional utilities like jvisualvm etc.

				>>>> Bobi St
				>>>> 22. Juli, 2011 13:15 Uhr

				>>>> So, I'm talking about Tomcat 7. According to some description, it 				>>>> doesn't need JDK anymore. For this reason under Windows (7) I 				>>>> didn't set it at the beginning (neither did I install it), so the 				>>>> error came: no JDK nor JRE was set (although JRE was set). I tried 				>>>> to set JDK_HOME to jre6 as well, but the same error message.

				>>>> Only after installing (the latest) JDK, and setting JDK_HOME 				>>>> towards it, I could start Tomcat with the startup.bat

>>>>> chris derham
>>>>> Freitag, 22. Juli, 2011 14:06 Uhr

>>>>> Windows 7
>>>>> Tomcat 7.0.19
>>>>> java -version
>>>>> java version "1.6.0_25"
>>>>> Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
>>>>> Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

>>>>> Open command prompt, navigate to <catalina_home>\bin. If JAVA_HOME is not
>>>>> set, tomcat complains no JAVA_HOME. If set to a JRE, complains should point
>>>>> to JDK. Output shown below

>>>>> D:\apps\tomcat\apache-tomcat-7.0.19\bin>set JAVA_HOME=

>>>>> D:\apps\tomcat\apache-tomcat-7.0.19\bin>catalina.bat run
>>>>> Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
>>>>> At least one of these environment variable is needed to run this program

>>>>> D:\apps\tomcat\apache-tomcat-7.0.19\bin>set JAVA_HOME=C:\Program
>>>>> Files\Java\jre6


>>>>> D:\apps\tomcat\apache-tomcat-7.0.19\bin>catalina.bat run
>>>>> The JAVA_HOME environment variable is not defined correctly
>>>>> This environment variable is needed to run this program
>>>>> NB: JAVA_HOME should point to a JDK not a JRE

>>>>>> Mark Thomas
>>>>>> 22. Juli, 2011 14:13 Uhr
>>>>>> That is wrong. JAVA_HOME can't point to a JRE. You should be using JRE_HOME here.

>>>>>>> Ognjen Blagojevic
>>>>>>> 22. Juli, 2011 14:16 Uhr

>>>>>>> C:\apps\apache-tomcat-7.0.11\bin>set JRE_HOME=
>>>>>>> C:\apps\apache-tomcat-7.0.11\bin>set JAVA_HOME=

>>>>>>> C:\apps\apache-tomcat-7.0.11\bin>startup.bat
>>>>>>> Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
>>>>>>> At least one of these environment variable is needed to run this program

>>>>>>> C:\apps\apache-tomcat-7.0.11\bin>set JRE_HOME=C:\Program Files\Java\jre6\

>>>>>>> C:\apps\apache-tomcat-7.0.11\bin>startup.bat	


Re: Tomcat 7: Why is JDK needed ?

Posted by Bobi St <te...@yahoo.de>.
Hallo,
--- Christopher Schultz <ch...@christopherschultz.net> schrieb am Di, 2.8.2011:
>>> The message is correct as stated; when JAVA_HOME is used, it

>
>> *must* point to a JDK.  If you want a specific JRE, you must set
>
>
> JRE_HOME, not JAVA_HOME.
> 
>

> 
>
Well, if JDK is not needed anymore, why bother setting JAVA_HOME, why
> 
>
is it mentioned at all ?


>
Because you have a choice: JRE or JDK. Some people have both. Some only

>
have one. Hence the choice.
Well, I have to accept this opinion. But secretly I would still think that is an obsolete message :)

>

>
>
> Why not only to set JRE_HOME ?!?
> 
>

>


> 
>

>
Sorry, I can't parse that question.
>
>
 
> 
>
I meant, if JDK is not needed anymore, why at all mentioning JAVA_HOME ?
>


>
It is not /required/, but it is an option

Thanks .

Re: Tomcat 7: Why is JDK needed ?

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

Bobi,

On 8/1/2011 7:18 PM, Bobi St wrote:
>> The message is correct as stated; when JAVA_HOME is used, it
>> *must* point to a JDK.  If you want a specific JRE, you must set
>> JRE_HOME, not JAVA_HOME.
> 
> Well, if JDK is not needed anymore, why bother setting JAVA_HOME, why
> is it mentioned at all ?

Because you have a choice: JRE or JDK. Some people have both. Some only
have one. Hence the choice.

>> Why not only to set JRE_HOME ?!?
> 
> Sorry, I can't parse that question.
> 
> I meant, if JDK is not needed anymore, why at all mentioning
> JAVA_HOME ?

It is not /required/, but it is an option.

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

iEYEARECAAYFAk43Qv8ACgkQ9CaO5/Lv0PAasgCeO989JGDyrbPF50hYXh5pIj7Q
q0AAoKMvNVtbhZP+918xkDNTmIyUVzC2
=x3qN
-----END PGP SIGNATURE-----

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


Re: Tomcat 7: Why is JDK needed ?

Posted by David Kerber <dc...@verizon.net>.
On 8/1/2011 7:18 PM, Bobi St wrote:
>
> --- Caldarale, Charles R<Ch...@unisys.com>  schrieb am Mo, 1.8.2011:
>
>> it is obsolete in a way, because setting JAVA_HOME to JRE 
>> gives the message : "NB: JAVA_HOME should point to a JDK
>> not a JRE".
> The message is correct as stated; when JAVA_HOME is used, it *must* point to a JDK.  If you want a specific JRE, you must set JRE_HOME, not JAVA_HOME.  If 
> ::: Well, if JDK is not needed anymore, why bother setting JAVA_HOME, why is it mentioned at all ?
>
>> Why not only to set JRE_HOME ?!?
> Sorry, I can't parse that question.
>   
> ::: I meant, if JDK is not needed anymore, why at all mentioning JAVA_HOME ?
>
>> the messaging seems at least to me a little confusing.
> Please explain why.  As far as I can see, you set JAVA_HOME to a JRE, which is invalid; once you've done that, nothing useful can result.
>
>   
> ::: Its all about JDK, if JDK is not needed anymore, why at all mentioning JAVA_HOME to JDK ?
>
My guess would be backwards compatibility.  Also, there may be a reason 
that somebody might want to use a JDK instead of a JRE.



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


RE: Tomcat 7: Why is JDK needed ?

Posted by Bobi St <te...@yahoo.de>.

--- Caldarale, Charles R <Ch...@unisys.com> schrieb am Mo, 1.8.2011:

> it is obsolete in a way, because setting JAVA_HOME to JRE 
> gives the message : "NB: JAVA_HOME should point to a JDK 
> not a JRE".

The message is correct as stated; when JAVA_HOME is used, it *must* point to a JDK.  If you want a specific JRE, you must set JRE_HOME, not JAVA_HOME.  If 
::: Well, if JDK is not needed anymore, why bother setting JAVA_HOME, why is it mentioned at all ?

> Why not only to set JRE_HOME ?!?

Sorry, I can't parse that question.
 
::: I meant, if JDK is not needed anymore, why at all mentioning JAVA_HOME ?
 
> the messaging seems at least to me a little confusing.

Please explain why.  As far as I can see, you set JAVA_HOME to a JRE, which is invalid; once you've done that, nothing useful can result.

 
::: Its all about JDK, if JDK is not needed anymore, why at all mentioning JAVA_HOME to JDK ?
 

RE: Tomcat 7: Why is JDK needed ?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Bobi St [mailto:temporarybobi@yahoo.de] 
> Subject: Re: Tomcat 7: Why is JDK needed ?

> it is obsolete in a way, because setting JAVA_HOME to JRE 
> gives the message : "NB: JAVA_HOME should point to a JDK 
> not a JRE".

The message is correct as stated; when JAVA_HOME is used, it *must* point to a JDK.  If you want a specific JRE, you must set JRE_HOME, not JAVA_HOME.  If you set neither JAVA_HOME nor JRE_HOME, the startup scripts try to find a JVM, and set one of the variables for you.

> Why not only to set JRE_HOME ?!?

Sorry, I can't parse that question.

> Pointing at JDK from JAVA_HOME works however.

As it should.  Setting JRE_HOME to the location of a JRE also works.

> the messaging seems at least to me a little confusing.

Please explain why.  As far as I can see, you set JAVA_HOME to a JRE, which is invalid; once you've done that, nothing useful can result.

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


Re: Tomcat 7: Why is JDK needed ?

Posted by Bobi St <te...@yahoo.de>.
Hi,

--- Mark Thomas <ma...@apache.org> schrieb am Mo, 1.8.2011:

On 01/08/2011 22:27, Bobi St wrote:

> So we dont need JDK_HOME, and the message

Correct.

>>>>>> Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
>>>>>> At least one of these environment variable is needed to run this program
> is obsolete.

Wrong. The message is correct-------------------------------------------------------Well, it is obsolete in a way, because setting JAVA_HOME to JRE gives the message : "NB: JAVA_HOME should point to a JDK not a JRE". Why not only to set JRE_HOME ?!? Pointing at JDK from JAVA_HOME works however. ... Well, the messaging seems at least to me a little confusing.
===========================C:\apache-tomcat-7.0.8\bin>startup
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
D:\apache-tomcat-7.0.8\bin>set JAVA_HOME=c:\Program Files\Java\jre6

D:\apache-tomcat-7.0.8\bin>startup
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

Re: Tomcat 7: Why is JDK needed ?

Posted by Mark Thomas <ma...@apache.org>.
On 01/08/2011 22:27, Bobi St wrote:
> Thanks to all for the replies.
> So we dont need JDK_HOME, and the message

Correct.

>>>>>> Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
>>>>>> At least one of these environment variable is needed to run this program
> is obsolete.

Wrong. The message is correct.

Mark

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