Indlæg

Viser indlæg fra 2012

Distributing Liferay including custom portlets, hook, ext etc

Been working on Liferay (CE 6.1.1) for a couple of months now.
I ended up with a task about creating a script that could automate deployment of Liferay, a database server and all the war archives we created (portlets, ext, hooks, themes etc).

I used PostgreSQL (9.1.6) as the database.

The documentation on this was pretty fragmented so I thought I might as well publish the complete script here:

#!/bin/bash

####################################################
# Install the postgres database                    #
####################################################
tar -zxvf ~/Downloads/postgresql-9.1.6-1-linux-x64-binaries.tar.gz
pgsql/bin/initdb -D pgsql/data
pgsql/bin/pg_ctl start -w -D pgsql/data/ -l postgres.logs
pgsql/bin/createuser --no-createdb --no-createrole --no-superuser schneider
pgsql/bin/createdb lportal -O schneider
####################################################
# Install liferay bundle including tomcat          #
####################################################

Installing Oracle Java (JDK) on openSUSE

There is a guide for installing the JRE from Oracle here. Most of these steps also works for the JDK.

I did not install the IcedTea plugin and the openJDK.

Other than that the compiler (javac) also needs to be updated. To do that run the following commands:

update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/64/jdk1.6.0_31/bin/javac" 1
update-alternatives --set javac /opt/java/64/jdk1.6.0_32/bin/javac
For the java browser plug-in it is also possible to use update-alternatives to change the browser plug-in:

sudo /usr/sbin/update-alternatives --install /usr/lib64/browser-plugins/javaplugin.so javaplugin /opt/java/jdk1.7.0_25/jre/lib/amd64/libnpjp2.so 3 --slave /usr/bin/javaws javaws /opt/java/jdk1.7.0_25/jre/bin/javaws --slave /usr/share/man/man1/javaws.1 javaws.1 /opt/java/jdk1.7.0_25/man/man1/javaws.1
update-alternatives --config javaplugin

My first tablet: A Galaxy Tab 10.1 review

My first impressions with the Galaxy Tab 10.1 I recently got my first tablet. I ended up with the Samsung Galaxy Tab 10.1. I did consider the iPad 2 & 3.
My reasons for going with the Android tablet were:
I have already invested in the Android platform in the form of my Nexus S phone.The iPads tight integration with iTunes for transferring were not ideal.The tablet were also ment as entertainment for the kids and the flash support would give access to more online universes for the kids. On the other hand the iPad had a few more danish apps for the kids. But flash support won that battle.The better cameras that I use for video calls also spoke in favor of the Galaxy Tab. Using a Google Apps account with the tablet I used my Google Apps account to setup the Galaxy Tab. When I tried to access the Google Play store my searches didn't return any results.
I tried to google it but I couldn't find any information on what could cause this. One day I added a "classic" Goog…

Executing process from java...

Everytime I need to launch a native program from Java I always end up with this old guide. It covers all that is needed to execute a native application from Java.

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

If you are fine with including 3rd party libraries here is a guide using the Executor from the apache commons project:
http://java.dzone.com/articles/executing-command-line