How to change the configuration path to pick a different JAVA executable?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I have a *nix VM allocated me running CEL6.x version. The JVM pre-built in the image is 1.6 version (which is located under /usr/bin).



Now I need to have Eclipse in the VM. I have a Eclipse executable which needs JVM 1.8 or above.



Unfortunately, i dont have necessary permission to install any software on the VM.



Fortunately, discovered that in one of the mounted path /abc/bin, java-1.8.0_91 is present.



Now I need a way, when we execute java, the one present under /abc/bin (Java 1.8) should be picked rather than the default one present under /usr/bin (Java 1.6).



Any environmental variable i need to change to make this working? Say, JAVA_HOME or something like that.










share|improve this question





















  • "CEL6.x version" doesn't sound like Ubuntu
    – steeldriver
    Apr 9 at 19:30














up vote
0
down vote

favorite












I have a *nix VM allocated me running CEL6.x version. The JVM pre-built in the image is 1.6 version (which is located under /usr/bin).



Now I need to have Eclipse in the VM. I have a Eclipse executable which needs JVM 1.8 or above.



Unfortunately, i dont have necessary permission to install any software on the VM.



Fortunately, discovered that in one of the mounted path /abc/bin, java-1.8.0_91 is present.



Now I need a way, when we execute java, the one present under /abc/bin (Java 1.8) should be picked rather than the default one present under /usr/bin (Java 1.6).



Any environmental variable i need to change to make this working? Say, JAVA_HOME or something like that.










share|improve this question





















  • "CEL6.x version" doesn't sound like Ubuntu
    – steeldriver
    Apr 9 at 19:30












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a *nix VM allocated me running CEL6.x version. The JVM pre-built in the image is 1.6 version (which is located under /usr/bin).



Now I need to have Eclipse in the VM. I have a Eclipse executable which needs JVM 1.8 or above.



Unfortunately, i dont have necessary permission to install any software on the VM.



Fortunately, discovered that in one of the mounted path /abc/bin, java-1.8.0_91 is present.



Now I need a way, when we execute java, the one present under /abc/bin (Java 1.8) should be picked rather than the default one present under /usr/bin (Java 1.6).



Any environmental variable i need to change to make this working? Say, JAVA_HOME or something like that.










share|improve this question













I have a *nix VM allocated me running CEL6.x version. The JVM pre-built in the image is 1.6 version (which is located under /usr/bin).



Now I need to have Eclipse in the VM. I have a Eclipse executable which needs JVM 1.8 or above.



Unfortunately, i dont have necessary permission to install any software on the VM.



Fortunately, discovered that in one of the mounted path /abc/bin, java-1.8.0_91 is present.



Now I need a way, when we execute java, the one present under /abc/bin (Java 1.8) should be picked rather than the default one present under /usr/bin (Java 1.6).



Any environmental variable i need to change to make this working? Say, JAVA_HOME or something like that.







command-line java eclipse environment-variables






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 9 at 18:31









Darshan L

1




1











  • "CEL6.x version" doesn't sound like Ubuntu
    – steeldriver
    Apr 9 at 19:30
















  • "CEL6.x version" doesn't sound like Ubuntu
    – steeldriver
    Apr 9 at 19:30















"CEL6.x version" doesn't sound like Ubuntu
– steeldriver
Apr 9 at 19:30




"CEL6.x version" doesn't sound like Ubuntu
– steeldriver
Apr 9 at 19:30










1 Answer
1






active

oldest

votes

















up vote
0
down vote













The update-alternatives command will let you pick which version of Java to use:



user@host:~$ update-alternatives --config java


While it's generally not a good idea to change it manually (use the command above), you can observe that the actual java binary used when you type "java" is controlled by a series of symbolic links:



user@host:~$ which java
/usr/bin/java
user@host:~$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jan 3 09:03 /usr/bin/java -> /etc/alternatives/java
user@host:~$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Jan 3 09:03 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java





share|improve this answer




















  • This allows - for the <name> group and ask the user to select which one to use. When i try this it says, "update-alternatives: error: no alternatives for java" Since i dont have an alternate version made available. So how would i do that? I tried using --install and also --set option. But none of them helped in achieving what i needed.
    – Darshan L
    Apr 12 at 8:51










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
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',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1023420%2fhow-to-change-the-configuration-path-to-pick-a-different-java-executable%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













The update-alternatives command will let you pick which version of Java to use:



user@host:~$ update-alternatives --config java


While it's generally not a good idea to change it manually (use the command above), you can observe that the actual java binary used when you type "java" is controlled by a series of symbolic links:



user@host:~$ which java
/usr/bin/java
user@host:~$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jan 3 09:03 /usr/bin/java -> /etc/alternatives/java
user@host:~$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Jan 3 09:03 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java





share|improve this answer




















  • This allows - for the <name> group and ask the user to select which one to use. When i try this it says, "update-alternatives: error: no alternatives for java" Since i dont have an alternate version made available. So how would i do that? I tried using --install and also --set option. But none of them helped in achieving what i needed.
    – Darshan L
    Apr 12 at 8:51














up vote
0
down vote













The update-alternatives command will let you pick which version of Java to use:



user@host:~$ update-alternatives --config java


While it's generally not a good idea to change it manually (use the command above), you can observe that the actual java binary used when you type "java" is controlled by a series of symbolic links:



user@host:~$ which java
/usr/bin/java
user@host:~$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jan 3 09:03 /usr/bin/java -> /etc/alternatives/java
user@host:~$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Jan 3 09:03 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java





share|improve this answer




















  • This allows - for the <name> group and ask the user to select which one to use. When i try this it says, "update-alternatives: error: no alternatives for java" Since i dont have an alternate version made available. So how would i do that? I tried using --install and also --set option. But none of them helped in achieving what i needed.
    – Darshan L
    Apr 12 at 8:51












up vote
0
down vote










up vote
0
down vote









The update-alternatives command will let you pick which version of Java to use:



user@host:~$ update-alternatives --config java


While it's generally not a good idea to change it manually (use the command above), you can observe that the actual java binary used when you type "java" is controlled by a series of symbolic links:



user@host:~$ which java
/usr/bin/java
user@host:~$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jan 3 09:03 /usr/bin/java -> /etc/alternatives/java
user@host:~$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Jan 3 09:03 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java





share|improve this answer












The update-alternatives command will let you pick which version of Java to use:



user@host:~$ update-alternatives --config java


While it's generally not a good idea to change it manually (use the command above), you can observe that the actual java binary used when you type "java" is controlled by a series of symbolic links:



user@host:~$ which java
/usr/bin/java
user@host:~$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jan 3 09:03 /usr/bin/java -> /etc/alternatives/java
user@host:~$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Jan 3 09:03 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java






share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 9 at 23:34









Omegamormegil

1,074710




1,074710











  • This allows - for the <name> group and ask the user to select which one to use. When i try this it says, "update-alternatives: error: no alternatives for java" Since i dont have an alternate version made available. So how would i do that? I tried using --install and also --set option. But none of them helped in achieving what i needed.
    – Darshan L
    Apr 12 at 8:51
















  • This allows - for the <name> group and ask the user to select which one to use. When i try this it says, "update-alternatives: error: no alternatives for java" Since i dont have an alternate version made available. So how would i do that? I tried using --install and also --set option. But none of them helped in achieving what i needed.
    – Darshan L
    Apr 12 at 8:51















This allows - for the <name> group and ask the user to select which one to use. When i try this it says, "update-alternatives: error: no alternatives for java" Since i dont have an alternate version made available. So how would i do that? I tried using --install and also --set option. But none of them helped in achieving what i needed.
– Darshan L
Apr 12 at 8:51




This allows - for the <name> group and ask the user to select which one to use. When i try this it says, "update-alternatives: error: no alternatives for java" Since i dont have an alternate version made available. So how would i do that? I tried using --install and also --set option. But none of them helped in achieving what i needed.
– Darshan L
Apr 12 at 8:51

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1023420%2fhow-to-change-the-configuration-path-to-pick-a-different-java-executable%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491