Compile Glassfish on FreeBSD (JDK 1.5)
1) Install and add all those require and avaliable utilities software tools.
i) For installation of JDK:
Since Sun does not have official JDK 1.5 on FreeBSD platform. Therefore, we either have to build our own jdk from the source(note 1), or with the help from FreeBSD’s java user group, there is a port version of jdk 1.5 being done (download and install from here).
ii) For installation of Apache Maven
$cd /usr/ports/devel/maven
$make install clean
iii) For installation of Apache ANT
$cd /usr/ports/devel/apache-ant
$make install clean
iv) For installation of ported NSS -
$cd /usr/ports/security/nss
$make install clean
v) For installation of ported NSPR -
$cd /usr/ports/devel/nspr
$make install clean
2) Environment setting after step 1 is done :
For example: bash shell default environment setting:
JAVA_HOME=/usr/local/diablo-jdk1.5.0
MAVEN_HOME=/usr/local/share/java/maven
ANT_HOME=/usr/local/share/java/apache-ant
CVSROOT=:pserver:@cvs.dev.java.net:/cvs
PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH
export JAVA_HOME MAVEN_HOME ANT_HOME CVSROOT PATH
3) Checking out the GlassFish source and building from scratch or download the source bundle from here
1. The first step is to checkout the module dependencies and common files used in the build system and edit the properties file.
$mkdir workspace
$cd workspace
$cvs -d :pserver:@cvs.dev.java.net:/cvs co -r SJSAS91_UR1_BRANCH glassfish/bootstrap
This will checkout project.xml, maven.xml, project.properties, and common files referenced from project.xml.
Edit glassfish/bootstrap/project.properties for the following properties name value:
glassfish.os.name=Darwin
glassfish.cvs.username=
In Default, glassfish project will install at ${glassfish.home} , if you want to install other path you must change ${glassfish.home} in file project.properties
${glassfish.home}=/usr/local/glassfish
2. Next checkout the sources.
$cd glassfish/bootstrap
$maven checkout
Edit /glassfish/appserv-core-ee/appserv-core/build.xml
And change source from “${javac.source}” to “1.5″
$vi /glassfish/appserv-core-ee/appserv-core/build.xml
source=”1.5″
3. Bootstrap the server image (a collection of image and jar files used to run glassfish).
$maven bootstrap-all
or
$maven bootstrap (only if you have build before)
4. Build the checked out source code.
$maven build
5. Configure the GlassFish Server runtime. This step will create the asadmin script, run create-domain, etc which are needed to run the GlassFish server.
$maven configure-runtime
6. Starting up the server using the asadmin command in /publish/bin directory.
/publish/bin/asadmin start-domain
7. Install you server, Edit setup.xml to set a port ant username and password
$cd /publish/gashfish
$chmod -R +x lib/ant/bin
$lib/ant/bin/ant -f setup.xml
7. Start accessing the newly compile build GlassFish (Java EE).
From any browser:
http://hostname:4848
http://hostname:8080
I really like your post. Does it copyright protected?