In Ubuntu 9.10 is there any way to confirm/ check if swing is installed and thus check its version!
Asked
Active
Viewed 9,670 times
5 Answers
1
If you are looking for a JRE to run a desktop application, you can check for the 'java' executable in $PATH
, look for $JRE_HOME
or $JAVA_HOME
environment variables. Once a JRE is found use java -version to get its version.
If you are trying to deploy an applet, use the Java Deployment Toolkit.

Chandra Sekar
- 10,683
- 3
- 39
- 54
1
Swing is included in the default Java JRE. So just:
sudo apt-get install openjdk-6-jre
If you need the JDK (to develop on), it's:
sudo apt-get install openjdk-6-jdk
As far as the version, it should be compatible with Java 6. You can check the exact package version with:
apt-cache show openjdk-6-jre

Matthew Flaschen
- 278,309
- 50
- 514
- 539
-
It is important to note that a JRE/JDK might be installed directly from the Sun/Oracle's site too. In that case checking apt's meta-data might not help. – Chandra Sekar Feb 25 '10 at 07:04
-
1Sun's version is better. Use: `sudo apt-get install sun-java6-jre` or `sudo apt-get install sun-java6-jdk` – OscarRyz Feb 25 '10 at 07:06
-
Chandru, that's a valid point. – Matthew Flaschen Feb 25 '10 at 07:15
1
Here's the Java installation page for Ubuntu that covers everything from SDK to web browsers.

C.D. Reimer
- 115
- 11
-1
- Open a terminal
- Type:
java -version
If it says something meaningful, you're fine; you have swing on that machine.

OscarRyz
- 196,001
- 113
- 385
- 569
-
This is clearly not true. For instance, he could have openjdk-6-jre-headless – Matthew Flaschen Feb 25 '10 at 07:04
-
I'm pretty sure he doesn't. Ubuntu 9.10 comes with out java at all. You install it by typing `sudo apt-get install sun-java6-jdk` anyway, your observation makes sense and is still valid. Isn't this a superuser.com question anyway? – OscarRyz Feb 25 '10 at 07:08
-
Most likely, he doesn't have a headless installation. But it's best to make sure. And yes, I almost voted to close it as belonging on Super User. – Matthew Flaschen Feb 25 '10 at 07:12