Installing JDK6 on Debian Etch 

http://www.osnews.com/comments/17141

by snowbender on Fri 2nd Feb 2007

AFAIK the current java-package does not support Java6 versions yet. Not the Sun version and not the IBM version.

As far as installing the Sun version goes, it is included in the official Debian non-free repositories, both for i386 and amd64. Testing only has Sun Java 5, while unstable also has Sun Java 6.

apt-cache search sun-java
sudo apt-get install sun-java6-jre

The "install it manually" article is actually giving bad advice. You can just install it from the repositories and configure the active java version with "update-alternatives".

installing java 

Newsgroups: gmane.linux.debian.user
Date: Thu, 28 Dec 2006
> x@p4s:~$ limewire
> Starting LimeWire...
> Java exec found in PATH. Verifying...
> OOPS, you don't seem to have a valid JRE. . .
> You need to upgrade to JRE 1.4.x or newer from http://www.java.com[]
>
> x@p4s:~$ java -version
> java version "1.4.2"
> gij (GNU libgcj) version 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)
>
> What's the problem?

gcj has higher priority than sun java. To display your java alternatives, type

/usr/sbin/update-alternatives --display java

To change it, do

# /usr/sbin/update-alternatives --config java

Choose sun java as your preference.

Changing the alternatives for java will change it for javac, javadoc, javap etc. since these files are slaves of java.

John L Fjellstad @fjellstad.org

Debian Java 

Since currently Sun Java 5.x jre package is directly available in Debian repository, the following is only for installing jdk.

Install Sun Java 

http://www.togaware.com/linux/survivor/Install_Sun.shtml#sec:sun-java

Using java-package 

The java-package Debian package will go through the process of installing the Sun Java. It supplies the command make-jpkg to do this.

Obtain j2sdk-1_4_2_03-linux-i586.bin (this is the J2SE kit) from http://java.sun.com. It is a 34MB file so over a modem that could be 3 hours or so!

Once available turn it into a Debian package:

$ fakeroot make-jpkg j2sdk-1_4_2_03-linux-i586.bin

You will be asked for a Maintainer name for the package (you can give your name) and an email address (again, use your own). These are just pieces of information for the packaging, and have no consequence. The debian package that is generated can then be installed:

$ wajig install sun-j2sdk1.4_1.4.2+03_i386.deb

The manual approach 

The manual approach for this is to save the file into /usr/local/. Then

# sh j2sdk-1_4_2_03-linux-i586.bin

To accept the license type yes and the installation will begin. This will create a new directory in /usr/local/ with the name j2sdk1.4.2_03. Now create the necessary links:

# ln -s /usr/local/j2sdk1.4.2_03/bin/* /usr/local/bin

To confirm it is installed:

$ java -version

This will also provide the necessary libraries for the Java plugin for Mozilla (and hence Firefox and Epiphany).

If there's a problem it might be protections:

# chmod -R go+rX j2sdk1.4.2_03

Mozilla Java Plugin 

http://www.togaware.com/linux/survivor/Mozilla_Java.shtml

Currently it is not possible to use a free Java Virtual Machine as a Mozilla plugin because most of the free JVMs do not yet support the Java AWT (Java GUIs). So the non-free alternatives from Sun, IBM, or Blackdown are required. This is unfortunate as it means that your system becomes dependent on software that you are unable to validate and view yourself, relying on very few others to provide trustworthy code.

Nonetheless, to get the Java plugin running with an installation of j2sdk1.4.2_03 (from Sun and installed as described in Section 47.1) for Mozilla 1.5, link the appropriate library to the mozilla plugin directory:

# cd /usr/lib/mozilla/plugins
# ln -s /usr/local/j2sdk1.4.2_03/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so

Then run Mozilla and visit about:plugins to ensure the plug in is found.

Java JRE/JDK Installation on Debian 

http://serios.net/content/debian/java/

Abstract 

This and the related documents is a Debian Java Howto. These pages describe various methods there is to install a Java Runtime Environment (JRE/J2RE) or a Java Development Kit (JDK/J2SDK) on the GNU/Linux distribution of Debian. The information applies also in most parts to other Debian-based distributions such as Ubuntu.

