Here we will see how to prepare a development environment to make use of Concordion. Before using Concordion, you need to set up JDK, Tomcat, and Eclipse on your system. Let's go step by step.
You can download the latest version of JDK from Oracle's Java site: Java SE Downloads. You will find instructions for installing JDK in downloaded files. Just follow the given instructions to install and configure the setup. Finally set the PATH and JAVA_HOME environment variables to refer to the directory that contains java and javac, typically java_install_dir/bin and java_install_dir respectively.
If you are running Windows and you have installed the JDK in C:\jdk1.7.0_75, you would have to put the following line in your C:\autoexec.bat file.
set PATH=C:\jdk1.7.0_75\bin;%PATH% set JAVA_HOME=C:\jdk1.7.0_75
Alternatively, on Windows NT/2000/XP, you could also right-click on My Computer, select Properties, then Advanced, and Environment Variables. Then, you would update the PATH value and press the OK button.
On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk1.7.0_75 and you use the C shell, you would put the following into your .cshrc file.
setenv PATH /usr/local/jdk1.7.0_75/bin:$PATH setenv JAVA_HOME /usr/local/jdk1.7.0_75
Alternatively, if you are using an Integrated Development Environment (IDE) like Borland JBuilder, Eclipse, IntelliJ IDEA, or Sun ONE Studio, then compile and run a simple program to confirm that the IDE knows where you installed Java, otherwise do proper setup as given in the document of the IDE.
All the examples in this tutorial have been written using Eclipse IDE. So we would suggest you should have the latest version of Eclipse installed on your system.
To install Eclipse IDE, download the latest Eclipse binaries from http://www.eclipse.org/downloads/. After downloading the installation, unpack the binary distribution into a convenient location. For example in C:\eclipse on Windows, or /usr/local/eclipse on Linux/Unix and finally set the PATH variable appropriately.
Eclipse can be started by executing the following commands in Windows environment, or you can simply double click on eclipse.exe
Eclipse can be started by executing the following commands on a Unix (Solaris, Linux, etc.) machine −
After a successful startup, if everything is fine, then it should display the following result −
Download the latest version of JUnit jar file from http://www.junit.org. At the time of writing this tutorial, we downloaded Junit-4.10.jar and copied it into C:\>JUnit folder.
Set the JUNIT_HOME environment variable to point to the base directory location where JUnit jar is stored on your machine. Let's assume we've stored junit4.10.jar in the JUNIT folder, then you need to take any of the following actions depending on the OS you are working on −
|Windows||Set the environment variable JUNIT_HOME to C:\JUNIT|
Set the CLASSPATH environment variable to point to the JUNIT jar location. Let's assume we've stored junit4.10.jar in the JUNIT folder, then you need to take any of the following actions based on the OS you are working on −
|Windows||Set the environment variable CLASSPATH to %CLASSPATH%;%JUNIT_HOME%\junit4.10.jar;.;|
Now you can proceed to set up your Concordion libraries. Follow the simple steps given below to download and install the framework on your machine.
Download the latest version of Concordion framework binaries from http://concordion.org/download/java/markdown/.
At the time of writing this tutorial, we downloaded Concordion-1.5.1 on our Windows machine. When you unzip the downloaded file, it will give you the following directory structure inside E:\Concordion-1.5.1.
lib − Library folder
src − Source code folder
You will find all the Concordion dependency libraries in the directory E:\Concordion\lib. Make sure you set your CLASSPATH variable on this directory properly, otherwise you will face problems while running your application. If you are using Eclipse, then it is not required to set CLASSPATH because all the setting will be done through Eclipse.
Once you are done with this last step, you are ready to proceed for your first Concordion Example which you will see in the next chapter.Print