[javac] The system is out of resources.
[javac] Consult the following stack trace for details.
[javac] java.lang.OutOfMemoryError: Java heap space
# get OLAT source
cd ~/download
wget http://www.olat.org/downloads/stable/OLAT-6.2.2.zip
unzip OLAT-6.2.2.zip
mv olat3 OLAT-6.2.1
mv OLAT-6_2_2-PUBLIC-* olat3
cd olat3
# config build.properties
sed -e "s/\/usr\/local\/opt\/olat\/olat3/\/home\/andowson\/download\/olat3/g" \
-e "s/\/usr\/local\/opt\/olat\/olatdata/\/home\/andowson\/data\/olatdata/g" \
-e "s/\/usr\/local\/opt\/tomcat/\/var\/tomcat6/g" \
-e "1,$$s/www.myolat.com/www.andowson.com/g" \
-e "1,$$s/myolat.com/andowson.com/g" \
-e "1,$$s/myolat/andowson/g" \
-e "s/server.modjk.enabled=false/server.modjk.enabled=true/g" \
-e "55a\server.modjk.jvmRoute=worker1" \
-e "s/defaultcharset=ISO-8859-1/defaultcharset=UTF-8/g" \
-e "s/registration.enableNotificationEmail=false/registration.enableNotificationEmail=true/g" \
-e "s/smtp.host=smtp.andowson.com/smtp.host=smtp.other.com/g" \
-e "s/smtp.user=/smtp.user=username/g" \
-e "s/smtp.pwd=/smtp.pwd=password/g" \
-e "121,143d" \
-e "1,$$s/#db/db/g" \
-e "1,$$s/net.sf.hibernate/org.hibernate/g" \
-e "s/instantMessaging.server.name=jabber.andowson.com/instantMessaging.server.name=www.andowson.com/g" \
-e "s/instantMessaging.db.name=wildfire/instantMessaging.db.name=openfire/g" \
-e "s/instantMessaging.db.user=wildfire/instantMessaging.db.user=openfire/g" \
-e "s/instantMessaging.db.pass=wildfire/instantMessaging.db.pass=openfire/g" \
-e "s/cluster.catalinaport=8006/cluster.catalinaport=8105/" \
-e "s/cluster.ajpport=8009/cluster.ajpport=8109/" build.properties.default > build.properties
# adjust the original template config files
# enable zh_CN and zh_TW on the top right menu
sed -i -e "s/<enabledLanguages>en,de,fr,it,es<\/enabledLanguages>/<enabledLanguages>en,de,fr,it,es,zh_CN,zh_TW<\/enabledLanguages>/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in
# change domain name in email address
sed -i -e "1,$$s/olat-newinstallation.org/andowson.com/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in
# fix the commnet style in XML
sed -i -e "13c\ <\!-- default session timeout -->" ~/download/olat3/webapp/WEB-INF/web.xml.in
# remove findbugs setting
sed -i -e "1348,1361d" build.xml
ant config-all
# to avoid OutOfMemoryError
export ANT_OPTS=-Xmx128m
ant build
# stop Tomcat
sudo /etc/init.d/tomcat stop
# backup db
sudo -u postgres pg_dump olat > /tmp/olat.bak
# copy to the target directory
sudo mv ~/www/olat /tmp/olat-6.2.1
cp -rf ~/download/olat3/webapp ~/www/olat
cp -rf ~/download/olat3/htdocs/* ~/www/olat
sudo chmod 775 ~/www/olat/static
sudo chmod 775 ~/www/olat/WEB-INF
sudo chmod 775 -R ~/data/olatdata
# start Tomcat
sudo /etc/init.d/tomcat start