Ubuntu: JAVA_HOME is not defined correctly
I am trying to install some software (Shibboleth) in Ubuntu 14.04. I already have Java 7 OpenJDK installed in /usr/lib/jvm/
, and I have these lines in /usr/environment
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
export JAVA_HOME
If I type echo $JAVA_HOME
I correctly get /usr/lib/jvm/java-7-openjdk-amd64
.
However, when I try to install Shibboleth I always get Error: JAVA_HOME is not defined correctly. Cannot execute java
.
Interestingly, if I type java
command it works (it refers to /usr/lib/java which is a link to the right one). However, when I try to run bash bin/install.sh
of Shibboleth, I get the JAVA_HOME error
I already tried setting JAVA_HOME
to the jre
folder with same result. Any ideas?
java ubuntu openjdk java-home
add a comment |
I am trying to install some software (Shibboleth) in Ubuntu 14.04. I already have Java 7 OpenJDK installed in /usr/lib/jvm/
, and I have these lines in /usr/environment
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
export JAVA_HOME
If I type echo $JAVA_HOME
I correctly get /usr/lib/jvm/java-7-openjdk-amd64
.
However, when I try to install Shibboleth I always get Error: JAVA_HOME is not defined correctly. Cannot execute java
.
Interestingly, if I type java
command it works (it refers to /usr/lib/java which is a link to the right one). However, when I try to run bash bin/install.sh
of Shibboleth, I get the JAVA_HOME error
I already tried setting JAVA_HOME
to the jre
folder with same result. Any ideas?
java ubuntu openjdk java-home
First install necessary packagesapt-get install openjdk-7-jre-headless
apt-get install tomcat7
and see.
– Madura Harshana
Jan 23 '16 at 17:59
I already have both of them installed
– Arturo
Jan 23 '16 at 18:11
add a comment |
I am trying to install some software (Shibboleth) in Ubuntu 14.04. I already have Java 7 OpenJDK installed in /usr/lib/jvm/
, and I have these lines in /usr/environment
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
export JAVA_HOME
If I type echo $JAVA_HOME
I correctly get /usr/lib/jvm/java-7-openjdk-amd64
.
However, when I try to install Shibboleth I always get Error: JAVA_HOME is not defined correctly. Cannot execute java
.
Interestingly, if I type java
command it works (it refers to /usr/lib/java which is a link to the right one). However, when I try to run bash bin/install.sh
of Shibboleth, I get the JAVA_HOME error
I already tried setting JAVA_HOME
to the jre
folder with same result. Any ideas?
java ubuntu openjdk java-home
I am trying to install some software (Shibboleth) in Ubuntu 14.04. I already have Java 7 OpenJDK installed in /usr/lib/jvm/
, and I have these lines in /usr/environment
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
export JAVA_HOME
If I type echo $JAVA_HOME
I correctly get /usr/lib/jvm/java-7-openjdk-amd64
.
However, when I try to install Shibboleth I always get Error: JAVA_HOME is not defined correctly. Cannot execute java
.
Interestingly, if I type java
command it works (it refers to /usr/lib/java which is a link to the right one). However, when I try to run bash bin/install.sh
of Shibboleth, I get the JAVA_HOME error
I already tried setting JAVA_HOME
to the jre
folder with same result. Any ideas?
java ubuntu openjdk java-home
java ubuntu openjdk java-home
edited Jan 23 '16 at 18:55
Arturo
asked Jan 23 '16 at 17:40
ArturoArturo
1,8731155108
1,8731155108
First install necessary packagesapt-get install openjdk-7-jre-headless
apt-get install tomcat7
and see.
– Madura Harshana
Jan 23 '16 at 17:59
I already have both of them installed
– Arturo
Jan 23 '16 at 18:11
add a comment |
First install necessary packagesapt-get install openjdk-7-jre-headless
apt-get install tomcat7
and see.
– Madura Harshana
Jan 23 '16 at 17:59
I already have both of them installed
– Arturo
Jan 23 '16 at 18:11
First install necessary packages
apt-get install openjdk-7-jre-headless
apt-get install tomcat7
and see.– Madura Harshana
Jan 23 '16 at 17:59
First install necessary packages
apt-get install openjdk-7-jre-headless
apt-get install tomcat7
and see.– Madura Harshana
Jan 23 '16 at 17:59
I already have both of them installed
– Arturo
Jan 23 '16 at 18:11
I already have both of them installed
– Arturo
Jan 23 '16 at 18:11
add a comment |
4 Answers
4
active
oldest
votes
Add both JAVA_HOME
& PATH
to your ~/.profile
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
And, add following to your /etc/profile.d/java.sh
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JAVA_HOME
PATH=${JAVA_HOME}/bin:${PATH}
export PATH
JRE_HOME=/usr/lib/jvm/jre
export JRE_HOME
JAVA_OPTS="-XX:+AggressiveOpts -Xms256m -Xmx512m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
export JAVA_OPTS
For more info, Refer Documentation
Hope it helps.
I tried this but same error. Interestingly, if I type "java" command it works. However, when I try to run "bash bin/install.sh" of Shibboleth, I get the JAVA_HOME error.
– Arturo
Jan 23 '16 at 18:05
1
Updated my answer, hope it helps now
– Let'sRefactor
Jan 23 '16 at 18:15
Still same error. Is it OK that all these variables are defined without quotes? I didn't even had a .bash_profile or /etc/profile.d/java.sh files
– Arturo
Jan 23 '16 at 18:46
Ubuntu use~/.profile
instead of~/.bash_profile
, updated my answer
– Let'sRefactor
Jan 23 '16 at 18:50
/etc/profile.d/java.sh
you need to create one, use cat.
– Let'sRefactor
Jan 23 '16 at 18:54
|
show 1 more comment
you should set the path to bin folder where java, javac files are found.
In your case it might be /usr/lib/jvm/java-7-openjdk-amd64/bin
Already tried, same result. Please, note that I can run the command "java" properly. The error is displayed when I try to run bin/install.sh on Shibboleth.
– Arturo
Jan 23 '16 at 18:12
add a comment |
According to Your editor.
sudo vim /etc/profile
add these 2 lines at the end of the file
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH=JAVA_HOME/bin:$PATH
Then
source /etc/profile
Check
mvn -version
add a comment |
I issue is that the install.sh script which you are running has the java path wrong.
Edit the file using
sudo nano idp-install.sh
and change the line which corresponds to java path and add the correct java path. This will solve your problem.
P.S. This solution is specific to the java path for Shibboleth installation.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fstackoverflow.com%2fquestions%2f34966648%2fubuntu-java-home-is-not-defined-correctly%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add both JAVA_HOME
& PATH
to your ~/.profile
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
And, add following to your /etc/profile.d/java.sh
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JAVA_HOME
PATH=${JAVA_HOME}/bin:${PATH}
export PATH
JRE_HOME=/usr/lib/jvm/jre
export JRE_HOME
JAVA_OPTS="-XX:+AggressiveOpts -Xms256m -Xmx512m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
export JAVA_OPTS
For more info, Refer Documentation
Hope it helps.
I tried this but same error. Interestingly, if I type "java" command it works. However, when I try to run "bash bin/install.sh" of Shibboleth, I get the JAVA_HOME error.
– Arturo
Jan 23 '16 at 18:05
1
Updated my answer, hope it helps now
– Let'sRefactor
Jan 23 '16 at 18:15
Still same error. Is it OK that all these variables are defined without quotes? I didn't even had a .bash_profile or /etc/profile.d/java.sh files
– Arturo
Jan 23 '16 at 18:46
Ubuntu use~/.profile
instead of~/.bash_profile
, updated my answer
– Let'sRefactor
Jan 23 '16 at 18:50
/etc/profile.d/java.sh
you need to create one, use cat.
– Let'sRefactor
Jan 23 '16 at 18:54
|
show 1 more comment
Add both JAVA_HOME
& PATH
to your ~/.profile
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
And, add following to your /etc/profile.d/java.sh
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JAVA_HOME
PATH=${JAVA_HOME}/bin:${PATH}
export PATH
JRE_HOME=/usr/lib/jvm/jre
export JRE_HOME
JAVA_OPTS="-XX:+AggressiveOpts -Xms256m -Xmx512m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
export JAVA_OPTS
For more info, Refer Documentation
Hope it helps.
I tried this but same error. Interestingly, if I type "java" command it works. However, when I try to run "bash bin/install.sh" of Shibboleth, I get the JAVA_HOME error.
– Arturo
Jan 23 '16 at 18:05
1
Updated my answer, hope it helps now
– Let'sRefactor
Jan 23 '16 at 18:15
Still same error. Is it OK that all these variables are defined without quotes? I didn't even had a .bash_profile or /etc/profile.d/java.sh files
– Arturo
Jan 23 '16 at 18:46
Ubuntu use~/.profile
instead of~/.bash_profile
, updated my answer
– Let'sRefactor
Jan 23 '16 at 18:50
/etc/profile.d/java.sh
you need to create one, use cat.
– Let'sRefactor
Jan 23 '16 at 18:54
|
show 1 more comment
Add both JAVA_HOME
& PATH
to your ~/.profile
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
And, add following to your /etc/profile.d/java.sh
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JAVA_HOME
PATH=${JAVA_HOME}/bin:${PATH}
export PATH
JRE_HOME=/usr/lib/jvm/jre
export JRE_HOME
JAVA_OPTS="-XX:+AggressiveOpts -Xms256m -Xmx512m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
export JAVA_OPTS
For more info, Refer Documentation
Hope it helps.
Add both JAVA_HOME
& PATH
to your ~/.profile
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
And, add following to your /etc/profile.d/java.sh
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JAVA_HOME
PATH=${JAVA_HOME}/bin:${PATH}
export PATH
JRE_HOME=/usr/lib/jvm/jre
export JRE_HOME
JAVA_OPTS="-XX:+AggressiveOpts -Xms256m -Xmx512m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
export JAVA_OPTS
For more info, Refer Documentation
Hope it helps.
edited Jan 23 '16 at 18:50
answered Jan 23 '16 at 17:56
Let'sRefactorLet'sRefactor
2,58641735
2,58641735
I tried this but same error. Interestingly, if I type "java" command it works. However, when I try to run "bash bin/install.sh" of Shibboleth, I get the JAVA_HOME error.
– Arturo
Jan 23 '16 at 18:05
1
Updated my answer, hope it helps now
– Let'sRefactor
Jan 23 '16 at 18:15
Still same error. Is it OK that all these variables are defined without quotes? I didn't even had a .bash_profile or /etc/profile.d/java.sh files
– Arturo
Jan 23 '16 at 18:46
Ubuntu use~/.profile
instead of~/.bash_profile
, updated my answer
– Let'sRefactor
Jan 23 '16 at 18:50
/etc/profile.d/java.sh
you need to create one, use cat.
– Let'sRefactor
Jan 23 '16 at 18:54
|
show 1 more comment
I tried this but same error. Interestingly, if I type "java" command it works. However, when I try to run "bash bin/install.sh" of Shibboleth, I get the JAVA_HOME error.
– Arturo
Jan 23 '16 at 18:05
1
Updated my answer, hope it helps now
– Let'sRefactor
Jan 23 '16 at 18:15
Still same error. Is it OK that all these variables are defined without quotes? I didn't even had a .bash_profile or /etc/profile.d/java.sh files
– Arturo
Jan 23 '16 at 18:46
Ubuntu use~/.profile
instead of~/.bash_profile
, updated my answer
– Let'sRefactor
Jan 23 '16 at 18:50
/etc/profile.d/java.sh
you need to create one, use cat.
– Let'sRefactor
Jan 23 '16 at 18:54
I tried this but same error. Interestingly, if I type "java" command it works. However, when I try to run "bash bin/install.sh" of Shibboleth, I get the JAVA_HOME error.
– Arturo
Jan 23 '16 at 18:05
I tried this but same error. Interestingly, if I type "java" command it works. However, when I try to run "bash bin/install.sh" of Shibboleth, I get the JAVA_HOME error.
– Arturo
Jan 23 '16 at 18:05
1
1
Updated my answer, hope it helps now
– Let'sRefactor
Jan 23 '16 at 18:15
Updated my answer, hope it helps now
– Let'sRefactor
Jan 23 '16 at 18:15
Still same error. Is it OK that all these variables are defined without quotes? I didn't even had a .bash_profile or /etc/profile.d/java.sh files
– Arturo
Jan 23 '16 at 18:46
Still same error. Is it OK that all these variables are defined without quotes? I didn't even had a .bash_profile or /etc/profile.d/java.sh files
– Arturo
Jan 23 '16 at 18:46
Ubuntu use
~/.profile
instead of ~/.bash_profile
, updated my answer– Let'sRefactor
Jan 23 '16 at 18:50
Ubuntu use
~/.profile
instead of ~/.bash_profile
, updated my answer– Let'sRefactor
Jan 23 '16 at 18:50
/etc/profile.d/java.sh
you need to create one, use cat.– Let'sRefactor
Jan 23 '16 at 18:54
/etc/profile.d/java.sh
you need to create one, use cat.– Let'sRefactor
Jan 23 '16 at 18:54
|
show 1 more comment
you should set the path to bin folder where java, javac files are found.
In your case it might be /usr/lib/jvm/java-7-openjdk-amd64/bin
Already tried, same result. Please, note that I can run the command "java" properly. The error is displayed when I try to run bin/install.sh on Shibboleth.
– Arturo
Jan 23 '16 at 18:12
add a comment |
you should set the path to bin folder where java, javac files are found.
In your case it might be /usr/lib/jvm/java-7-openjdk-amd64/bin
Already tried, same result. Please, note that I can run the command "java" properly. The error is displayed when I try to run bin/install.sh on Shibboleth.
– Arturo
Jan 23 '16 at 18:12
add a comment |
you should set the path to bin folder where java, javac files are found.
In your case it might be /usr/lib/jvm/java-7-openjdk-amd64/bin
you should set the path to bin folder where java, javac files are found.
In your case it might be /usr/lib/jvm/java-7-openjdk-amd64/bin
answered Jan 23 '16 at 17:48
Bharath TejaBharath Teja
11
11
Already tried, same result. Please, note that I can run the command "java" properly. The error is displayed when I try to run bin/install.sh on Shibboleth.
– Arturo
Jan 23 '16 at 18:12
add a comment |
Already tried, same result. Please, note that I can run the command "java" properly. The error is displayed when I try to run bin/install.sh on Shibboleth.
– Arturo
Jan 23 '16 at 18:12
Already tried, same result. Please, note that I can run the command "java" properly. The error is displayed when I try to run bin/install.sh on Shibboleth.
– Arturo
Jan 23 '16 at 18:12
Already tried, same result. Please, note that I can run the command "java" properly. The error is displayed when I try to run bin/install.sh on Shibboleth.
– Arturo
Jan 23 '16 at 18:12
add a comment |
According to Your editor.
sudo vim /etc/profile
add these 2 lines at the end of the file
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH=JAVA_HOME/bin:$PATH
Then
source /etc/profile
Check
mvn -version
add a comment |
According to Your editor.
sudo vim /etc/profile
add these 2 lines at the end of the file
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH=JAVA_HOME/bin:$PATH
Then
source /etc/profile
Check
mvn -version
add a comment |
According to Your editor.
sudo vim /etc/profile
add these 2 lines at the end of the file
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH=JAVA_HOME/bin:$PATH
Then
source /etc/profile
Check
mvn -version
According to Your editor.
sudo vim /etc/profile
add these 2 lines at the end of the file
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH=JAVA_HOME/bin:$PATH
Then
source /etc/profile
Check
mvn -version
edited Oct 5 '18 at 7:48
dkb
1,17811424
1,17811424
answered Oct 5 '18 at 7:15
Shubham Shubham
11
11
add a comment |
add a comment |
I issue is that the install.sh script which you are running has the java path wrong.
Edit the file using
sudo nano idp-install.sh
and change the line which corresponds to java path and add the correct java path. This will solve your problem.
P.S. This solution is specific to the java path for Shibboleth installation.
add a comment |
I issue is that the install.sh script which you are running has the java path wrong.
Edit the file using
sudo nano idp-install.sh
and change the line which corresponds to java path and add the correct java path. This will solve your problem.
P.S. This solution is specific to the java path for Shibboleth installation.
add a comment |
I issue is that the install.sh script which you are running has the java path wrong.
Edit the file using
sudo nano idp-install.sh
and change the line which corresponds to java path and add the correct java path. This will solve your problem.
P.S. This solution is specific to the java path for Shibboleth installation.
I issue is that the install.sh script which you are running has the java path wrong.
Edit the file using
sudo nano idp-install.sh
and change the line which corresponds to java path and add the correct java path. This will solve your problem.
P.S. This solution is specific to the java path for Shibboleth installation.
answered Nov 20 '18 at 13:41
MashmoomMashmoom
415
415
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f34966648%2fubuntu-java-home-is-not-defined-correctly%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
First install necessary packages
apt-get install openjdk-7-jre-headless
apt-get install tomcat7
and see.– Madura Harshana
Jan 23 '16 at 17:59
I already have both of them installed
– Arturo
Jan 23 '16 at 18:11