Archive

Archive for the ‘Installations’ Category

Eclipse with Tomcat

January 4th, 2009

I am going to use Eclipse for development. Because I am also going to use Flex I installed Flex Builder 3 which is actually a  version of Eclipse pre-configure by Adobe to contain Flex. I try to update Flex Builder with the necessary plugins, and also connect it to Tomcat. This is quite difficult task as I found while searching for help on the internet. The common advise I found to avoid complications is to have installed Flex Builder, and also Eclipse. So, I have both of them. 

To install Eclipse is a fact to go to the Eclipse website and choose the package you want to install and follow the instructions. 

To use Tomcat as a web server for the projects created with Eclipse I follow the instruction found this article: Eclipse WTP and Tomcat Tutorial. This article includes a link to a explanatory screencast. Eclipse IDE can start, reload, and stop Tomcat, and the projects become web application spaces automatically. It also allows to create ‘WAR’ files in order to deploy the application in another server.

Following the article instruction I found some problems. The first one was related to a message which Tomcat was displaying while starting. The message is: INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path. The article OSX: The Apache Tomcat Native library… was not found on the java.library.path help me to solve this problem.

The next problem was related to Tomcat and the context properties. I solve this with the indications found in this article: WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property

Another problem was related to the code in the example servlet ‘HelloWorld’. The tutorial will use this line of code: 

PrintWriter writer = response.getWriter();

This will display the error: ‘PrintWriter cannot be resolved to a type’. This is solved by adding this code in the ‘import’ part of the file:

import java.io.PrintWriter;

I have Eclipse now using tomcat.

Eclipse, Installations, Tomcat, Workstation

Git : Fast Version Control System

December 20th, 2008

An important area in software development is Revision control or Version Control. The most known software used for this kind of control, among others, are Concurrent Versions System (CVS) and Subversion (SVN). I was analyzing both of them trying to decided for the most convenient. A friend shared with me this interesting article: SNV vs CVS. I was almost deciding for SNV when I discover GIT.

What called my attention is that Git was initially created by Linus Torvalds for Linux kernel development, according to what I found in wikipedia. This informations is also interesting:

Several high-profile software projects now use Git for revision control, most notably the Linux kernel, Samba, X.org Server, Qt (toolkit), One Laptop per Child (OLPC) core development, Ruby on Rails web framework, VLC, Merb, Wine, SWI Prolog, DragonFly BSD and the Android mobile platform.

There is available an OSX Installer for Git: git-osx-installer, and also a Git Eclipse Plugin.

To install GIT in OSX is a matter of downloading the .dmg file and run the installer package found in it.

Useful Link: 

- Eclipse Git plugin installation

A Tour of Git, with Java and Eclipse

Git, Installations, Workstation

Ant in Workstation

December 18th, 2008

Apache Ant is a Java-based build tool which Tomcat uses to deploy web applications. More info here: http://ant.apache.org. The steps I used to install Ant in the MacBook are:

Download ANT from http://ant.apache.org/bindownload.cgi .
Extract the Ant files into the folder you want to install it.
Add the Ant /bin path to you ~/.profile file. In my case I added this line:
export PATH=/Users/italoosorio/Tomcat/Ant-home/bin:$PATH 

I am installing everything related to Tomcat development in my home/Tomcat folder.

Helpful link:

- http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/

Ant, Installations, Tomcat, Workstation

Tomcat in Workstation

December 18th, 2008

I decided to continue using JAVA as a programing language. I am using my laptop as developing environment, so I needed to install Tomcat in it. I followed the indication found in this web page: Installing Apache Tomcat 6 on Mac OS X Leopard. A summary of the steps used are the following:

Set the JAVA_HOME environment variable

Adding in the file ~/.profile the folling lines and restart the terminal:
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/Library/Tomcat/Home

Download and install the Tomcat binarie

Download Tomcat from the Apache Tomcat 6 Downloads Page
Change directories to the folder where you want to install Tomcat.
Create the Tomcat directory and set an appropriate owner and group:
> mkdir Tomcat
> chown <username> Tomcat
> chgrp admin Tomcat
Change directories to the newly created Tomcat directory and unpack the tar.gz files
> cd Tomcat
> tar -xvzf ~/Downloads/apache-tomcat-6.0.x.tar.gz
Create a symbolic link that will always point to the current version Tomcat directory
> ln -s apache-tomcat-6.0.x Home

Edit tomcat-users.xml configuration file

Change directories to the Tomcat configuration directory
> cd Home/conf
Edit the tomcat-users.xml file
> nano tomcat-users.xml
Add the following before </tomcat-users>, where <admin> is the administrator name you assign and <password> is the password. 
<user username=”<admin>” password=”<password>” roles=”standard,manager,admin”/> 
Save the tomcat-users.xml file and quit the editor

Run and Test

Change directories to where the Tomcat startup scripts are located
> cd ../bin
Remove the .bat scripts and .exe executables
> rm *.bat *.exe
Execute the Tomcat startup script
> ./startup.sh
Test in you navigator entering http://localhost:8080
To stop Tomcat execute the strip shutdown.sd
> ./shutdown.sh

 

I am not planning to have Tomcat as daemon process, I wan to activate it manually.

Installations, Tomcat, Workstation