Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

# rachota script
# JPackage Project <http://www.jpackage.org/>

# Source functions library
. /usr/share/java-utils/java-functions

# Source system prefs
if [ -f /etc/java/rachota.conf ] ; then
  . /etc/java/rachota.conf

# Source user prefs
if [ -f $HOME/.rachotarc ] ; then
  . $HOME/.rachotarc

# Configuration

# Set parameters
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.

share|improve this question
This should also be tagged JPackage, but I don't have the points yet. Could somebody please do that? – Ian Dunn May 23 '12 at 3:32
up vote 2 down vote accepted

The important part is the /usr/share/java-utils/java-functions file. I just found it online and it seems to support additional flags. After looking at the file (the run and the set_flags functions are the important ones) it seems that it should be enough to provide ADDITIONAL_FLAGS to the command:

ADDITIONAL_FLAGS="-Duser.language=en -Duser.country=GB" /usr/bin/rachota

If you want to debug it you may want to set VERBOSE to print more details about the executed argument:

VERBOSE=1 /usr/bin/rachota

If you want to have these settings persistent you can also set the variables directly in $HOME/.rachotarc or /etc/java/rachota.conf

share|improve this answer
I used ADDITIONAL_FLAGS="-Duser.language=en -Duser.country=GB" (without the /usr/bin/rachota), but it worked. Thanks :) – Ian Dunn May 23 '12 at 6:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.