“-bash: javac: command not found” error after installing OpenJDK 1.7
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have CentOS 6.7. I have installed Java 1.8. When I do Java -version I see the following output.
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
I need javac so I came to know that this is available only if I install JDK. So I installed JDK by executing the following command
yum install java-1.7.0-openjdk-devel
The installation was successful. But now when I again execute the command java -version, I see the old result. If I try to execute javac at the command prompt I see the error '-bash: javac: command not found'. I observed that OpenJDK was installed to the directory /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/bin. So, I set it to JAVA_HOME, but I still cannot execute javac command. What am I doing wrong here?
centos software-installation java
add a comment |
I have CentOS 6.7. I have installed Java 1.8. When I do Java -version I see the following output.
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
I need javac so I came to know that this is available only if I install JDK. So I installed JDK by executing the following command
yum install java-1.7.0-openjdk-devel
The installation was successful. But now when I again execute the command java -version, I see the old result. If I try to execute javac at the command prompt I see the error '-bash: javac: command not found'. I observed that OpenJDK was installed to the directory /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/bin. So, I set it to JAVA_HOME, but I still cannot execute javac command. What am I doing wrong here?
centos software-installation java
Although settingJAVA_HOME
is necessary for running Java, executables are still searched in$PATH
, not in$JAVA_HOME/bin
.
– Satō Katsura
Apr 4 '17 at 10:36
I set the directory in the PATH variable, but I am getting the same error.
– KurioZ7
Apr 4 '17 at 10:40
add a comment |
I have CentOS 6.7. I have installed Java 1.8. When I do Java -version I see the following output.
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
I need javac so I came to know that this is available only if I install JDK. So I installed JDK by executing the following command
yum install java-1.7.0-openjdk-devel
The installation was successful. But now when I again execute the command java -version, I see the old result. If I try to execute javac at the command prompt I see the error '-bash: javac: command not found'. I observed that OpenJDK was installed to the directory /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/bin. So, I set it to JAVA_HOME, but I still cannot execute javac command. What am I doing wrong here?
centos software-installation java
I have CentOS 6.7. I have installed Java 1.8. When I do Java -version I see the following output.
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
I need javac so I came to know that this is available only if I install JDK. So I installed JDK by executing the following command
yum install java-1.7.0-openjdk-devel
The installation was successful. But now when I again execute the command java -version, I see the old result. If I try to execute javac at the command prompt I see the error '-bash: javac: command not found'. I observed that OpenJDK was installed to the directory /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/bin. So, I set it to JAVA_HOME, but I still cannot execute javac command. What am I doing wrong here?
centos software-installation java
centos software-installation java
edited Apr 4 '17 at 10:18
Jeff Schaller♦
44.7k1162145
44.7k1162145
asked Apr 4 '17 at 9:47
KurioZ7KurioZ7
2585817
2585817
Although settingJAVA_HOME
is necessary for running Java, executables are still searched in$PATH
, not in$JAVA_HOME/bin
.
– Satō Katsura
Apr 4 '17 at 10:36
I set the directory in the PATH variable, but I am getting the same error.
– KurioZ7
Apr 4 '17 at 10:40
add a comment |
Although settingJAVA_HOME
is necessary for running Java, executables are still searched in$PATH
, not in$JAVA_HOME/bin
.
– Satō Katsura
Apr 4 '17 at 10:36
I set the directory in the PATH variable, but I am getting the same error.
– KurioZ7
Apr 4 '17 at 10:40
Although setting
JAVA_HOME
is necessary for running Java, executables are still searched in $PATH
, not in $JAVA_HOME/bin
.– Satō Katsura
Apr 4 '17 at 10:36
Although setting
JAVA_HOME
is necessary for running Java, executables are still searched in $PATH
, not in $JAVA_HOME/bin
.– Satō Katsura
Apr 4 '17 at 10:36
I set the directory in the PATH variable, but I am getting the same error.
– KurioZ7
Apr 4 '17 at 10:40
I set the directory in the PATH variable, but I am getting the same error.
– KurioZ7
Apr 4 '17 at 10:40
add a comment |
1 Answer
1
active
oldest
votes
I have fixed this issue by executing the following command. I was not setting the PATH variable properly. I executed the following two commands and my problem was fixed.
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64
export PATH=$JAVA_HOME/bin:$PATH
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f355817%2fbash-javac-command-not-found-error-after-installing-openjdk-1-7%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have fixed this issue by executing the following command. I was not setting the PATH variable properly. I executed the following two commands and my problem was fixed.
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64
export PATH=$JAVA_HOME/bin:$PATH
add a comment |
I have fixed this issue by executing the following command. I was not setting the PATH variable properly. I executed the following two commands and my problem was fixed.
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64
export PATH=$JAVA_HOME/bin:$PATH
add a comment |
I have fixed this issue by executing the following command. I was not setting the PATH variable properly. I executed the following two commands and my problem was fixed.
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64
export PATH=$JAVA_HOME/bin:$PATH
I have fixed this issue by executing the following command. I was not setting the PATH variable properly. I executed the following two commands and my problem was fixed.
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64
export PATH=$JAVA_HOME/bin:$PATH
edited Mar 8 at 17:40
Romeo Ninov
6,93432129
6,93432129
answered Apr 4 '17 at 11:12
KurioZ7KurioZ7
2585817
2585817
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f355817%2fbash-javac-command-not-found-error-after-installing-openjdk-1-7%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Although setting
JAVA_HOME
is necessary for running Java, executables are still searched in$PATH
, not in$JAVA_HOME/bin
.– Satō Katsura
Apr 4 '17 at 10:36
I set the directory in the PATH variable, but I am getting the same error.
– KurioZ7
Apr 4 '17 at 10:40