Because of licensing issues, the Sun Microsystems (or derived) Java is not directly available through Debian. Therefore one has to utilize some of the methods I have described on these pages to get Java installed.

Contents 

  1. Introduction o 1.1 Notations Used o 1.2 Notes for Ubuntu Linux

  2. The different methods of installing a JRE/JDK o A. With java-package/make-jpkg o B. Installing from APT sources with Java packages o C. Manual installation o D. Free alternatives

  3. Browser plugin / Java functionality in a web browser

3. Browser plugin / Java functionality in a web browser 

Depending on with which method and what JRE/JDK you installed, and what web browser you use, you may have Java support functioning in your browser already.

Restart your browser after the installation of Java, if you already haven't done so, so that the plugin will be recognized if things have been set up automatically.

Use this following link to determine whether your Java plugin is working or not:

If the applet in the above link didn't load, follow the following link for instructions I have written about how to configure some popular web browsers to have Java support functioning in them with the Sun, IBM or Blackdown JREs already installed as per the methods mentioned earlier on thie page.

Java JRE/JDK Installation on Debian - Browser plugin / Java functionality in a web browser http://serios.net/content/debian/java/browser-plugin.php

Setting up a Java development environment the debian way. 

Newsgroups:  gmane.linux.debian.user
Date:        Wed, 22 Jun 2005 11:50:41 +0100

Alan Chandler wrote:

> So my questions are:
>
> 1) What tools do I need to develop the application.   This includes code
> editiing, build environment, unit testing, I tried to setup eclipse on my
> workstation but there are unsatisfied dependencies (java runtime?).

You'll need a build tool and Ant is probably the easiest and best to use:

http://packages.debian.org/cgi-bin/search_packages.pl?keywords=ant&searchon=names&subword=1&version=stable&release=all

If you're developing web apps, then the Struts frame work is very handy:

http://packages.debian.org/cgi-bin/search_packages.pl?keywords=struts&searchon=names&subword=1&version=stable&release=all

I would suggest looking at all the Apache commons libraries that are available via an apt-get install.

http://packages.debian.org/cgi-bin/search_packages.pl?keywords=commons&searchon=names&subword=1&version=stable&release=all

I would say that most of these libraries are out of date as you can download newer versions from the Apache website. I do this and manually mange them, it means I've always got the latest version with bug fixes, new functionality etc.

For unit testing, then you can't go wrong with JUnit:

http://packages.debian.org/cgi-bin/search_packages.pl?keywords=junit&searchon=names&subword=1&version=stable&release=all

If you want to get fancy then you could download Hibernate and use this to communicate with Postgres. This is waht I'm going to be doing with a small project in the near future:

http://www.hibernate.org/

> 2) What run time environment

You'll also need a servlet engine so either Tomcat 4 or Tomcat 5, depending on what version of the JDK and servlet API you want to use:

http://packages.debian.org/cgi-bin/search_packages.pl?keywords=tomcat&searchon=names&subword=1&version=stable&release=all

There only seems to be Tomcat 4, so you'll be limited to Servlet 2.3 and JSP 1.2.

Finally you'll neeed a decent JVM, I download the Sun ones and build .deb's using this website as a guide:

http://serios.net/content/debian/java/

Just remember to set a JAVA_HOME env variable for Tomcat etc to pick up and use. I've defined mine in /etc/environment and this seems to work okay, although what you do when you change from JDK1.5 to JDK1.4 with update-alternatives I don't know…

> Obviously all this from standard debian packages if that is possible

In some cases it will be easier to download and manually manage certain packages, as you either can't get them or the versions you can get with apt-get are too old.

There doesn't seem to be any decent Java IDE's that come as a .deb package. Netbeans and Eclipse seem to be the two popular ones and ASAIK both come as .bin's so you could manually install them. OTher than that, you could use vi or emacs…

Bob

Setting up a Java development environment the debian way. 

> Obviously all this from standard debian packages if that is possible

I realize that I am about to become really unpopular here but… (if you're prone to knee jerk reactions I would stop reading now if I were you) avoid the open source Java implementations like the plague. I tried one (inadvertently) about 6 weeks ago and I was surprised how much was implemented. Unfortunately I ran into a bug in the implementation that cost me a lot of development time and it has put me off the open source VM's for good.

As far as the closed source VMs go I would recommend you go for the latest Sun VM. It's fast (for Java) and stable. If you bought a book on Java make sure it covers the changes in Java 1.5 (Java 5) as there were quite a few - some of which are rather nice.

On the development environment front you have two choices Ecplise or NetBeans. I use netbeans as it is better, IMHO, for web development (built in tomcat, junit testing, and ant build scripts) but a lot of people like eclipse. Running netbeans is easy. It comes with a graphical installer or you can just grab the tar ball and just unpack it where ever you want (I stick mine in /usr/local). You can choose the VM used by netbeans with the —jdkhome flag eg:

/usr/local/netbeans-4.1/bin/netbeans —jdkhome /usr/local/jdk1.5.0_03

As for installing Java I recommend using java-package. It's quick and easy and seems to work with all the modern VM packages.

You might also like to install the command line ant from the Debian package.

Graham Smith

Setting up a Java development environment the debian way. 

> 1) What tools do I need to develop the application.   This includes code
> editiing, build environment, unit testing, I tried to setup eclipse on my
> workstation but there are unsatisfied dependencies (java runtime?).

On sarge, I'm using the netBeans IDE (www.netbeans.org). I tried eclipse and liked the nB editor better.

> 2) What run time environment

I'm using Sun's JDK 5 (or whatever they're calling it this week). At the end of the install, there's a URL to go to to see if it and the mozilla plugin work.

> Obviously all this from standard debian packages if that is possible

Sun java isn't what Debian defines as free. I went through a Java-on-Debian HOWTO, but couldn't get it to work. Sun's install dox did.

Glenn English

Setting up a Java development environment the debian way. 

> 2) What run time environment

Don't try anything other than Sun JDK (especially *not* the blackdown javas).

> Sun java isn't what Debian defines as free. I went through a
> Java-on-Debian HOWTO, but couldn't get it to work. Sun's install dox
> did.

It's all there.

http://serios.net/content/debian/java/with-java-package.php

Setting up a Java development environment the debian way. 

> but what is the debian way?

Personally I think you're buying yourself a world of pain if you try to do servlet/ejb/etc java development using the free java tools. They are definitely getting better and are useable for some tasks but aren't completely there yet.

This doc was updated 3 june 2005 and so is presumably up with the latest developments: http://www.nl.debian.org/doc/manuals/debian-java-faq/ (I just found this via google).

http://java.debian.net is also useful (I found this in the faq).

I do a lot of java development on Debian, and simply download Sun's standard java for Linux and a standard Eclipse build and work from there. They just need to be untarred, and $PATH set appropriately. Of course junit is also very important, and possibly ant.

I am aware that Fedora ships with a version of Eclipse compiled via gcj which is cool. But I am not aware of a debian package for eclipse. And anyway Eclipse 3.1 is coming out soon with some very useful new features for jsp/j2ee development.

If I was writing a GUI app for linux I might be tempted to try java ` the gtk java bindings ` gcj to generate a native binary from java source. But not for servlet development.

If you need more info I suggest you ask on the debian-java mail list instead of here.

Simon Kitching

Setting up a Java development environment the debian way. 

> > Personally I think you're buying yourself a world of pain if you try to
> > do servlet/ejb/etc java development using the free java tools. They are
> > definitely getting better and are useable for some tasks but aren't
> > completely there yet.
>
> I re-read that 3 times to make sure I had read it correctly. I
> completely disagree! I use JBoss, Tomcat, Sun JDK, Eclipse, ant (or
> maven) and I have no issues.
>
> Which non-open-source tools out there should I seriously consider
> spending money on?

I only meant Kaffe/Classpath/gcj and things of that level. They've come a long way in the last year or so and I look forward to the day they can be used as a substitute for Sun's JDK. It may not be very far away.

But personally I would develop on Sun/IBM jdks and then port/test on Free platforms rather than develop on free platforms; developing on a platform you can't trust to be generally bug-free and feature-complete isn't nice.

Sun'd JDK is only free-as-in-beer.

Things like JBoss/Tomcat/Eclipse etc. are excellent tools, and at least as good as their commercial competitors IMO.

Simon Kitching

About blackdown 

> Obviously all this from standard debian packages if that is possible

I've noticed that many of the answers for this thread suggest to avoid the blackdown. Any justification for that?

The reason I'm asking is that I asked a similar question a while ago, and got a suggest to use blackdown. I was just about to give it a try.

Here are the quotes from the original suggest:

,-----
| I am using blackdown j2re1.4, it works.
|
| [...]
|
| the blackdown j2re1.4 works perfectly fine, but it's not DFSG free software
| due to licensing conditions imposed by Sun.
|
| There are other projects to create a real free software java platform, but
| they are not finished yet.
|
| [...]
|
| The sun system is a reasonable alternative, but if I understand correctly it's
| essentially the same as the blackdown system anyway, blackdown port java to
| linux for Sun (and us).  And it's packaged for debian...
`-----

Thanks

About blackdown 

> I've noticed that many of the answers for this thread suggest to avoid the
> blackdown. Any justification for that?

Had problems when trying to make Tomcat/Jboss stuff work. It suddenly worked when I used sun sdk instead. Since I lost a lot of time because of this I can only warn you. Otherwise, blackdown java worked quite well for other purposes.

About blackdown 

I believe that the blackdown VM was used as the basis for the first VM on Linux but that was a few years ago now and things have moved on. The blackdown VM is still being updated AFAIK but isn't at 1.5 levels yet (after you have used generics you wouldn't want to go back). You could probably use blackdown for web development but I doubt you could use it for gui work.

Graham Smith

About blackdown 

> I've noticed that many of the answers for this thread suggest to avoid the
> blackdown. Any justification for that?

IIRC, Blackdown was instrumental in Sun implementing Java on Linux. Blackdown, and all the other FOSS implementations of Java are noble undertakings and I look forward to the day I can use a completely FOSS version of Java on Linux, OSX, and the Redmond OS. I will also be VERY glad when GCJ is done and I can compile my classes into native code. However, until then, not all classes are implemented in any FOSS version of Java.

For me, the biggest problem is that they don't include the GUI classes. I think one has some AWT classes, but I have yet to see anything other than Sun's JVM that has Swing working.

Hal Vaughan

JBoss and Tomcat 

> What is the difference between JBoss and Tomcat.  The JBoss web site seems to
> imply that JBoss incorporates Tomcat.  What extra does it give, and will I
> need it.

Basically, Tomcat is a servlet container : it handles JSP (so called Java Server Pages).

JBoss brings the full J2EE stuff, javabeans. (my god !). It comes with its own Tomcat probably because of the sheer complexity of Tomcat/Jboss interaction.

JBoss and Tomcat 

> What is the difference between JBoss and Tomcat.  The JBoss web site seems to

Tomcat is a servlet "container". A servlet is the Java equivalent of a CGI program. JBoss is an Enterprise Java Bean container. EJBs are a very involved way of providing Transactions. You won't need it.

Spuggy

Debian native java 

Newsgroups: gmane.linux.debian.user
Date: 2004-12-18 20:33:05
> Is Debian native java OK?

What package/s are you talking about?

I am using blackdown j2re1.4, it works. I understand the free software java systems don't work 100% yet.

This is the Debian Java FAQ:

http://www.debian.org/doc/manuals/debian-java-faq/ch11.html

and here is the relevant bit of it:

11.1 How can I get Debian packages from Blackdown?

If the releases provided aren't recent enough for you, you can of course install the files from the Blackdown mirrors. You can either use the Debian packages provided by Blackdown or download their tar files.

If you want to use their packages, add the following line [2] to your /etc/apt/sources.list:

deb proto://url/debian potato main non-free
deb proto://url/debian woody main non-free
deb proto://url/debian testing main non-free
deb proto://url/debian unstable main non-free

Where proto://url is one of the mirrors from the list available at http://www.blackdown.org/java-linux/mirrors.html. [3] For example, in Debian 3.0 using Metalab's mirror use:

deb ftp://metalab.unc.edu/pub/linux/devel/lang/java/blackdown.org/debian woody main non-free

And then do:

$ apt-get update
$ apt-get install j2sdk1.4

(I changed the j2sdk1.3 to j2sdk1.4)

you can also just install j2se1.4 if you don't need the development kit.

Debian native java 

> > I understand the free software java systems don't work 100% yet.
>
> So I read. That's why I'm scared and asked before trying. Seeing that you
> are using it really gives me the confident to give it a try.

No, the blackdown j2re1.4 works perfectly fine, but it's not DFSG free software due to licensing conditions imposed by Sun.

There are other projects to create a real free software java platform, but they are not finished yet.

Sam Watkins

Debian native java 

> Thanks for the input. Yeah, I meant to try the 'free-java-sdk' since it is
> default in Debian Testing. But looking up Debian Java faq, I noticed that
> things are more complicated than that. More sdk/jvm are available, and I
> can't tell which one is better than others by just reading the faq.

Without any shadow of a doubt the blackdown packages are "better" than free-java-sdk if you want a functioning java system. If you require a free-software java system, go for free-java-sdk - but don't be surprised when it doesn't run your java programs.

> Ok, let's forget the debian java packages and consider a simple question:
> I'm not just trying to compile a couple of small java programs. I want to
> use Java. Nowadays, many utilities are released in Java. Big monsters that
> comes to my mind are, eclips, jbuilder, together, IBM db2 control center,
> etc. What would be the best/safest java sdk package to use for such case,
> and all those ready built .jar files?

The blackdown or the sun java systems should work with these. If you can get any of them to run with free-java-sdk, I am surprised, amazed and impressed.

If you want to get your java programs running and get your work done, install blackdown java. If have ethical objections to non-free software, or you want to support the development of free-software java systems, install free-java-sdk. Or you can install both (I don't think they conflict).

You said "I want to use java", so install the blackdown j2re-1.4 and j2sdk-1.4 packages.

http://www.debian.org/doc/manuals/debian-java-faq/ch11.html

The sun system is a reasonable alternative, but if I understand correctly it's essentially the same as the blackdown system anyway, blackdown port java to linux for Sun (and us). And it's not packaged for debian, so it will be a pain to install. The ibm system apparently doesn't support all of java 2.

Sam Watkins

cool java-based programs I might miss out on? 

Newsgroups:  gmane.linux.debian.user
Date:        Mon, 04 Apr 2005 20:27:15 +0700

I have downloaded j2sdk/j2re from Sun website and build+install the .deb generated by the make-jpkg script. I'm now wondering, since the official Debian doesn't carry j2sdk/j2re, there are probably many cool Java-based programs that are also not included. Could people list them? The only ones from the top of my head are:

cool java-based programs I might miss out on? 

Ok, I found http://www.jpackage.org/ . It's for RPM though.

David Garamond

cool java-based programs I might miss out on? 

Try the following url :-)

http://www.hotscripts.com/Java/index.html

Jacob

cool java-based programs I might miss out on? 

If you're interested in coding in Java or finding out how others code, jad is a nice tool:

# dpkg -p jad Package: jad Priority: optional Section: non-free/devel Installed-Size: 614 Maintainer: Takashi Okamoto <tora@debian.org> Architecture: i386 Version: 1.5.8e-2 Depends: libc6 (>= 2.2), libstdc++2.10-glibc2.2 Filename: pool/non-free/j/jad/jad_1.5.8e-2_i386.deb Size: 226460 MD5sum: 38227328582fa474c3be0f8ac4380fac Description: The fast Java Decompiler Jad is a Java decompiler, i.e. program that reads one or more Java class files and converts them into Java source files which can be compiled again. . Author: Pavel Kuznetsov Homepage: http://www.geocities.com/kpdus/jad.htm

Monique Y. Mudama