Amazon Merchant Transport Utility – it takes all the worry of SOAP out of your daily life!
Recently a customer wanted to explore the option of using AMTU in order to move files to, and receive reports from Amazon. The idea is simple -
- Run AMTU on a local computer
- Designate a folder
- Voila – receive new reports there and any files you put there get uploaded to Amazon (every 5 to 12 minutes depending on the file)
It did actually work exactly as described above on a Windows machine. However, we want to do some other things with the information we get from Amazon – warehouse, and payment provider integration etc.
I mocked together a “clunky” looking application (as described by my Director of Services) that does the above in Rails – and was running it on an Ubuntu machine over at Slicehost.
Now, to get AMTU running on this machine, (AMTU is all Java, it should ‘theoretically’ run everywhere), and I’m off to the races. I toss on the kettle, and run back to my machine expecting to drink a cup of tea as I watch automation make our customer’s life much easier in a few minutes.
Clunk!
AMTU refuses to install properly on Ubuntu.
In order to make this easier for future folks attempting this.
1) You need Java (OpenJava, Sun Java6, Sun Java5 whatever). You can and should check this exists by typing in
java -version
Assuming this works, on to the next point. If this doesn’t work then do something along the lines of
sudo apt-get install sun-java6-jre
2) You need to be able to echo JAVA_HOME. Also, don’t make the mistake of pointing it at /usr/bin/java – since the installation is actually asking for the directory wherein Java was installed – it appends the /bin/java part on top of that during the installation. In order to be able to accomplish this in the easiest fashion possible do the following :
sudo nano /etc/environment
Feel free to use any other editor if you like – vi etc. To this file add the line :
JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun"
Note, make sure you actually change that to the file you’re looking for. If you don’t know where you need to point JAVA_HOME, you can get a hint by doing
whereis javac
and then following the symlinks back from that directory to the actual location of javac then traverse the directory tree so that you’re in the directory that has a child named bin, and that bin has a child named java, and you’re in the right place. In the example below, /usr/lib/jvm/java-1.5.0-sun is the appropriate directory for JAVA_HOME.

Setting JAVA_HOME in Ubuntu (Click on it for a larger view)
3) Now you should be able to just run ./install.sh from inside the AMTU folder.
4) If all went according to plan, this worked great. If it didn’t, you’re probably seeing a -bash XXXXXXXX No such file or folder error.
If that’s the case, then you need to keep in mind two things. One, AMTU’s last release was in 2007. It has no real support in the community, or from Amazon itself. Two, you’re probably on a 64 bit machine, and you’ve never needed to install ia32-libs. You can correct this now by doing
apt-get install ia32-libs
5) Now go ahead, uninstall, and reinstall AMTU.
If you run into any other errors, feel free to ping me, and I’ll share with you what little I know about it.
UPDATE : I got an email claiming that they were unable to find sun-java6-jre as a package. The most likely culprit there is that apt-get isn’t checking the multiverse for packages. If you want more details on what that means – check out the explanation of main, restricted, universe, and multiverse here.
In order to let Ubuntu look into the multiverse for packages that are “not free” you need to change the following files /etc/apt/sources.list
sudo nano /etc/apt/sources.list
Your file probably looks similar to this :
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ hardy main restricted universe
deb http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe
deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted universe
You want your file to look like this :
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe
deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted universe