Bug 1164943 - Installation guide Setting up the JRE for the JBoss ON Agent is incomplete and platform specific
Summary: Installation guide Setting up the JRE for the JBoss ON Agent is incomplete an...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Documentation
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: post-GA
: ---
Assignee: Tyler Kelly
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-17 22:26 UTC by Larry O'Leary
Modified: 2017-06-25 22:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
[Install_Guide] Specific guidance from Larry. Fixing for Linux will be EasyFix. Expanding for Windows, less so.
Last Closed: 2017-06-25 22:41:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1164940 0 unspecified CLOSED Installation guide section Setting up the JRE for the JBoss ON Agent incorrectly refers to JAVA_HOME which includes /bin... 2021-02-22 00:41:40 UTC

Internal Links: 1164940

Description Larry O'Leary 2014-11-17 22:26:07 UTC
Document URL: https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Operations_Network/3.2/html/Installation_Guide/Agent_Installation.html#jre-agent

Section Number and Name: ⁠4.1.1. Setting up the JRE for the JBoss ON Agent

Describe the issue: 
Section is incomplete and RHEL specific in regards to Java and the use of JAVA_HOME and RHQ_JAVA_HOME.

> 2. Set the RHQ_JAVA_HOME environment variable to the installation directory.

Although this can be done, it is only necessary if the system installed JVM is insufficient -- such as the wrong version or incompatible vendor or not available on the users PATH. This step should be marked as optional or dependent on the system installed JVM. Furthermore, JAVA_HOME can be used and is more then sufficient if already defined. 


>  1. Open the .bashrc for the system user that will run JBoss ON. For example: 

This is Linux, and most importantly Bash, specific. As these instructions are necessary for all supported platforms regardless of command interpreter, they should be made more generic with examples that might pertain to a specific shell or operating system. Furthermore, .bashrc is not where Bash user specific environment variables belong. Instead, .bash_profile should be used when using Bash. On Windows these settings belong in the user's environment settings. This is actually a good reason why one should use the rhq-agent-env.sh|bat file as these are sourced on their appropriate operating systems when one of the agent's start scripts are invoked.


>  Add a line to set the RHQ_JAVA_HOME environment variable to the specific JRE directory. For example:
>
>   export RHQ_JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk/bin/java/

This again only applies on Linux and UNIX systems. Furthermore, as reported in bug 1164940, the example path is wrong. It should be

    /usr/lib/jvm/jre-1.7.0-openjdk.x86_64

The /bin/java/ at the end will prevent the agent from running altogether. Basically, the value used here should point to the JVM's base directory. This will be the directory above the JVM's bin directory.


> 3. Set the system to use the correct version of the JRE using the system alternatives command. The selected version has the *+ symbols by it. 

Although this may apply to Linux distributions that support alternatives, it would also seem to indicate that if set, JAVA_HOME and RHQ_JAVA_HOME are not necessary. JAVA_HOME and RHQ_JAVA_HOME are only necessary if the system provided JVM is not sufficient -- such as one that could be provided by alternatives -- and requires a different JVM to override the system default. 



Suggestions for improvement: 
Not sure how to address all of these issues. If it makes sense to add specific sub-sections for each supported platform and how to set the values or if that should be up to the user. After all, this is system and JVM specific and can not be easily pre-determined by JBoss ON. In general though what we need to communicate to the user is:

* If RHQ_JAVA_HOME or JAVA_HOME are not defined, the `java` or `java.exe` executable must be available on the user's PATH.
* If not available or the one available is not compatible, the user's environment variable JAVA_HOME or RHQ_JAVA_HOME must be set.
* RHQ_JAVA_HOME will override the value provided by JAVA_HOME.
* The environment variable can be defined in the user's profile or in the `rhq-agent-env.sh|bat` environment scripts.

Comment 2 Scott Mumford 2015-09-03 00:47:14 UTC
Taking ownership of JON docs bugs.

Comment 3 Tyler Kelly 2017-06-12 06:41:35 UTC
Possible solution:

Mark "Setting up the JRE for the JBoss ON Agent" as optional and add a line indicating that this process is required if java configuration is not correct?

indicate that rhq-agent-env.sh|bat file should be changed to indicate JAVA_HOME, not bashrc

Overall, change step 2, remove step 3

Comment 4 Larry O'Leary 2017-06-12 13:30:55 UTC
This should probably be sufficient. It might help to note that RHQ_JAVA_HOME will override JAVA_HOME. i.e.

"If your environment already defines JAVA_HOME and you would like the JBoss ON Agent to use a different Java Runtime, you can use RHQ_JAVA_HOME to override the value specified by JAVA_HOME."

or something similar as a note.

Comment 7 Tyler Kelly 2017-06-25 22:41:28 UTC
Published on customer portal on 2017-06-26


Note You need to log in before you can comment on or make changes to this bug.