diff --git a/classpath.sh b/classpath.sh index d38309122..a2ab8fe47 100755 --- a/classpath.sh +++ b/classpath.sh @@ -1,7 +1,7 @@ #!/bin/bash -echo -ne "build" -for i in `ls lib/*.jar`; do +echo -ne "$OLTPBENCH_HOME./build" +for i in `ls $OLTPBENCH_HOME./lib/*.jar`; do # IMPORTANT: Make sure that we do not include hsqldb v1 if [[ $i =~ .*hsqldb-1.* ]]; then continue diff --git a/oltpbenchmark b/oltpbenchmark index f2d511427..393a9a05b 100755 --- a/oltpbenchmark +++ b/oltpbenchmark @@ -1,3 +1,3 @@ #!/bin/bash -java -Xmx8G -cp `./classpath.sh bin` -Dlog4j.configuration=log4j.properties com.oltpbenchmark.DBWorkload $@ - +# OLTPBENCH_HOME should be empty or end with "/" +java -Xmx8G -cp `$OLTPBENCH_HOME./classpath.sh bin` -Dlog4j.configuration=$OLTPBENCH_HOME./log4j.properties com.oltpbenchmark.DBWorkload $@ diff --git a/src/com/oltpbenchmark/DBWorkload.java b/src/com/oltpbenchmark/DBWorkload.java index 89f2559fa..5772aad1a 100644 --- a/src/com/oltpbenchmark/DBWorkload.java +++ b/src/com/oltpbenchmark/DBWorkload.java @@ -84,7 +84,10 @@ public static void main(String[] args) throws Exception { CommandLineParser parser = new PosixParser(); XMLConfiguration pluginConfig=null; try { - pluginConfig = new XMLConfiguration("config/plugin.xml"); + String oltpbench_home = System.getenv("OLTPBENCH_HOME"); + // OLTPBENCH_HOME should be empty or end with "/" + oltpbench_home = oltpbench_home == null ? "" : oltpbench_home + "/"; + pluginConfig = new XMLConfiguration(oltpbench_home + "config/plugin.xml"); } catch (ConfigurationException e1) { LOG.info("Plugin configuration file config/plugin.xml is missing"); e1.printStackTrace();