How to Run ADempiere on OpenSolaris
Contents
Introduction
If you're interested in running ADempiere on OpenSolaris and don't know how, well, this page is for you! Since OpenSolaris libraries differ from Linux, we should do some tricks to setup the environment and libraries.
Pre-assumptions
The only pre-assumption of this article is that "You are using BASH" as the command shell. If not you can be simply doing so by typing
% bash
at command line.
Preparing the enviroment
In order to run ADempiere on OpenSolaris, there are some libraries and softwares that must be installed. This guide is arranged in the way that may be run within a single terminal and there's no need to close the terminal after each step -in fact, it is recommended in order to avoid setting the PATH variable each time you open terminal.
Required source packages
- GNU make (version I used: 3.81).
- GNU binutils (version I used: 2.17)
- PostgreSQL (version I used: 8.2.3)
- GCC (version I used: 4.1.2)
- PLJava (version I used: 1.3.1). I'd strongly recommend getting the source from CVS.
Setting up directories
First we must make some directories to install the new softwares into.
$ su root -c 'install -d -m 777 -u bin -g bin /opt/gnu; install -d -m 777 -u bin -g bin /opt/pgsql-8.2.3;' $ su root -c 'install -d /var/lib/pgsql; chown -R postgres:postgres /var/lib/pgsql; chmod -R 700 /var/lib/pgsql'
Installing GNU make
We need GNU make to be able to build other softwares. Extract the archive and CD into the new directory then issue the followings at the command line.
$ ./configure --prefix=/opt/gnu $ dmake $ dmake install $ export PATH=/opt/gnu/bin:$PATH
Installing GNU binutils
Utilities such as archiver, assembler, linker are vital to compiling GCC. Extract the archive and CD into the new directory then issue the followings at the command line.
$ export PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin $ ./configure --prefix=/opt/gnu $ make $ make install
Installing PostgreSQL
It's time for the sweet OS RDBMS. Extract the archive and CD into the new directory then issue the followings at the command line. GNU readline library caused Java textboxes/areas to act strangely so I omitted installing it.
$ ./configure --prefix=/opt/pgsql-8.2.3 --without-readline $ make $ make install
Initialising the database
An uninitialised PostgreSQL database is like a honeyless bee!! Let's provide our bee with some honey :-) Issue the followings at the command line.
$ su postgres
If you haven't set a password for postgres user yet you may do so with
$ su root -c 'passwd postgres'
After logging in as postgres:
% bash # export PATH=/opt/pgsql-8.2.3/bin:$PATH # cd /var/lib/pgsql # initdb -D data # echo "listen_addresses = '*'" >> data/postgresql.conf # pg_ctl -D data -w -l logfile start # psql
Now you should be logged in to PostgreSQL instance. Type \q to quit psql.
# pg_ctl -D data -w -l logfile stop # logout %logout
Installing GCC
Mighty GCC is required to compile PL/Java. Extract the archive and CD into the new directory then issue the followings at the command line. If you'd like to add more languages to be supported, add them to the configure command, but I won't guarantee that GCC will be compiled if you change the switches.
$ ./configure --prefix=/opt/gnu --enable-languages=c --disable-shared --with-java-home=/usr/java --disable-libgcj $ make
By the way, it's time to have a cup of tea or take a shower as the process takes about 15~20 mins and produces hundreds of warnings!
$ make install
Installing PL/Java
And the last software is the tricky PL/Java. In fact, most of the above softwares are installed just to compile PL/Java! So, don't hesitate; let's get it done!
$ su root -c 'cd /usr; ln -s /usr/jdk/instances/jdk1.5.0 java;' $ su root -c 'crle -u -l /opt/gnu/lib:/usr/sfw/lib' $ export JAVA_HOME=/usr/java $ export PATH=/opt/pgsql-8.2.3:$PATH
Extract the PL/Java archive and CD into the new directory.
$ make $ make install $ cp src/sql/*.sql /opt/pgsql-8.2.3/share
The library and the jar files are copied to /opt/pgsql-8.2.3/lib.
Installing PL/Java into PostgreSQL
Yet not done with PL/Java. Now we need to tell PostgreSQL how to use it.
$ su root -c 'crle -u -l /usr/java/jre/lib/i386:/usr/java/jre/lib/i386/client:/usr/java/jre/lib/i386/native_threads' $ su postgres % bash # cd /var/lib/pgsql # echo "custom_variable_classes = 'pljava'" >> data/postgresql.conf # echo "dynamic_library_path = '\$libdir:/opt/pgsql-8.2.3/lib'" >> data/postgresql.conf # echo "pljava.classpath = '/opt/pgsql-8.2.3/lib/pljava.jar'" >> data/postgresql.conf # pg_ctl -D data -w -l logfile start
Now we install PL/Java into the ADempiere database.
# psql -d adempiere -U adempiere -f /opt/pgsql-8.2.3/share/install.sql # logout % logout
Importing ADempiere database
Extract the ADempiere archive and CD into the new directory.
$ cp lib/sqlj.jar /opt/pgsql-8.2.3/share $ unzip -d /tmp data/Adempiere_pg.jar $ psql -d adempiere -U adempiere -f /tmp/Adempiere_pg.dmp
Here we install ADempiere sqlj Jar file into the ADempiere database.
$ psql -d adempiere -U adempiere adempiere=# create schema authorization adempiere; adempiere=# set search_path to adempiere, sqlj; adempiere=# select sqlj.install_jar('file:///opt/pgsql-8.2.3/share/sqlj.jar', 'adempiere', true); adempiere=# adempiere=# select sqlj.set_classpath('adempiere', true); adempiere=# \q
Running ADempiere
Ah! Finally the last step! CD into ADempiere directory.
$ chmod +x *.sh $ chmod +x utils/*.sh $ ./RUN_setup.sh $ cd utils $ ./RUN_Server2.sh
Open a new terminal and CD into ADempiere directory.
$ export ADEMPIERE_HOME=`pwd` $ ./RUN_Adempiere.sh
That's done it! Congratulations! You're now running ADempiere on OpenSolaris.
See Also
Screenshots:
The following links were of much help: