users@glassfish.java.net

Re: Why can't asadmin check for JAVA_HOME?

From: kedar <Kedar.Mhaswade_at_Sun.COM>
Date: Wed, 07 Feb 2007 14:12:49 -0800

Ryan,
>> Hmmm. Would there be other "class" of users who won't want
>> GlassFish to be side-effected if you change your "system" JAVA_HOME
>> environmen`t variable?
>
> I suppose.
>> Think of the GlassFish based distributions
>> where JDK was distributed along with the application server bits and
>> placed at: <install-dir>/jdk, e.g.
>>
>
> I wasn't aware that there were distributions of GF that co-bundled
> a JRE. In that case, I would fully expect GF to use its own copy.
> That's what my IDE does and it makes sense.
>
>> If you think users like you outnumber the others, please file
>> an RFE to make asadmin respect the environment variable first.
>> If that fails, it should then fall back to config/asenv one
>> that is configured by setup scripts.
>>
>
> If I had to guess, I would say that most command line tools follow
> this convention, like Ant and Maven, for example.
Yes, I understand the motivation. But since we depend "traditionally"
on a private property in asenv file, we need to carefully assess how
we can start depending on user's environment and variable like JAVA_HOME
for both asadmin client and server. For example, there might be users
who now will pull their hair if we started respecting JAVA_HOME.
>
>> At the heart of it is the concept of asenv.conf[.bat] that is
>> available in install-dir/config. Ideally, this file should be
>> used for locating "other" software like JDK. A particular install's
>> asadmin refers to its sibling config/asenv.conf[.bat], by default.
>>
>> So, wouldn't changing the AS_JAVA in this file let asadmin
>> use the Java of your choice? (This is of course a work-around for
>> your case).
>>
>
> That's what I did. But my point is that I was surprised that GF
> hard coded a pointer to an external dependency.
JDK/JRE is not bundled with GlassFish for 2 reasons:
- The installer needs to be run with a JRE and it has to assume
  that you've got at least a Java 5.0 SE.
- Size considerations. If we bundle JRE, the GlassFish download
  size increases. It was thought that it is not worth the size
  it adds. What do you think about this particular issue? Would
  you mind GlassFish bundle size going up by say 30 MB?

The other tools you mention seem to have committed to "JAVA_HOME"
right from the get-go.
>
>> Also, note that there are 2 JVM's involved here -- one is client
>> (asadmin) VM and other is the server VM that is used by the domain
>> when you do "asadmin start-domain".
>>
>
> Do they both use the value of AS_JAVA ?
Yes, by default.

This is what complicates the matter.
I am not sure if JAVA_HOME should control the server's VM (but it could).

But for the asadmin alone, is there a specific reason that you want
it to use the JRE from ENV{JAVA_HOME}? Or is it that you want the "server"
too to use the JAVA_HOME pointed JRE?

Thanks,
Kedar
>
> Thanks,
>
> --Ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>