Install Java On Ubuntu

21 09 2007

It is so easy to install Java on Ubuntu now. On Ubuntu 7.04 (Feisty Fawn), follow these steps:

1) Make sure you have the right repositories on your sources.list file.

Edit your sources.list file the following way:

sudo gedit /etc/apt/sources.list

or if you are not using gnome (e.g. you are logged in through ssh):

sudo nano /etc/apt/sources.list

If the following lines are not already there, add them:

deb http://us.archive.ubuntu.com/ubuntu feisty main restricted
deb http://us.archive.ubuntu.com/ubuntu feisty universe multiverse

Save the file (in nano use Control-O to save and then Control-X to exit).
Now you need to tell the package manager to update it’s database:

sudo apt-get update

2) Install Java using apt-get

I currently have both Java 5 and Java 6 installed on my machine and it’s very easy to switch between the two. Java 6 has some nice goodies such as JSR-223 and better jconsole that I like to use.

For Java 5:

sudo apt-get install sun-java5-jre sun-java5-jdk sun-java5-plugin

For Java 6:

sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

There are other packages that you might be interested in:

sun-java6-demo sun-java6-doc sun-java6-source

3) Verify installation

Verify that you have the correct version of java running:

java -version

For example, on my machine (yes, I call it tiwouj):

Ubuntu Java Version

To see a list of the java versions that you have installed, you can use the following command (it’s a letter L at the end of the command):

update-java-alternatives -l

Here is my list:

Ubuntu Java List

This should show you a list of all the java alternatives you have installed. java-gcj is the free version of Java from the GNU project and comes installed by default with Ubuntu so you should see it. To switch to a different version, use the following command:

sudo update-java-alternatives -s <version-desired>

e.g:

sudo update-java-alternatives -s java-1.5.0-sun

Make sure it worked:

java -version

That’s it! How easy was that? You have to love apt-get.





Follow-up on Ruby On Java Presentation

25 08 2007

Earlier this month, at Barcamp DC, I talked about using Ruby with Java using JRuby, JSR-223, and the Bean Scripting Framework.

Today, I found this great blog post that describes using the BSF to call Ruby’s ActiveRecord from Java.





Book Review: Beyond Java

22 08 2007

I just finished reading Beyond Java – A glimpse at the future of programming languages by Bruce Tate and I really enjoyed the book. I can’t wait to pass it on to friends and co-workers that are Java developers. I think every Java developer should read it.

Unfortunately, it is the kind of book that will be affected by time as the content will not be relevant anymore a few years from now. As a matter of fact, some of the content is already somewhat outdated but the main ideas are still relevant. So if you haven’t read it yet, go get it now and read it. It’s a small book and a quick read.

Bruce Tate believes that Java development has become too complex and that Java lacks some of the features that are desirable in a modern programming language. In his opinion which I share, Java is too verbose: “Even with seasoned developers, it takes a surprising amount of code to get even simple applications off the ground.” (p. 4). With dynamic languages like Ruby or Python, you can see incredible power and productivity very quickly. In addition, Java does not support metaprogramming or continuations natively.

In Chapter 2, entitled ‘The Perfect Storm’, the author does a great job of describing the environment in which Java emerged to become the dominant programming language. For anyone in need of a quick recap of the recent history of programming languages, this chapter is a great read. The next Chapter is a eulogy of Java where the author describes what Java does right and the features and circumstances that makes Java so successful. Bruce Tate then exposes the limits of Java and offers a comprehensive list of rules that the next successful language will need to follow to become the next Java.

Chapter 6 is a quick overview of Ruby that demonstrates that Ruby possesses a lot of the qualities needed to cross the chasm and become the next big programming language, including having a killer application in Rails (which he reviews in Chapter 7). Finally, the next chapter takes a look at continuation servers and uses the Seaside framework written in Smalltalk as an example. To me, this chapter was probably the most interesting in the book. My only introduction to continuation servers before this was when Chad Fowler briefly mentioned them at the Advanced Ruby Studio that I attended last month. It is a fascinating topic and I will definitely do some digging to learn more about them. Maybe I’ll give Seaside a quick try.

The author also mentions a few major (Python, Groovy, .NET) and minor (PHP, Smalltalk, Lisp, Perl) contenders. He thinks that “Perl is too loose and too messy, PHP is too close to the HTML, Lisp is not accessible, and Smalltalk wasn’t Java” (p. 171).

In conclusion, the goal of the book is to warn Java developers that Java is moving away from its base (it’s getting too difficult to solve simple problems in Java) and showing signs of wear. In the meantime, interesting innovations are appearing in other languages so it is time for Java developers to start paying attention to the world outside of Java.





Barcamp DC - Ruby on Java

15 08 2007

Barcamp DC was great. It’s good to see the DC Tech community get together for events like these.

The first session I attended was an introduction to Ruby on Rails given by Kevin Lawver. I thought it was very cool that Kevin brought his son with him. He seemed to really enjoy the un-conference.

After that, I sat through a couple of good sessions on User Experience and Design Challenges. They were both very interesting discussions. The Design Challenges discussion was initiated and moderated by the folks at Viget. I really enjoyed this one from a non-designer perspective. It seems like a lot of the challenges they face are very similar to the ones a software developer faces such as communication with the customer.

Scott Mendenhall squeezed two talks into one session: Open Source CMS and Ajax Network Latency. The first one was a survey of Open Source Content Management Systems. There are a lot of them out there and a big consulting industry around them. Scott claims that some consultants charge as much as $50,000 to recommend a CMS. The Ajax Network Latency talk was of interest to me because I have been dealing with that issue at work with the Verizon FiOS project.

For the rest of the day I attended a session on the Mobile Web, a Ruby Crash Course, and a Rails open session.

When it was my time to talk, I presented on Ruby and Java cooperation. My slides are here or below:

Overall, I really enjoyed the day and I look forward to the next BarcampDC.





Did Bruce Tate give up on fighting the Java bloat?

8 03 2007

I was reading the first chapter of Better, Faster, Lighter Java from Bruce Tate. I haven’t read the whole book yet but I found the first chapter very interesting and I can’t wait to read the rest of the book. The basic idea behind the book is that programming languages cannot avoid the inevitable ‘bloat’ and Java has crossed that border:

Typical applications use too many design patterns, too much XML, and too many Enterprise JavaBeans.

Bruce proposes some alternatives for dealing with the bloat in Java:

Change nothing; hope that Java will change. Buy a highly integrated family of tools, frameworks, or applications, and let a vendor shield you from the bloat. Quit Java for another object-oriented language. Quit object-oriented languages for another paradigm Spend time and effort becoming a master craftsman.

After presenting these alternatives, Bruce declares that his “choice is to actively fight the bloat.” He proposes five basic principles to achieve this:

Keep it Simple Do One Thing, and Do It Well Strive for Transparency Allow For Extension You Are What You Eat

Since he wrote this book, Bruce has publicly ‘walked away’ from Java to adopt Ruby and Rails. In essence, it seems he followed the ‘Quit Java for another object-oriented alternatives’ even though his claim was to ‘fight the bloat.’ I found this very interesting. Did he realize that his attempt to fight the bloat is not the best solution?

I know he wrote Beyond Java and From Java to Ruby after writing Better Java so I wonder if he answers my question in these books. I guess I’ll have to read on. Mmm… I wonder if that was planned by Bruce… that would be great Buzz Marketing.









You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser