Skip to content

Unclear instructions on how to add Java_Home to Linux startup script #69

Open
@jimothyclark

Description

@jimothyclark

I am VERY new to all of this, but I am humble enough to admit that I am a novice and I am coachable enough to learn from anyone! I have researched a couple best practices to avoid stepping on anyone's toes, but I am happy to learn ways my use of this site could improve.

I am learning Linux and I am trying to do configure Java_Home on my Linux. So far, I have barely done more than install a few virtual machines (CentOS 7 and two clones; CentOS7 Full DVD and CentOS 7 NetInstall).
My Jenkins course on stackskills.com referred me to GitHub with my questions and I'm having trouble with the following instructions on how to add Java_Home to my startup script:

Configure Java_Home on Linux:
Login to your account and open the startup script file which is usually ~/.bash_profile file (or can be .bashrc depending on your envrionment settings)
$ vi ~/.bash_profile

In the startup script, set JAVA_HOME and PATH

C shell:

setenv JAVA_HOME jdk-install-dir
setenv PATH $JAVA_HOME/bin:$PATH
export PATH=$JAVA_HOME/bin:$PATH
jdk-install-dir is the JDK installation director, which should be something similar to /usr/java/jdk1.5.0_07/bin/java

Bourne shell:

JAVA_HOME=jdk-install-dir
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
Korn and bash shells:

export JAVA_HOME=jdk-install-dir
export PATH=$JAVA_HOME/bin:$PATH
Type the following command to activate the new path settings immediately:

$ source ~/.bash_profile

Verify new settings:

$ echo $JAVA_HOME

$ echo $PATH

I'm not exactly sure how to use these instructions. Below is a screenshot of my VM and, from the formatting, it looks like I have the Bourne shell.

Please advise...

linux screenshot startup script help virtualbox_centos 7 netinstall_02_08_2018_13_44_28

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions