12:41 PM
2
A: How can I select a certain version of Java?

L. D. JamesUse this command: $ sudo update-alternatives --config java You'll get a result similar to: There are 3 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------...

 
I already tried that I chose for example 1 then installs but when I type java -version nothing chnage
 
@lyly Can you update your question with the text that you have in your image. I can't make out the exact response. If it were in text I could use Google's translator to better decipher the error response.
 
I followed the same guy you told me to install java 8 but still the old version remained
 
@lyly Try first selecting 0 and 2 and see if it changes. Make sure (which I understand that you're doing) that you use the elevated sudo prefix to your command.
 
I have already had my teacher has to prblm rrivé to change the version with a method that I forgot that she parcque chnage not and I do not remember how he blocked ss I do I have switched this version please help me james
 
12:41 PM
@lyly Try apt-get remove to remove the unwanted versions. During this might resolve also resolve the update-alternatives problem.
 
@james james please I Tappe sudo apt-get remove java6 me or what I want parcque java8 installed and before I have java 6
@james you are here
 
@lyly I'm trying to move this extended comment session to chat. Give me a moment to research.
@lyly In the meantime you can use apt-cache search to find the package names of the other java versions and use sudo apt-get remove them by name.
@lyly One type search to remove the version 6, try: apt-cache search java.*6.*oracle. Then remove the packages from the search result.
 
james sorry I insisted I just tried what you say but my m displays no command
 
update-java-alternatives should be used so that associated programs like javap are updated as well.
 
@lyly Can you type in the exact command you typed that gave you the no command error?
 
12:41 PM
thanx james youra are my best I succeeded
 
@lyly You're welcome. Consider placing a check mark with the answer since this helped.
 
you're the one who helped me merci james
 
@lyly Glad it worked.
 
a big thank you to your team
@james jet same problem Java 6 has been removed I have Tappe sudo update-alternatives --config java I board selected 1 to 8 java then when I type java -version No such file or dirctory
 
@lyly What is the output of the sudo update-alternatives --config java. Add the text to your question.
 
12:41 PM
sudo update-java-alternatives -l
java-7-oracle 1074 /user/lib/jvm/java-7-oracle
java-8-oracle 1075 /user/lib/jvm/java-8-oracle
 
@lyly What is the full output you get when you type in sudo update-alternatives --config java Paste the full output to a message.
 
a typed sudo update-java-alternatives -s java-7-oracle
 
@lyly I don't know if you're saying the alternative method is working. If you are still having problems, I'll need to see the output of the command I gave you. Are you still having problems?
 
sorry when I type sudo update-alternatives --config java there are two choices for the alternative java (which provides / user / bin / java) selction the way state priority 0 / user / lib / jvm / java-8-oracle / jre / bin / java 1075 automatic / User / lib / jvm / java-7-oracle / jre / bin / java 1074 manual / User / lib / jvm / java-8-oracle / jre / bin / java 10755 manual
 
@lyly Ok. So the next step is to install the version that you want to run. I'll add the command for the installation to my answer. Give me a couple minutes to format it easy to read.
@lyly Which version of Ubuntu are you running? 16.04?
 
12:41 PM
@james no 14.04
 
@lyly Look at the last 4 lines of my answer.
 
@james I do not see anything
@james you are her
 
@lyly Are you looking at the answer just below your question? You'll see my avatar which is a yellow and read box.
 
@jmaes I installed java java 8 and 7 my problem I can not get the sélctionné you understand me
 
@lyly The same way I edited my answer. Will you edit your question? Run this command: sudo update-alternatives --config java Copy and paste what you get in the terminal screen to your question. So that I can see the exact output. This is similar to the original picture that you posted. Paste it to your question.
 
12:41 PM
when I type sudo update-alternatives --config java there are two choices for the alternative java (which provides / user / bin / java) selction the way state priority 0 / user / lib / jvm / java-8-oracle / jre / bin / java 1075 automatic / User / lib / jvm / java-7-oracle / jre / bin / java 1074 manual / User / lib / jvm / java-8-oracle / jre / bin / java 10755 manual
when I type sudo update-alternatives --config java there are two choices for the alternative java (which provides / user / bin / java) selction the way state priority 0 / user / lib / jvm / java-8-oracle / jre / bin / java 1075 automatic / User / lib / jvm / java-7-oracle / jre / bin / java 1074 manual / User / lib / jvm / java-8-oracle / jre / bin / java 10755 manual
 
I can't make out the text in the comment. This what you just pasted here, click on edit to where you typed your original question. Paste it there. It'll make it easy for me to read and see what teh problem is. I believe it'll take just minutes after I can see this text in your question.
@lyly If you can't copy and paste the text. Paste another image and I'll see what is happening from there.
@lyly I will be able to see from the text which java is selected, or I will be able to understand what error is happening if I can see the exact text that comes on your screen when you type in the command.
 
@james I modified you can see the
 
@lyly What you put there is something that you typed. Look at what is in my answer how the output looks. Did you use the copy and paste command so that you could have the output exactly the way it was on your screen? What I'm looking at won't work.
@lyly Also, I believe there is a problem with your Java installation. I was hoping to look at the exact output to help identify the problem. But if you would remove versions 7 and 8, then use the command I gave you in the answer (as well as in the link I provided), I'm sure the problem would be resolved. I would hope to see the exact output so that I can see where the * is on the your screen.
 
@james thanx for helping me I abandon I unable
 
@lyly No problem.
 
12:41 PM
@james I have posted another question with the same problem you may please see
 
@I would recommend that you not post a duplicate question with the same problem. That is strictly against the rules. There already are two answers to your question here. You have to be patient and sometimes wait a day or so for the best answer.
 
@JAMES VOUS AVEZ VU MA PUBLICATION
 
@lyly Yes. I didn't down-vote your question, but I knew it would be down-voted because as I mentioned, duplicating questions is strictly against the rules. I adding formatting to my answer that might make it easier for you to follow. I added clarification to make it ease for others having a similar problem. I believe there was something wrong with your original installation.
 
@james hello you are here I found no answer for my publication please help me
 
@lyly Did you remove all the java versions as indicated in the answer?
 
12:41 PM
@james not because I know which version is supported scala I want to try java7 with scala 2.11.6 if it works I will not use java 8 below for that I want kept the two versions
 
@lyly You are having problems with what you have installed. After you remove the ones that are not working, you can install them again one by one and have all the versions you want, version 7, version 8. Once you perform the installation, each one will work perfectly and be selectible.
 
@james I will remove all the install again and I that's the solution there's no other solution
 
@lyly After they are removed, use the steps in the Answer to install version 7 (the one you want to use) first.
 
1:10 PM
oky
@james Copy the path from your preferred installation and then open /etc/environment using nano or your favorite text editor.

sudo nano /etc/environment
At the end of this file, add the following line, making sure to replace the highlighted path with your own copied path.

/etc/environment
JAVA_HOME="/usr/lib/jvm/java-8-oracle"
Save and exit the file, and reload it.

source /etc/environment
You can now test whether the environment variable has been set by executing the following command:

echo $JAVA_HOME
@james I think there is another solution but I can not get the look me it tries please
 
@lyly It seems like you're doing something different than just removing java7 and java8. You may cause other problems if you do something different from the two steps I provided.
 
oky
 
What is the output you get when you type in this command:
apt-cache search "^oracle.*java"
If you will give me the output of that, I will give you the two commands to remove 7 and 8.
 
1:41 PM
james I removed and download java 7 but when I type java -version
m it appears that java 6 link was deleted
 
When you say download Java 7, it appears that you're doing something different from what is in the answer. This is the problem. If you will remove the java versions that you have on your system with the steps I provide, I'll also give you the very simple steps to install the versions you want on your system.
Can you give me the output of this command?
apt-cache search "^oracle.*java"
This can all be done in about 6 steps. The first steps is the output of this command:
apt-cache search "^oracle.*java"
 
/user/lib/jvm/java6-oracle/jre//bin/java: no such file dirctory
 
What did you type in when you got that error message?
 
java -version
 
Will type in this command and give me the output:
apt-cache search "^oracle.*java"
 
1:50 PM
libdb-je-java -oracle berkley database java edition
 
Okay... that's our first problem. Now I'm going to give you the commands from the answer, one by one. It's very important that you type in the commands provided:
 
james it also shows me java 9 and installed as me I have not installed
 
Now you're saying you got something different from what you said before?
It's important that you give me the complete output of this command:
 
jaùes not sorry I typed comments came before finished typed
 
After you type it in use copy and then past the output put this chat.
 
1:55 PM
ok
 
Don't type the output. Copy and paste the output so that I can see the exact output.
apt-cache search "^oracle.*java"
 
tell me how I can copy any of ubuntu has windo
 
Put the cursor over the text and drag it so that you select the text. Right click, then click copy. Then right click on the chat box and paste it here.
 
moi je travaille sur VM
 
Ok... type in these commands and let me know when you have:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
 
 
2 hours later…
3:38 PM
james you are hers i m sorry i have prblm conx
james
 
@lyly For your information, you can use @L. D. James to get a message to me by typing in this chat. If I hadn't been at the screen I would not have gotten this message. That also goes for other users. Hit the @ and their user name will give them a notice when they get a message.
@lyly When you get a chance please answer the last question... the two commands, or advise if you are having problems with them.
 
@james I give you the results when I type apt-cache "
 
@lyly "@james" doesn't work. Try "@L. D. James" That will give me a notice when you have typed something to me. It doesn't matter when I'm looking at the screen. But if I don't see the screen, I'll get a notice if you use "@L. D. James"
When you type "@L" The system will show you the other letters and you can click on my userID.
 
@L. D. James oky
 
@lyly When you get a chance if can you type in this command and let me know that you have done it:
sudo add-apt-repository ppa:webupd8team/java
 
3:54 PM
apt-cache search "^oracle.*java."
@L.D.James libdb-je-java - Oracle Berkeley Database Java Edition
oracle-jdk7-installer - Oracle JDK7 Installer meta package
oracle-java7-installer - Oracle Java(TM) Development Kit (JDK) 7
oracle-java6-installer - Oracle Java(TM) Development Kit (JDK) 6
oracle-java8-installer - Oracle Java(TM) Development Kit (JDK) 8
oracle-java7-set-default - Set Oracle JDK 7 as default Java
oracle-java6-set-default - Set Oracle JDK 6 as default Java
oracle-java8-set-default - Set Oracle JDK 8 as default Java
oracle-java7-unlimited-jce-policy - Unlimited JCE Policy for Oracle Java 7
 
@lyly By the way, I made a mistake and placed spaces in my userID. When you get a chance can you test it without the spaces: "@L.D.James" I didn't get the notice.
@lyly I got that notice. Now if I'm not looking at the screen or if it's not up, I'll get a notice.
That wasn't the command I just gave you, but that helps.
 
@L.D.James yes i know
 
Will you execute this command and give me the output when you get a chance:
sudo update-alternatives --config java
 
you asked her tt me now I do not look here is telling me I have to do
 
Are you able to copy and paste the text from your screen?
 
3:59 PM
yes
 
Will you type in this command and copy and paste the output here:
sudo update-alternatives --config java
 
There is one alternative choice for java (which provides / usr / bin / java).

Priority selection Way State
-------------------------------------------------- ----------
0 / usr / lib / jvm / java-7-oracle / jre / bin / java 1074 automatic
* 1 / usr / lib / jvm / java-7-oracle / jre / bin / java 1074 manual

Press <Enter> to keep the default [*], or type selection number
@L.D.James so
 
Thanks for the output. Now type in this command and tell me when you have done it:
oracle-jdk-installer
sudo apt-get install oracle-jdk8-installer
 
is to install I have already installed me james
 
I understand what you are saying. You have a faulty installation. I'm giving you the steps to resolve the problem that you are having. I mentioned yesterday, about 6 commands and your issues will be resolved.
 
4:08 PM
oky
command not found oracle-jdk-installer
 
please run:
oracle-jdk8-installer
sudo apt-get install oracle-jdk8-installer
This is the command:
Continue the prompt with the installation.
 
oracle-jdk8-installer command not found
 
This is the command:
sudo apt-get install oracle-jdk7-installer
 
command not found
meme chose
 
Can you copy the text that include the command you typed and the response from the computer?
 
4:18 PM
These good I made a mistake
sorry james
 
Will you try to use the following command and select java7. Give me the output:
sudo update-alternatives --config java
 
Reading package lists ... Done
Shaft Construction dependencies
Reading state information ... Done
The following NEW packages will be installed:
oracle-jdk7-install
0 upgraded, 1 newly installed, 0 to remove and 703 not upgraded.
It is necessary to 4306 o the archives.
After this operation 28.7 kB of additional disk space will be used.
Reception: 1 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty / main oracle-jdk7-install all 7u80 + 7u60arm-0 ~ WebUpd8 ~ 1 [4306 B]
4306 o approved in 1s (3468 o / s)
 
Do you see my last question just above where you just texted?
I'm asking you to give me the output of running this command and choosing java7:
sudo update-alternatives --config java
 
yay c installed java 7
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) Client VM (build 24.80-b11, mixed mode)
 
Is it working now?
 
4:26 PM
yes
I'll see if this version of java support scala2.11.6
 
Can you place a check mark on my answer at: askubuntu.com/questions/819366/…
This way the community will see a working resolution.
You'll also receive credit for contributing back to the community.
 
of course thank you james you are my best
 
My pleasure.
 
I find or put is that you asked me
james
 
There is a check mark at my answer. When you click on it, it'll turn green. It is below the symbol "V".
Do you see the check mark?
 
4:41 PM
non
 
Give me a second. I'll take a picture of it.
 
I do not find your answer
oky
 
This is my answer:
3
A: How can I select a certain version of Java?

L. D. JamesUse this command: $ sudo update-alternatives --config java You'll get a result similar to: There are 3 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------...

Click on the bold words "How can I select a certain version of Java?". It'll take you to the answer. You'll see a check grey check mark on the left. When you click it it'll turn green.
Do you see it now?
 
I do not find this layer james takes a photo for me
 
Did you click on the link where my answer is? The link is this: My Answer
I'll send you a picture of what the check mark looks link. But if you click on the link, you'll see my answer.
 
4:53 PM
I'm in the page or is the issue I do not know what the
james I found your answer I have to do now
 
Do you see the check mark?
It looks like this:
 
nn
 
The bottom one is the way the check mark looks when it's not clicked. The top one is the way it looks when it's clicked.
my answer is here:
If you click my answer you will see the check mark on the left.
Now do you see the grey check mark?
 
ouiiii she became the green will I have to do after
 
I see you found it. Giving back to the community took you from Reputation 20 to 22.
 
5:05 PM
I did not understand
 
No problem. I was new at one time. I'm glad it working and it was a pleasure helping.
 
not I want to do something for you james tell me I should do please
james
explains me
 
You already have. Enjoy Ubuntu!
 
non
I just asked questions to move forward in my project is c
please explains
james tu es la
 
@lyly hey, can you also accept answers on your other questions if they have helped you?
 
5:16 PM
I had a problem that is resolved the thank you
@L.D.James ,,
 
@lyly If you provide a link to a question that you have asked that you are having problems with I'll look at it and try to assist in that question. We can close this chat as having this issue resolved. This way it'll be easier for others to see the full resolution and details of the fix.
 
if I ask a question you can view and helped me
thanx james
 
Please a link to the question. I'll answer in the question so that others can benefit and contribute.
 
 
1 hour later…
6:44 PM
Since the question has been resolved, I am going to freeze this room.
 
jokerdino has frozen this room.