2
  1. Just finished a clean install of Ubuntu 10.10 on a new machine
  2. I added the partner repository via ubuntu software center
  3. I ran 'sudo apt-get install sun-java6-jdk'
  4. I ran 'sudo update-java-alternatives -s java-6-sun' and got this error:
alex@alex-home:~$ sudo update-java-alternatives -s java-6-sun 
update-alternatives: error: no alternatives for mozilla-javaplugin.so. 
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so. 
update-alternatives: error: no alternatives for mozilla-javaplugin.so. 
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.

Double checking it failed, I am still on the JRE:

alex@alex-home:~$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
alex@alex-home:~$ 

Tried this too:

alex@alex-home:~$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice[*], or type selection number: 

The JDK is not listed, but it is listed on disk:

alex@alex-home:~$ ls /usr/lib/jvm/
default-java  java-1.6.0-openjdk  java-6-openjdk  java-6-sun  java-6-sun-1.6.0.22

UPDATE:

Installing plugin and fonts caused update-java-alternatives to stop complaining, but still no luck:

sudo apt-get install sun-java6-plugin sun-java6-fonts

Then:

alex@alex-home:~$ sudo update-java-alternatives -s java-6-sun 
alex@alex-home:~$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

UPDATE 2: Hmm, maybe its actually working? I thought "...SE Runtime..." meant JRE, but maybe its all good?

3 Answers 3

2

The SE Runtime means that you're running Java Standard Edition, rather than Enterprise Edition (AKA Servlets/JSP, which need an application server). You should be just fine with what you have installed right now! If you want to develop Java programs, just make sure that javac is installed on your system.

EDIT Also, make sure that javac is being provided by java-6-sun, otherwise you'll probably be using the GNU Java compiler which doesn't seem to be what you want.

1

In terminal try this command

javac 

if you get output something like below then it means that you have java jdk installed.

sample output:

Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are used
  -classpath <path>          Specify where to find user class files and annotation processors
  -cp <path>                 Specify where to find user class files and annotation processors
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -proc:{none,only}          Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...]Names of the annotation processors to run; bypasses default discovery process
  -processorpath <path>      Specify where to find annotation processors
  -d <directory>             Specify where to place generated class files
  -s <directory>             Specify where to place generated source files
  -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files 
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release
  -target <release>          Generate class files for specific VM version
  -version                   Version information
  -help                      Print a synopsis of standard options
  -Akey[=value]              Options to pass to annotation processors
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system

You can also check the version by running

javac -version

Hope this helps.

0

I'm sure that the output of your `java -version' command is generated by the java binary of sun-java6-jre package. So your installation is successful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .