Friday, April 8, 2011

Maven error in ubuntu

One of our projects are using scala with maven. Not sure which dependency was added and then when we did mvn install the com.sun:tools:jar missing error is thrown.

Java is in the class path. Usual guess is JDK versus JRE setup. Tried out few environment variable settings, and we end up solved it by installing the sun java and get rid of the default ubuntu java.

Here are the command from http://yoodey.com/removing-openjdk-jre-ubuntu-1010-ec2-amazon-and-install-sun-java-6-jre-jdk. Thanks !


1. Update Ubuntu Repository
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
sudo apt-get update
sudo apt-get remove openjdk-6-jre-headless
sudo apt-get install sun-java6-jdk sun-java6-jre
sudo apt-get autoremove

2. Set what kind of Java we used in Ubuntu Linux
sudo update-alternatives --config java

You can pick up what kind of Java you need to use.

No comments:

Post a Comment