Setting up java for ec2-api-tools on Fedora Linux

Download the Linux or Linux 64 package (not the RPM) from Oracle at

As root:

mkdir /usr/java

since it probably does not exist by default.

Extract the jre-7u21-linux.tar.gz file you downloaded into /usr/java

cd /usr/java && tar xzf jre-7u21-linux.tar.gz

You will have something like:


So in your .bashrc file (or however you set up your environmental variables for EC2) add:

export JAVA_HOME=/usr/java/jre1.7.0_21/


Updating FreeBSD in One Line

..and get an E-mail when it is done!

Okay, so you’ll see more than one line of code but here but the main thing is the single line with the make commands. As long as you are in /usr/src and run that you will probably be okay. Everything else is just recommended.

This is how I currently update world on FreeBSD. I recommend that you start a screen session before doing this. Let’s name our session “updating.”

screen -S updating

If you do not have screen I recommend installing it:

cd /usr/ports/sysutils/screen/
make install clean

If you haven’t updated the svn of the src, now is a good time to do it. If you have never downloaded src, here is how you check out a src repo for FreeBSD.

Now, let’s check the UPDATING file:

less /usr/src/UPDATING

Check for any important news there first (the first couple entries should be enough if you’ve updated recently but you can always check your current patchlevel first with a uname -a).

Go to the src directory and check if anything needs to be updated it /etc before we update by running mergemaster with the -p flag. Often you can skip this step, especially if it is only a minor update.

cd /usr/src
mergemaster -p

Then let’s rebuild and install everything in one line. Use your e-mail address instead at the end:

make -j4 buildworld && echo bw-done && \
make -j4 kernel && echo bkik-done && \
make -j4 installworld && echo iw-done && \
echo "install world done" | mail -s "iw done on $HOSTNAME"

It will start running with text streaming by.
If you ran screen at the beginning type Ctrl+a and then type d to disconnect from the session.
I like this because I start it in a screen session and immediately detach.
Once I get the e-mail (or if it has been a while and I haven’t received anything) I reconnect.

When you want to reconnect to check on it or after it is done do:

screen -r updating

Once done if everything looks like it ran fine do this:

mergemaster -iFU

If you want to save some space after you are done

rm -r /usr/obj

Restart the machine and you should be updated!