Here are the steps I took to get Eclipse working with Java on my Debian Lenny more-or-less default install laptop.  I know zero (soon to be non-zero) Java, and I’ve never used Eclipse before.

sudo apt-get install eclipse
sudo apt-get install sun-java6-doc

You will then need to download a zipped file from sun’s servers to your /tmp dir, and then re-run the configuration scripts for that package.  AFAIK, that package just installs the help files in the appropriate places.  It doesn’t do the download for you because Sun makes you check a bunch of boxes off about licenses etc. before letting you download.

Increase your productivity about a billion percent for 15 Euro: viPlugin. It works as expected, so far recommended.  The only thing is I didn’t receive my license via email till about 4 hours after I bought it.  So get it set up now.  I, for one, do appreciate the reasonable pricing for viPlugin as apposed to some other vi IDE plugins.  Reasonable pricing makes the difference between me searching for a crack or just paying for the license… but that’s worthy of a whole rant (er, post) of it’s own.

And I think that’s it.  I’m now on my way to becoming yet another Java monk- er, programmer.

Update:

Hum, why is it never that easy?  So the GNU version of the Java complier doesn’t like you using the Scanner class. I have no idea why and right now, with this project 22 hours overdue, I don’t really care (so why am I writing this up now?).  Anyway:

sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java-6-sun
sudo update-alternatives --config java

And you want to select /usr/lib/jvm/java-6-sun/jre/bin/java

sudo update-alternatives --config javac

And you want to select /usr/lib/jvm/java-6-sun/bin/javac

In Eclipse, “Windows” > “Preferences” > “Java” > “Installed JREs”.  You want to ‘Add’ the JRE /usr/lib/jvm/java-6-sun-1.6.0.07  Then you want to make that the default by checking the box and clicking OK.

And now, Eclipse will find that Scanner class for you.

Update #2:

You probably want to use Sun’s javadoc:

sudo update-alternatives --config javadoc

and select /usr/lib/jvm/java-6-sun/bin/javadoc

Update #3:

If you want to use the JUnit4 package, you need to add it to the build path of your project.

sudo apt-get install junit4

In Eclipse, “Windows” > “Preferences” > “Java” > “Installed JREs”.  Select “Edit” on the JRE you’re using – for me, this is java-6-sun-1.6.0.07.  Then “Add External JARs…” and add /usr/lib/eclipse/plugins/org.junit4_4.1.0.1/junit-4.1.jar.  I don’t know why this doesn’t all just happen automagically… I see some hints around that there’s a licensing issue.

Leave a Reply