This is the first article of the Maven tutorial series for beginners. For those interested in building their Java projects on top of Maven structure, the articles in the series may help.
For Java developers, Maven is not an alien word. It is much known as a very powerful tool used to build and manage Java projects with varying size and complexities. Aside from being powerful, it is also pervasive, which is exhibited by substantial presence across projects and entities. It is used by individual developers whose projects are being shared in the public repositories to big enterprises with a walled garden protecting the codebase.
This article is targeted to Maven first-timers who are fiddling with Maven on Windows and are in need of guide to installing, configuring, and using Maven for their next Java project. Even though Maven can work across different versions of Windows, the articles and reference images were created in the environment as specified below:
Operating System: Windows 7
Maven version: 3.x.x
Java version: 1.7+
After a long break in posting in this technology blog, I will start sharing things with you again. This time, I’ll start with a simple topic: Java IDE. Following this post, I hope I can share lots more useful and exciting stuff for you.
I have been a long fan of Eclipse IDE. For some Java developers, Eclipse can be a religion that is taken for granted. There are obviously some reasons behind this. Eclipse is free thus saving the souls of those who really count each penny they spend for their toys. Additionally, its richness in third party plugins, which is an equivalent expression for broad range of support from software/API vendors, oftentimes make Eclipse the first choice of Java IDE.
Nevertheless, you may agree with me that one aspect Eclipse is lacking is the usability. When talking about usability, I don’t necessarily mean the interface is horrible. Eclipse is intuitive enough and it can satisfy most of your development needs, until one point where you think you should find another alternative. I have found out that Eclipse can be cumbersome when it is used for multi-module big Java projects. To be more specific, big, multi-module Java projects that use Maven for the build management instead of ant do not really play satisfyingly well under Eclipse.
Recently, I started using IntelliJ IDEA, an IDE from JetBrains. I don’t want to excessively praise this IDE but there are some rooms where this IDE rocks and beats Eclipse, severely and predominantly. In Eclipse for example, it is not straightforward to create a hierarchical multi-module POM-based projects. In contrast, multi-module hierarchical POM-based projects are easy to create in IntelliJ IDEA. IntelliJ IDEA’s intellisense, or auto-complete feature, is also awesome. The breadth of languages and XML structure it supports is unexpected. Coding Groovy in Eclipse can be non-intuitive but IntelliJ IDEA provides seamless intellisense support for Groovy. Even the POM file structure can easily created, modified, and analyzed with the builtin intellisense. The presence of this feature will undoubtedly increase your productivity. There are some other nice features but I will let you find them by trying this IDE by yourself if you haven’t got your hands dirty with it before.
Now, back to the original question. What is your Java IDE? And let’s make this question more interesting: What is the best Java IDE that you ever knew?
In this post, I’d like to highlight another feature of PHP, the command line interface (CLI). In my personal experience, PHP CLI can be an alternative to some administrative tasks. Linux users may have been familiar with shell scripting for carrying out system management and configuration tasks. So, why must PHP? The answer is portability. The same PHP code should work not only on Linux but also on Windows. Some critics may argue that other languages may also have answer for portability. I concur to that criticism while at the same time emphasizing PHP as another viable option.
Previously, I have discussed about how to install MySQL on Fedora Linux. In this post, I would like to elaborate PHP installation on Fedora. Even though the installation is simple by nature, I would like to provide some notes to help you troubleshoot some post-installation problems that may occur.
As usual, I will provide the screenshots of the installation along with the commands invoked on the terminal. For the environment, some important settings are written below:
OS : Fedora 13 64-bit
Web server : Apache HTTP Server
PHP version : PHP 5.3.2
Constraints : yum is installed, commands invoked in root shell, Apache is already installed and running
Note: Apache is installed by default in Fedora. You only need to configure and verify that the server is running. How to configure Apache is explained in the online documentation. If you want the server to be public, i.e. accessible from other computers in the network, you should not firewall the HTTP port, which is usually port 80. Also, if you enable selinux, you also need to properly set the flag of some security parameters related to http. I will explain about selinux and http in another post.
Now, let’s move to the installation. Basic installation steps are as follows:
1. Install PHP via yum
root# yum install php
When you start to develop web application using Java, you may think to use Eclipse as the IDE. Assume that you have seen a good tutorial about Java servlet on the internet or read the chapter of a book discussing about web development using JSP.
You are now writing the first servlet by using the wizard provided by the IDE. However, as soon the template file is loaded on the source code editor, you encounter the infamous error “The import javax.servlet cannot be resolved” just like depicted in the figure below.