I installed Rachota -- a time tracking program written in Java -- from the Fedora repo, and yum installed the rachota.jar
file to /usr/share/java
, but it also created a script at /usr/bin/rachota
. That script is used to launch Rachota, instead of calling java
directly.
I'm trying to figure out if there's a way to pass command line arguments to the /usr/bin/rachota
script and get them passed to java
.
The script is part of the JPackage project and looks like this:
#!/bin/sh
#
# rachota script
# JPackage Project <http://www.jpackage.org/>
# Source functions library
_prefer_jre="true"
. /usr/share/java-utils/java-functions
# Source system prefs
if [ -f /etc/java/rachota.conf ] ; then
. /etc/java/rachota.conf
fi
# Source user prefs
if [ -f $HOME/.rachotarc ] ; then
. $HOME/.rachotarc
fi
# Configuration
MAIN_CLASS=org.cesilko.rachota.gui.MainWindow
BASE_FLAGS=""
BASE_OPTIONS=""
BASE_JARS="rachota"
# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"
Obviously it's parsing /etc/java/rachota.conf
and $HOME/rachotarc
, but my shell scripting experience is pretty limited, and I can't figure out what to put in the $HOME/.rachotarc
file to pass the arguments.
This is the java command I want to eventually run:
java -Duser.language=en -Duser.country=GB -jar /usr/share/java/rachota.jar
The jar
parameter is passed automatically, but I want to pass the Duser.language
and Duser.country
parameters too.
JPackage
, but I don't have the points yet. Could somebody please do that?