Project

General

Profile

Automating Installation of a Developer Workstation

This chapter describes how to install an Ubuntu Desktop OS to be used as a FWD developer station. The prerequisite is to have a clean install of Ubuntu Desktop OS (in a VM or a physical machine) with internet access.

Prerequisites

To be able to develop or debug your FWD conversion project, the following depencies need to be installed. Run the commands in each section:

Install OpenJDK 8

sudo apt-get install openjdk-8-jdk openjdk-8-source
cd /usr/lib/jvm
sudo rm default-java
sudo ln -s java-8-openjdk-amd64 default-java
sudo rm /usr/lib/libjvm.so
sudo ln -s /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so /usr/lib/libjvm.so

Install libffi and ANT

sudo apt-get install libffi-dev ant

Enable Source Packages

sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
sudo sed --in-place 's/# deb-src/deb-src/' /etc/apt/sources.list
sudo apt-get -q -y update
sudo apt-get -q -y upgrade

Download Required Files

Links

https://proj.goldencode.com/downloads/vm/setup/ncurses_terminfo.zip

https://proj.goldencode.com/downloads/vm/setup/locale_install.sh

https://proj.goldencode.com/downloads/vm/setup/pljava_install_9.4.sh
https://proj.goldencode.com/downloads/vm/setup/psql_create_cluster_9.4.sh
https://proj.goldencode.com/downloads/vm/setup/psql_install_9.4.sh

https://proj.goldencode.com/downloads/vm/setup/init-fwd.sh

https://proj.goldencode.com/downloads/vm/setup/init-workspace.sh
https://proj.goldencode.com/downloads/vm/setup/eclipse_luna_fwd.zip
https://proj.goldencode.com/downloads/vm/setup/workspace.zip
https://proj.goldencode.com/downloads/vm/setup/p2j_conversion_project.zip
https://proj.goldencode.com/downloads/vm/setup/p2j_project_meta.zip

Download via Command Line

install -d ~/setup
cd ~/setup
wget https://proj.goldencode.com/downloads/vm/setup/ncurses_terminfo.zip
wget https://proj.goldencode.com/downloads/vm/setup/locale_install.sh
wget https://proj.goldencode.com/downloads/vm/setup/psql_create_cluster_9.4.sh
wget https://proj.goldencode.com/downloads/vm/setup/pljava_install_9.4.sh
wget https://proj.goldencode.com/downloads/vm/setup/psql_install_9.4.sh
wget https://proj.goldencode.com/downloads/vm/setup/init-fwd.sh
wget https://proj.goldencode.com/downloads/vm/setup/init-workspace.sh
wget https://proj.goldencode.com/downloads/vm/setup/eclipse_luna_fwd.zip
wget https://proj.goldencode.com/downloads/vm/setup/workspace.zip
wget https://proj.goldencode.com/downloads/vm/setup/p2j_project_meta.zip
wget https://proj.goldencode.com/downloads/vm/setup/p2j_conversion_project.zip

FWD Dependencies

In this section, we configure the OS to be compatible with the FWD Application Server and the FWD Client(s). Follow the commands in each section, in the order defined.

Automate Terminfo and NCURSES patch

cd ~/setup
unzip ncurses_terminfo.zip
sudo cp -R root /

When NCURSES is updated, it needs to be repatched. This tool will add a cron job which will check every hour if there was an update - in this case, it will run the manage_term_patches.sh script.

sudo cp -R etc /
sudo chmod 0644 /etc/cron.d/term_patches

Patch NCURSES - First Time Usage

sudo su
cd ~
./manage_term_patches.sh
exit

Initialize the FWD and Hotel Demo Projects

The init-fwd.sh script will download the latest FWD, Hotel ChUI and Hotel GUI projects and place them in the ~/projects/ folder. At end, it will also build FWD.

WARNING: this script is destructive - it will replace the existing ~/projects/p2j, ~/projects/hotel_chui and ~/projects/hotel_gui/ folders with the latest versions!

cd ~/setup
./init-fwd.sh

FWD Eclipse Development

The init-workspace.sh script will:
  • install Eclipse Luna in ~/eclipse/ folder
  • install the default Eclipse Workspace folders in ~/projects/
  • create the P2JConversionProject

To run the script, execute:

cd ~/setup/
./init-workspace.sh

Install en_US@p2j_basic locale

cd ~/setup
sudo ./locale_install.sh

Install p2jspi.jar

cd ~/projects/p2j/build/lib
sudo cp p2jspi.jar /usr/lib/jvm/default-java/jre/lib/ext/
sudo chmod gou+r /usr/lib/jvm/default-java/jre/lib/ext/p2jspi.jar

PostgreSQL Install

Install PostgreSQL 9.4

cd ~/setup
sudo ./psql_install_9.4.sh

Install PL/Java

cd ~/setup
sudo apt-get install maven git libssl-dev libgss-dev libkrb5-dev
sudo ./pljava_install_9.4.sh

After the PL/Java installation is done, edit the /usr/share/postgresql/9.4/extension/pljava--1.0.sql file and add these two lines at the top:

sudo vi /usr/share/postgresql/9.4/extension/pljava--1.0.sql
SET PLJAVA.CLASSPATH='/usr/share/postgresql/9.4/extension/pljava--1.0.jar';
SET PLJAVA.VMOPTIONS='-Xmx16m';

Create the Default Cluster

PostgreSQL main cluster is configured to listen on port 5433. Use pg_lsclusters to see the installed and running clusters. You may need to reboot the OS after this step is done.

When running the psql_create_cluster_9.4.sh, you will be prompted of a password: enter the password for a user with sudo rights.

cd ~/setup
sudo cp psql_create_cluster_9.4.sh /var/lib/postgresql
sudo chown postgres:postgres /var/lib/postgresql/psql_create_cluster_9.4.sh
sudo su postgres
cd ~
chmod +x psql_create_cluster_9.4.sh
./psql_create_cluster_9.4.sh
exit