From 4ff2773a6de39c3d0f5fdeb76598457a66320ceb Mon Sep 17 00:00:00 2001 From: kornaf Date: Tue, 17 Apr 2007 16:58:38 +0000 Subject: [PATCH] Added stuff and knowhow for running java applications on linux clients git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@1073 a7169a2c-3604-0410-bc95-c702d8d87f7a --- dcapi/java/example/boinc-java-launcher | 24 ++++++++++++ dcapi/java/example/compile | 5 +++ dcapi/java/example/manifest | 1 + dcapi/java/jre-boinc/jre_for_boinc_guide.txt | 41 ++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 dcapi/java/example/boinc-java-launcher create mode 100644 dcapi/java/example/compile create mode 100644 dcapi/java/example/manifest create mode 100644 dcapi/java/jre-boinc/jre_for_boinc_guide.txt diff --git a/dcapi/java/example/boinc-java-launcher b/dcapi/java/example/boinc-java-launcher new file mode 100644 index 0000000000..b111b9b35f --- /dev/null +++ b/dcapi/java/example/boinc-java-launcher @@ -0,0 +1,24 @@ +#!/bin/sh + +# +# Script to launch java applications in a BOINC environment +# + +set +v + +file=`sed -n '/^/ s/<[^>]*>//gp' libdc-jre.tar` + +jar=`sed -n '/^/ s/<[^>]*>//gp' Uppercase.jar` + +if + [ ! -d jre ] +then + tar xzf $file +fi + + path=`pwd` + + LD_LIBRARY_PATH=$path/lib + export LD_LIBRARY_PATH + +./jre/bin/java -jar $jar \ No newline at end of file diff --git a/dcapi/java/example/compile b/dcapi/java/example/compile new file mode 100644 index 0000000000..aad169bebf --- /dev/null +++ b/dcapi/java/example/compile @@ -0,0 +1,5 @@ +#!/bin/sh + +javac uppercase.java + +jar cmf manifest Uppercase.jar Uppercase.class hu \ No newline at end of file diff --git a/dcapi/java/example/manifest b/dcapi/java/example/manifest new file mode 100644 index 0000000000..b371ae7cba --- /dev/null +++ b/dcapi/java/example/manifest @@ -0,0 +1 @@ +Main-Class: Uppercase diff --git a/dcapi/java/jre-boinc/jre_for_boinc_guide.txt b/dcapi/java/jre-boinc/jre_for_boinc_guide.txt new file mode 100644 index 0000000000..fe7b14faee --- /dev/null +++ b/dcapi/java/jre-boinc/jre_for_boinc_guide.txt @@ -0,0 +1,41 @@ +Guide for preparing Java Runtime Environment (JRE) +for use in a BOINC infrastructure on Linux clients. +--------------------------------------------------- + +1. Requirements +--------------- + + i. JRE available at http://java.sun.com/javase/downloads/index.jsp + + ii. DC-API for java (libdc-java-client-0.9.so, libdc-boinc-client.so) + +2. Preparing +------------ + + i. Extract the 'bin' and 'lib' directories from the JRE distribution. + This can be done, by installing JRE on a machine and locating the + necessary directories in the installation directory. + Copy these two directories with all of their content to a directory + called jre. + + ii. Put the files of DC-API in a directory called lib + + iii. Tar the contents of the above directories (jre, lib) in an archive + called lidc-jre.tar + eg.: tar czvf lidc-jre.tar jre lib + + +3. Deploying a java application on a BOINC server +------------------------------------------------- + + i. The java application on BOINC consists of the following + a. libdc-jre.tar - the jre prepared in part 2. + b. application.jar - the java application to be run in BOINC + c. launcher - script that untars jre and calls java with the + jar of the application on the client computer + + ii. Give execution rights to the launcher script only. + + iii. Proceed with signing the files and installing them to the boinc server as usual... + +