You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Michael Hagedorn <mi...@gmx.de> on 2010/09/13 17:13:53 UTC

[daemon] Unable to find Java Runtime Environment


 Hello *,

I'm using prunsrv with --Jvm=auto and --StartMode=Java.
If I try this on a machine with an out of the box installed JRE6 (no %JAVA_HOME% is set) service startup fails with "Unable to find Java Runtime Environment".
If I use --JavaHome and assign JRE directory it works fine but that's what I want to avoid.

Do I miss something?

Thanks
Michael


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


Re: [daemon] Unable to find Java Runtime Environment

Posted by Mladen Turk <mt...@apache.org>.
On 09/14/2010 10:29 AM, Michael Hagedorn wrote:
>   --StartMode=java --JavaHome=jre ends up in
> [error] ServiceStart returned 5

:) I said it would be nice to *have* --JavaHome=jre


Create an JIRA feature request issue
(https://issues.apache.org/jira/browse/DAEMON)
explaining the problems you are facing.


Regards
-- 
^TM

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


Re: [daemon] Unable to find Java Runtime Environment

Posted by Michael Hagedorn <mi...@gmx.de>.
 --StartMode=java --JavaHome=jre ends up in
[error] ServiceStart returned 5
I guess '5' means access denied. So it needs a valid --JavaHome
(--StartMode=jre wont work too).

BTW my very favorite StartMode would be 'jvm' of course but it fails.
I'm using RMI within localhost (talking from the daemon app to gui). If
daemon app gets launched by jvm.dll I catch exceptions cause of missing
security manager for RMI class loading. But I don't want to use security
manager and if my app gets launched by java.exe is do not need one.
Is this dependency forced by prunsrv or is this a built in feature of
jvm.dll? And what does java.exe to skip security manager in case of
local usage? Is jvm.dll assuming web browser usage by default?

Thanks
Michael

On 13.09.2010 18:26, Mladen Turk wrote:
> On 09/13/2010 05:43 PM, Michael Hagedorn wrote:
>>   Thanks for the quick answer!
>>
>> To pick up the java.exe by registry would be great too. I don't want to
>> care about JAVA_HOME. If user upgrades JRE service should still work. In
>> case of jvm.dll it will. Why not with java.exe?
>>
>
> Indeed, why not.
> Although -Jvm=xxx is meant for --StartMode=jvm.
> Perhaps --JavaHome=jre would do the trick.
> Currently for StartMode=java and without --JavaHome
> procrun will search for JDK (not JRE) from the registry.
> We could fallback to searching for JRE if JDK was not found.
>
> Anyhow, create a JIRA feature request for Commons Daemon.
>
>
> Regards

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


Re: [daemon] Unable to find Java Runtime Environment

Posted by Mladen Turk <mt...@apache.org>.
On 09/13/2010 05:43 PM, Michael Hagedorn wrote:
>   Thanks for the quick answer!
>
> To pick up the java.exe by registry would be great too. I don't want to
> care about JAVA_HOME. If user upgrades JRE service should still work. In
> case of jvm.dll it will. Why not with java.exe?
>

Indeed, why not.
Although -Jvm=xxx is meant for --StartMode=jvm.
Perhaps --JavaHome=jre would do the trick.
Currently for StartMode=java and without --JavaHome
procrun will search for JDK (not JRE) from the registry.
We could fallback to searching for JRE if JDK was not found.

Anyhow, create a JIRA feature request for Commons Daemon.


Regards
-- 
^TM

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


Re: [daemon] Unable to find Java Runtime Environment

Posted by Michael Hagedorn <mi...@gmx.de>.
 Thanks for the quick answer!

To pick up the java.exe by registry would be great too. I don't want to
care about JAVA_HOME. If user upgrades JRE service should still work. In
case of jvm.dll it will. Why not with java.exe?

Thanks
Michael

On 13.09.2010 17:23, Mladen Turk wrote:
> On 09/13/2010 05:13 PM, Michael Hagedorn wrote:
>>
>>
>>   Hello *,
>>
>> I'm using prunsrv with --Jvm=auto and --StartMode=Java.
>> If I try this on a machine with an out of the box installed JRE6 (no
>> %JAVA_HOME% is set) service startup fails with "Unable to find Java
>> Runtime Environment".
>> If I use --JavaHome and assign JRE directory it works fine but that's
>> what I want to avoid.
>>
>> Do I miss something?
>>
>
> -Jvm=auto is used to find the jvm.dll from the Windows registry.
> --StartMode=java requires bin/java.exe, so it needs JAVA_HOME
> pointing to directory containing bin/java.exe (in your case JRE loc)
> or just use --JavaHome
>
>
>
> Regards

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


Re: [daemon] Unable to find Java Runtime Environment

Posted by Mladen Turk <mt...@apache.org>.
On 09/13/2010 05:13 PM, Michael Hagedorn wrote:
>
>
>   Hello *,
>
> I'm using prunsrv with --Jvm=auto and --StartMode=Java.
> If I try this on a machine with an out of the box installed JRE6 (no %JAVA_HOME% is set) service startup fails with "Unable to find Java Runtime Environment".
> If I use --JavaHome and assign JRE directory it works fine but that's what I want to avoid.
>
> Do I miss something?
>

-Jvm=auto is used to find the jvm.dll from the Windows registry.
--StartMode=java requires bin/java.exe, so it needs JAVA_HOME
pointing to directory containing bin/java.exe (in your case JRE loc)
or just use --JavaHome



Regards
-- 
^TM

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