Tag Archives: Java

Setting up a Tomcat in your AMI

I love Java and Object Oriented Paradigm, and I was looking for an option to develop Java apps in the cloud in a cheap way. The cheaper, light and non-restrictive way to do this is installing Tomcat in an AmazonWS Linux-AMI. You can do great applications in Tomcat with Spring/JPA/JSF2, but this architecture deserves another post.

Well, I want to show you how to configure Tomcat to deploy web applications in a basic-AMI (It’s free the first year):

  • Configuring memory heap
  • Provide gzip compression for the web contents
  • Two ways to redirect to port 80
  • And, if you use maven, deploying remotely with cargo

Continue reading Setting up a Tomcat in your AMI

Update your Ubuntu to Java 7

Download last release from oracle.com, I downloaded jdk-7u1-linux-x64.tar.gz.

Unzip it: tar xvf jdk-7u1-linux-x64.tar.gz

Copy to right place: sudo cp -r jdk1.7.0_01 /usr/lib/jvm

Create java7 alternative: sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_01/jre/bin/java 1

Choose the alternative: sudo update-alternatives –config java

You can choose between many jvm’s easily.


Fizz Buzz Java kata

At XPWeek2011 we learned TDD coding, and the importance of OOP principles to develop applications. I spent great days there, thanks to Carlos Ble and iExpertos.

Continuing with the last kata series. I will show you how I solved FizzBuzz kata, maybe not the best, but I like the solution because the expressive final code:

  • elseSayNumber();

Here you have KataFizzBuzz

Here you have the code: fizzbuzz.zip

And here you have the video: