views:

226

answers:

5

In Ubuntu 9.10 is there any way to confirm/ check if swing is installed and thus check its version ! ...... I am a Noob to swing ! ....

+1  A: 

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.

Chandru
+1  A: 

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
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.
Chandru
Sun's version is better. Use: `sudo apt-get install sun-java6-jre` or `sudo apt-get install sun-java6-jdk`
OscarRyz
Chandru, that's a valid point.
Matthew Flaschen
A: 
  1. Open a terminal
  2. Type: java -version

If it says something meaningful, you're fine; you have swing on that machine.

OscarRyz
This is clearly not true. For instance, he could have openjdk-6-jre-headless
Matthew Flaschen
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
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
+1  A: 

Here's the Java installation page for Ubuntu that covers everything from SDK to web browsers.

C.D. Reimer
+1  A: 

Swing will be included in the JVM, if it's new enough.

See this page.

dj_segfault