1. Download a jre from the Java site
2. extract it in a folder (e.g. /usr/lib/jre-1.6.0_27)
3. in Eclipse: Window->Preferences->Java->Installed JREs->Add…->ecc…
4. create the script below for this jre
. Rename your java application:
sudo mv /usr/lib/jvm/java-6-openjdk/jre/bin/java /usr/lib/jvm/java-6-openjdk/jre/bin/java.ori
2. Create the script /usr/lib/jvm/java-6-openjdk/jre/bin/java with the following content:
#!/bin/bash gksudo "/usr/lib/jvm/java-6-openjdk/jre/bin/java.ori $*"
3. Change the permissions to make it executable:
In this way, the java application asks always the root password and it starts with root privileges.