How can I tell what version of Java I have installed?Are PPAs safe to add to my system and what are some “red flags” to watch out for?Are we affected by the JAVA vulnerability? Are all “applets” affected?how to find system parts version numbers?How to set default Java version?How can I remove an unfinished java installation installed via terminal?How to downgrade Oracle Java 7 to Java 6?What is the difference between the five versions of Java on this page for Ubuntu?Is there a way to keep Oracle's JRE/JDK as the default JRE/JDK?Cannot remove openjdk without having an older version installed, how can I do so?How to set Java 7 as default?Switch between multiple java versionsHow to remove OpenJDK-9 and all related file to JDKError installing Android SDK
UK Tourist Visa- Enquiry
Can other pieces capture a threatening piece and prevent a checkmate?
Norwegian Refugee travel document
How can an organ that provides biological immortality be unable to regenerate?
When did hardware antialiasing start being available?
Single word to change groups
Nested Dynamic SOQL Query
How much propellant is used up until liftoff?
Is VPN a layer 3 concept?
Turning a hard to access nut?
What (if any) is the reason to buy in small local stores?
Should I be concerned about student access to a test bank?
10 year ban after applying for a UK student visa
TDE Master Key Rotation
PTIJ: Which Dr. Seuss books should one obtain?
Why didn't Héctor fade away after this character died in the movie Coco?
CLI: Get information Ubuntu releases
The English Debate
If I cast the Enlarge/Reduce spell on an arrow, what weapon could it count as?
Would storms on an ocean world harm the marine life?
How to test the sharpness of a knife?
How to remove space in section title at KOMA-Script
Extraneous elements in "Europe countries" list
Why is participating in the European Parliamentary elections used as a threat?
How can I tell what version of Java I have installed?
Are PPAs safe to add to my system and what are some “red flags” to watch out for?Are we affected by the JAVA vulnerability? Are all “applets” affected?how to find system parts version numbers?How to set default Java version?How can I remove an unfinished java installation installed via terminal?How to downgrade Oracle Java 7 to Java 6?What is the difference between the five versions of Java on this page for Ubuntu?Is there a way to keep Oracle's JRE/JDK as the default JRE/JDK?Cannot remove openjdk without having an older version installed, how can I do so?How to set Java 7 as default?Switch between multiple java versionsHow to remove OpenJDK-9 and all related file to JDKError installing Android SDK
I want to start toying around with java (eventually getting to the point where I can write basic little programs for android or web), but I've managed to have java messed up on my computer (from past experiments).
I'm not sure which version of java I have, and would like to know if there is a command to see the version of java that is installed and active. Also, which version works best? All this on 32bit Ubuntu 12.04
EDIT:
Ok, so it seems like I have both openjdk 6 and 7, with openjdk 7 in use. I want to use openjdk 7, so how do I uninstall openjdk 6? Is just via USC good enough or is there a command that should be run?
java openjdk jdk
add a comment |
I want to start toying around with java (eventually getting to the point where I can write basic little programs for android or web), but I've managed to have java messed up on my computer (from past experiments).
I'm not sure which version of java I have, and would like to know if there is a command to see the version of java that is installed and active. Also, which version works best? All this on 32bit Ubuntu 12.04
EDIT:
Ok, so it seems like I have both openjdk 6 and 7, with openjdk 7 in use. I want to use openjdk 7, so how do I uninstall openjdk 6? Is just via USC good enough or is there a command that should be run?
java openjdk jdk
add a comment |
I want to start toying around with java (eventually getting to the point where I can write basic little programs for android or web), but I've managed to have java messed up on my computer (from past experiments).
I'm not sure which version of java I have, and would like to know if there is a command to see the version of java that is installed and active. Also, which version works best? All this on 32bit Ubuntu 12.04
EDIT:
Ok, so it seems like I have both openjdk 6 and 7, with openjdk 7 in use. I want to use openjdk 7, so how do I uninstall openjdk 6? Is just via USC good enough or is there a command that should be run?
java openjdk jdk
I want to start toying around with java (eventually getting to the point where I can write basic little programs for android or web), but I've managed to have java messed up on my computer (from past experiments).
I'm not sure which version of java I have, and would like to know if there is a command to see the version of java that is installed and active. Also, which version works best? All this on 32bit Ubuntu 12.04
EDIT:
Ok, so it seems like I have both openjdk 6 and 7, with openjdk 7 in use. I want to use openjdk 7, so how do I uninstall openjdk 6? Is just via USC good enough or is there a command that should be run?
java openjdk jdk
java openjdk jdk
edited Jun 12 '12 at 20:55
Stramato
asked Jun 12 '12 at 20:13
StramatoStramato
7171816
7171816
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
This command should tell you what is currently providing the Java virtual machine (java) and the Java compiler (javac):
file /etc/alternatives/java /etc/alternatives/javac
This assumes the "alternatives" system is working properly, which might not be the case, depending on how Java has been "messed up" in the past. To check this, run:
file `which java javac`
If the alternatives system is working correctly and being used by Java, then you should see:
/usr/bin/java: symbolic link to `/etc/alternatives/java'
/usr/bin/javac: symbolic link to `/etc/alternatives/javac'
Otherwise please edit your question to provide details. Then it should be possible to give a more specific answer.
You can remove openjdk-6 with the Software Center. There are multiple packages associated with it, so you may need to remove more than one packages. (All the `openjdk-6 packages are listed here.)
Or you can use the command-line:
sudo apt-get remove openjdk-6-* icedtea-6-*
However, whichever method you use, you may want to check first to see what depends on these packages--you might have software installed that specifically needs version 6. (Probably not, but possibly.)
You can check for this by simulating the removal operation on the command-line:
apt-get -s remove openjdk-6-* icedtea-6-*
This will show you the effects of removing those packages, including what other packages would be removed as well. (You'll notice that since this is a simulation, you don't need sudo.)
If you want to be able to continue using Java content online in your web browser (this is not the same thing as JavaScript), then before you remove any icedtea-6- or openjdk-6- packages (except perhaps openjdk-6-jdk), you should make sure you have icedtea-7- packages installed corresponding to whatever icedtea-6- packages are installed.
add a comment |
The simplest way is:
update-java-alternatives -l shows you all the Java versions you have installed.
java -version shows you the Java version you are using.
java -showversion shows you the Java version you are using and help.
Normally it would be OpenJDK.
add a comment |

java -version
javac -version
These commands display what version of java (the interpreter that runs Java programs) and javac (the compiler that creates them) you have installed.
See the image above for details.
add a comment |
This what I did that worked for me :
Open your terminal :
control + alt + T
Then type ( or copy and paste from here ) these commands one at a time:
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Then to be on the safe side, I would reboot.
To find your java version type
java -version
and you should see output similar to this:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Although yours will be in 32 bits.
I highly suggest using Java 7, but the updates will try to install Java 6 too. That is OK. But your default should still come up as 7. Everything I have thrown at it works as long as your video card drivers work.
- Are PPA's safe to add to my system and what are some "red flags" to watch out for?
add a comment |
Still valid today! I had issues using OpenJDK in the past and so started running with Oracle instead. I was having some problems with my 1.13.2 server and revered to OpenJDK instead and poof it's all happy now!
add a comment |
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',
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%2faskubuntu.com%2fquestions%2f150057%2fhow-can-i-tell-what-version-of-java-i-have-installed%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
This command should tell you what is currently providing the Java virtual machine (java) and the Java compiler (javac):
file /etc/alternatives/java /etc/alternatives/javac
This assumes the "alternatives" system is working properly, which might not be the case, depending on how Java has been "messed up" in the past. To check this, run:
file `which java javac`
If the alternatives system is working correctly and being used by Java, then you should see:
/usr/bin/java: symbolic link to `/etc/alternatives/java'
/usr/bin/javac: symbolic link to `/etc/alternatives/javac'
Otherwise please edit your question to provide details. Then it should be possible to give a more specific answer.
You can remove openjdk-6 with the Software Center. There are multiple packages associated with it, so you may need to remove more than one packages. (All the `openjdk-6 packages are listed here.)
Or you can use the command-line:
sudo apt-get remove openjdk-6-* icedtea-6-*
However, whichever method you use, you may want to check first to see what depends on these packages--you might have software installed that specifically needs version 6. (Probably not, but possibly.)
You can check for this by simulating the removal operation on the command-line:
apt-get -s remove openjdk-6-* icedtea-6-*
This will show you the effects of removing those packages, including what other packages would be removed as well. (You'll notice that since this is a simulation, you don't need sudo.)
If you want to be able to continue using Java content online in your web browser (this is not the same thing as JavaScript), then before you remove any icedtea-6- or openjdk-6- packages (except perhaps openjdk-6-jdk), you should make sure you have icedtea-7- packages installed corresponding to whatever icedtea-6- packages are installed.
add a comment |
This command should tell you what is currently providing the Java virtual machine (java) and the Java compiler (javac):
file /etc/alternatives/java /etc/alternatives/javac
This assumes the "alternatives" system is working properly, which might not be the case, depending on how Java has been "messed up" in the past. To check this, run:
file `which java javac`
If the alternatives system is working correctly and being used by Java, then you should see:
/usr/bin/java: symbolic link to `/etc/alternatives/java'
/usr/bin/javac: symbolic link to `/etc/alternatives/javac'
Otherwise please edit your question to provide details. Then it should be possible to give a more specific answer.
You can remove openjdk-6 with the Software Center. There are multiple packages associated with it, so you may need to remove more than one packages. (All the `openjdk-6 packages are listed here.)
Or you can use the command-line:
sudo apt-get remove openjdk-6-* icedtea-6-*
However, whichever method you use, you may want to check first to see what depends on these packages--you might have software installed that specifically needs version 6. (Probably not, but possibly.)
You can check for this by simulating the removal operation on the command-line:
apt-get -s remove openjdk-6-* icedtea-6-*
This will show you the effects of removing those packages, including what other packages would be removed as well. (You'll notice that since this is a simulation, you don't need sudo.)
If you want to be able to continue using Java content online in your web browser (this is not the same thing as JavaScript), then before you remove any icedtea-6- or openjdk-6- packages (except perhaps openjdk-6-jdk), you should make sure you have icedtea-7- packages installed corresponding to whatever icedtea-6- packages are installed.
add a comment |
This command should tell you what is currently providing the Java virtual machine (java) and the Java compiler (javac):
file /etc/alternatives/java /etc/alternatives/javac
This assumes the "alternatives" system is working properly, which might not be the case, depending on how Java has been "messed up" in the past. To check this, run:
file `which java javac`
If the alternatives system is working correctly and being used by Java, then you should see:
/usr/bin/java: symbolic link to `/etc/alternatives/java'
/usr/bin/javac: symbolic link to `/etc/alternatives/javac'
Otherwise please edit your question to provide details. Then it should be possible to give a more specific answer.
You can remove openjdk-6 with the Software Center. There are multiple packages associated with it, so you may need to remove more than one packages. (All the `openjdk-6 packages are listed here.)
Or you can use the command-line:
sudo apt-get remove openjdk-6-* icedtea-6-*
However, whichever method you use, you may want to check first to see what depends on these packages--you might have software installed that specifically needs version 6. (Probably not, but possibly.)
You can check for this by simulating the removal operation on the command-line:
apt-get -s remove openjdk-6-* icedtea-6-*
This will show you the effects of removing those packages, including what other packages would be removed as well. (You'll notice that since this is a simulation, you don't need sudo.)
If you want to be able to continue using Java content online in your web browser (this is not the same thing as JavaScript), then before you remove any icedtea-6- or openjdk-6- packages (except perhaps openjdk-6-jdk), you should make sure you have icedtea-7- packages installed corresponding to whatever icedtea-6- packages are installed.
This command should tell you what is currently providing the Java virtual machine (java) and the Java compiler (javac):
file /etc/alternatives/java /etc/alternatives/javac
This assumes the "alternatives" system is working properly, which might not be the case, depending on how Java has been "messed up" in the past. To check this, run:
file `which java javac`
If the alternatives system is working correctly and being used by Java, then you should see:
/usr/bin/java: symbolic link to `/etc/alternatives/java'
/usr/bin/javac: symbolic link to `/etc/alternatives/javac'
Otherwise please edit your question to provide details. Then it should be possible to give a more specific answer.
You can remove openjdk-6 with the Software Center. There are multiple packages associated with it, so you may need to remove more than one packages. (All the `openjdk-6 packages are listed here.)
Or you can use the command-line:
sudo apt-get remove openjdk-6-* icedtea-6-*
However, whichever method you use, you may want to check first to see what depends on these packages--you might have software installed that specifically needs version 6. (Probably not, but possibly.)
You can check for this by simulating the removal operation on the command-line:
apt-get -s remove openjdk-6-* icedtea-6-*
This will show you the effects of removing those packages, including what other packages would be removed as well. (You'll notice that since this is a simulation, you don't need sudo.)
If you want to be able to continue using Java content online in your web browser (this is not the same thing as JavaScript), then before you remove any icedtea-6- or openjdk-6- packages (except perhaps openjdk-6-jdk), you should make sure you have icedtea-7- packages installed corresponding to whatever icedtea-6- packages are installed.
edited Jun 12 '12 at 21:08
answered Jun 12 '12 at 20:19
Eliah KaganEliah Kagan
82.8k22227369
82.8k22227369
add a comment |
add a comment |
The simplest way is:
update-java-alternatives -l shows you all the Java versions you have installed.
java -version shows you the Java version you are using.
java -showversion shows you the Java version you are using and help.
Normally it would be OpenJDK.
add a comment |
The simplest way is:
update-java-alternatives -l shows you all the Java versions you have installed.
java -version shows you the Java version you are using.
java -showversion shows you the Java version you are using and help.
Normally it would be OpenJDK.
add a comment |
The simplest way is:
update-java-alternatives -l shows you all the Java versions you have installed.
java -version shows you the Java version you are using.
java -showversion shows you the Java version you are using and help.
Normally it would be OpenJDK.
The simplest way is:
update-java-alternatives -l shows you all the Java versions you have installed.
java -version shows you the Java version you are using.
java -showversion shows you the Java version you are using and help.
Normally it would be OpenJDK.
edited May 4 '17 at 10:20
bluish
1133
1133
answered Jun 12 '12 at 20:34
Luis Alvarado♦Luis Alvarado
146k138486655
146k138486655
add a comment |
add a comment |

java -version
javac -version
These commands display what version of java (the interpreter that runs Java programs) and javac (the compiler that creates them) you have installed.
See the image above for details.
add a comment |

java -version
javac -version
These commands display what version of java (the interpreter that runs Java programs) and javac (the compiler that creates them) you have installed.
See the image above for details.
add a comment |

java -version
javac -version
These commands display what version of java (the interpreter that runs Java programs) and javac (the compiler that creates them) you have installed.
See the image above for details.

java -version
javac -version
These commands display what version of java (the interpreter that runs Java programs) and javac (the compiler that creates them) you have installed.
See the image above for details.
edited Jun 12 '12 at 20:31
Eliah Kagan
82.8k22227369
82.8k22227369
answered Jun 12 '12 at 20:27
rɑːdʒɑrɑːdʒɑ
58.6k85218302
58.6k85218302
add a comment |
add a comment |
This what I did that worked for me :
Open your terminal :
control + alt + T
Then type ( or copy and paste from here ) these commands one at a time:
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Then to be on the safe side, I would reboot.
To find your java version type
java -version
and you should see output similar to this:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Although yours will be in 32 bits.
I highly suggest using Java 7, but the updates will try to install Java 6 too. That is OK. But your default should still come up as 7. Everything I have thrown at it works as long as your video card drivers work.
- Are PPA's safe to add to my system and what are some "red flags" to watch out for?
add a comment |
This what I did that worked for me :
Open your terminal :
control + alt + T
Then type ( or copy and paste from here ) these commands one at a time:
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Then to be on the safe side, I would reboot.
To find your java version type
java -version
and you should see output similar to this:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Although yours will be in 32 bits.
I highly suggest using Java 7, but the updates will try to install Java 6 too. That is OK. But your default should still come up as 7. Everything I have thrown at it works as long as your video card drivers work.
- Are PPA's safe to add to my system and what are some "red flags" to watch out for?
add a comment |
This what I did that worked for me :
Open your terminal :
control + alt + T
Then type ( or copy and paste from here ) these commands one at a time:
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Then to be on the safe side, I would reboot.
To find your java version type
java -version
and you should see output similar to this:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Although yours will be in 32 bits.
I highly suggest using Java 7, but the updates will try to install Java 6 too. That is OK. But your default should still come up as 7. Everything I have thrown at it works as long as your video card drivers work.
- Are PPA's safe to add to my system and what are some "red flags" to watch out for?
This what I did that worked for me :
Open your terminal :
control + alt + T
Then type ( or copy and paste from here ) these commands one at a time:
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Then to be on the safe side, I would reboot.
To find your java version type
java -version
and you should see output similar to this:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Although yours will be in 32 bits.
I highly suggest using Java 7, but the updates will try to install Java 6 too. That is OK. But your default should still come up as 7. Everything I have thrown at it works as long as your video card drivers work.
- Are PPA's safe to add to my system and what are some "red flags" to watch out for?
edited Apr 13 '17 at 12:23
Community♦
1
1
answered Jun 12 '12 at 20:23
TorakTuTorakTu
10615
10615
add a comment |
add a comment |
Still valid today! I had issues using OpenJDK in the past and so started running with Oracle instead. I was having some problems with my 1.13.2 server and revered to OpenJDK instead and poof it's all happy now!
add a comment |
Still valid today! I had issues using OpenJDK in the past and so started running with Oracle instead. I was having some problems with my 1.13.2 server and revered to OpenJDK instead and poof it's all happy now!
add a comment |
Still valid today! I had issues using OpenJDK in the past and so started running with Oracle instead. I was having some problems with my 1.13.2 server and revered to OpenJDK instead and poof it's all happy now!
Still valid today! I had issues using OpenJDK in the past and so started running with Oracle instead. I was having some problems with my 1.13.2 server and revered to OpenJDK instead and poof it's all happy now!
answered 51 mins ago
KalanVryceKalanVryce
38116
38116
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f150057%2fhow-can-i-tell-what-version-of-java-i-have-installed%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