java
Java on Debian tip
The default Java environment installed by Debian is the GNU Compiler for Java, while GNU have made remarkable progress with this – anyone doing mainstream Java development will probably prefer to install the latest Sun Java environment on their system – even free software projects like Hadoop are primarily tested in this environment.
Most Linux distributions provide packages for Sun’s Java as well as GCJ and probably OpenJDK. When you install more than one package which provides similarly named commands, Debian’s Alternatives System comes into play – allowing you to select one command or another. When you install a different Java, you can of course manually update each Java command (java, javac, javadoc, jconsole, jmap,jps and so on) using the update-alternatives command, but if you want a quicker way, try the update-java-alternatives command from the java-common package. It will automatically update the paths to all provided Java commands in one go once you tell it which installed Java environment you wish to use, for example,
update-java-alternatives -s java-6-sun
Maven Hello World
I’ve been looking at Maven (2.0) recently as part of my work with the Digital Enterprise Research Institute (DERI) . In the past, most projects I’ve worked on used Apache Ant which works pretty well. Maven is a lot more complex than Ant (see some of its features in What is Maven?) but can be used as a “better Ant” if that’s all you need/want (and it seems like a sensible way to start moving to Maven).
Three things I like about Maven from the start:
- Maven includes support for managing dependencies allowing your project to automatically specify what 3rd party JARs it depends on and automatically downloading those at compile-time rather than requiring other developers to spend time hunting for these applications.
- Maven espouses the idea of convention over configuration for its configuration. This is great, in essence, Maven tries to provide sensible defaults as much as possible so you can use it with the minimum of configuration/effort. If you don’t like these conventions, you can change them, but for the casual user, the effort required to start using the tool is low. This is a great approach, all software should strive to be easy to start using (while catering for the power users by enabling the engine to be tweaked if you want to get your hands dirty under the hood).
- Related to the previous point, it’s remarkably easy to build a new Hello World application (a good smoke test for tools like this). Like
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=ie.atlanticlinux -DartifactId=HelloWorld
to create a new project and
mvn package
to build a test WAR file which you can just drop into your Tomcat webapps directory and immediately test.
Categories
Archives
- September 2010
- February 2010
- November 2009
- September 2009
- August 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- November 2007
- September 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- September 2006
- July 2006
- June 2006
- April 2006