Menu

Installing a Development Environment

James M. Payne

These instructions are based on my development environments, and facilitate running multiple, simultaneous environments.

Create a Base Folder

The base folder is just for keeping things clean on the drive.

Example:

:::script
Windows: C:\development
Linux: ~/development

Install OpenJDK 11

Windows
Download OpenJDK 11, and unzip the file to your base folder. To make it easier to handle updates, I would suggest renaming the folder to jdk. The following instructions assume you did this.

Example:

:::script
C:\development\jdk

Add the JAVA_HOME environment variable, and set the value to C:\development\jdk
Edit the PATH environment variable, and add ;%JAVA_HOME%\bin

Linux
Use the Linux distribution's installation for OpenJDK 11.

Both
Test the installation by opening a command prompt and typing: java -version You should get the following result:

:::script
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

Create an Environment Folder

Create a folder in your base folder to house the components of your development environment.

Example:

:::script
Windows: C:\development\env_one
Linux: ~/development/env_one

Install Eclipse

Download Eclipse IDE for Enterprise Java Developers (Windows 64-bit for Windows; Linux 64-bit for Linux), and unzip or untar the file to your environment folder.

Example:

:::script
Windows: C:\development\env_one\eclipse
Linux: ~/development/env_one/eclipse

Install Tomcat

Download Tomcat (64-bit Windows zip for Windows; tar.gz for Linux), and unzip or untar to your environment folder. To make it easier to handle updates, I would suggest renaming the folder to tomcat (or creating a symbolic link). The following instructions assume you did this.

Example:

:::script
Windows: C:\development\env_one\tomcat
Linux: ~/development/env_one/tomcat

Copy all needed JARs to Tomcat's lib folder. This includes roth-lib.jar and all JARs referenced in [Installing Roth].
Copy all Roth.war, RothDeveloper.war, and RothInstaller.war to Tomcat's webapps folder.

Note: Why do I do it this way? Roth takes a shared library approach. Installing JARs this way allows all applications running on the Tomcat instance to use the same library instances. This prevents the overhead of multiple instances of libraries running for each appliction, and it also allows for a single application context for each of the libraries. This means that if the context is updated by one application, all other applications are then aware of the change. Roth's runtime Log settings depend on this.

Additional Note: If you intend to develop on Roth source code, then do not copy the WARs above. Instead, you will run those applications from the source projects in Eclipse. This will have additional information provided later.

Create a Workspace

Create a workspace folder in your environment folder.

Example:

:::script
Windows: C:\development\env_one\workspace
Linux: ~/development/env_one/workspace

Configure Eclipse

Run Eclipse (C:\development\env_one\eclipse\eclipse.exe or ~/development/env_one/eclipse/eclipse), and do the following:

Close the Welcome screen (if you don't want to see it again, uncheck the checkbox in the corner first).

Go to Window / Preferences

Expand General, and select Workspace
In Window title / Show workspace name:, enter the name (example: "Environment One")
You may also want to include the port number it will run on (if running a multi-environment, each environment will run on a different port).

Go to the Servers tab, and add a new server.

Expand Apache, and select Tomcat v9.0 Server
Browse to the environment's Tomcat folder, then click through to Finish.

Double-click the new server to open it's settings.

In Server Locations, select Use Tomcat installation (takes control of Tomcat installation)
If adding the useFetchSizeWithLongColumn from [Installing Roth], then click on Open launch configuration, select Arguments, then add the reference to VM arguments
Type Ctrl-S to save the changes.

Go to the Servers project on the left, and edit the server.xml and context.xml files as described in [Installing Roth] under the Tomcat Configuration heading. In addition, update the port settings as described in Appendix A: Port Selection below.

Appendix A: Port Selection

To run a multi-environment, each environment must run on different ports. To make this smooth and predictable, I suggest the following pattern:
* Server Port: 8x05
* AJP Port: 8x09
* HTTP Port: 8x80
* HTTPS/Redirect Port: 8x43
Where x is the environment number from 0 to 9. This allows for up to ten environments on the same workstation, that can all run at the same time and not interfere with each other.

Example:

:::xml
<Server port="8105" shutdown="SHUTDOWN">
    <Connector port="8180" protocol="HTTP/1.1" ... redirectPort="8143"/>
    <Connector port="8109" protocol="AJP/1.3" ... redirectPort="8143"/>
    <Connector port="8143" protocol="HTTP/1.1" scheme="https" ... />
    ...
 </Server>

Note the big change here: HTTPS uses 8143 instead of the default 8443. Environment 2 can use 8205, 8209, 8280, and 8243. Thus 8443 becomes the HTTPS port for environment 4.


Related

Wiki: Home
Wiki: Installing Roth