Index: java/tools/org/apache/derby/tools/run.java
===================================================================
--- java/tools/org/apache/derby/tools/run.java	(revision 0)
+++ java/tools/org/apache/derby/tools/run.java	(revision 0)
@@ -0,0 +1,76 @@
+/*
+
+   Derby - Class org.apache.derby.tools.run
+
+   Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derby.tools;
+
+import java.io.IOException;
+
+/**
+  The run class facilitates running the various Derby utilities with the
+  java -jar command. For example:
+
+  java -jar derbytools.jar ij
+  java -jar derbytools.jar sysinfo
+  java -jar derbytools.jar dblook
+*/
+public class run {
+
+  /**
+  	 Switch on the first argument to choose the tool, pass the remaining
+         arguments to the tool.
+   */
+  static public void main(String[] args) throws IOException {
+      if (args[0].equals("ij")) {
+          ij.main(trimArgs(args));
+      } else if (args[0].equals("sysinfo")) {
+          sysinfo.main(trimArgs(args));
+      } else if (args[0].equals("dblook")) {
+          dblook.main(trimArgs(args));
+      } else printUsage();
+    
+  }
+
+  /*
+       Private constructor. No instances allowed.
+   */
+  private run() { 
+  }
+  
+  /*
+       Utility method to trim one element off of the argument array.
+       @param args the arguments array
+       @return trimmed the trimmed array
+   */
+  private static String[] trimArgs(String[] args)
+  {
+      String [] trimmed = new String[args.length - 1];
+      System.arraycopy(args, 1, trimmed, 0, args.length - 1);
+      return trimmed; 
+  }
+
+  /*
+       Print the usage statement if the user didn't enter a valid choice
+       of tool.
+   */
+  public static void printUsage()
+  {
+      System.err.println("Usage: java -jar derbytools.jar ij | sysinfo | dblook [args]");
+  }
+}

Property changes on: java/tools/org/apache/derby/tools/run.java
___________________________________________________________________
Name: svn:eol-style
   + native

Index: build.xml
===================================================================
--- build.xml	(revision 378083)
+++ build.xml	(working copy)
@@ -951,11 +951,17 @@
       <fileset dir="${basedir}" includes="LICENSE*,NOTICE*,COPYRIGHT*"/>
     </copy>
 
+    <manifest file="${derby.jar.dir}/lists/smftools.mf">
+      <attribute name="Main-Class" value="org.apache.derby.tools.run"/>
+      <attribute name="Class-Path" value="derby.jar derbyclient.jar"/>
+    </manifest> 
+ 	
     <delete file="${derby.jar.dir}/derbytools.jar"/>
     <jar destfile="${derby.jar.dir}/derbytools.jar"
          basedir="${out.dir}"
          includesfile="${derby.jar.dir}/lists/derbytools.list"
          compress="true"
+         manifest="${derby.jar.dir}/lists/smftools.mf"
          filesonly="true"/>
     <jar destfile="${derby.jar.dir}/derbytools.jar"
          compress="true"
Index: tools/jar/tools.properties
===================================================================
--- tools/jar/tools.properties	(revision 378083)
+++ tools/jar/tools.properties	(working copy)
@@ -12,3 +12,4 @@
 derby.module.Attribute=org.apache.derby.iapi.reference.Attribute
 derby.module.cslook=org.apache.derby.tools.dblook
 derby.module.sysinfo=org.apache.derby.tools.sysinfo
+derby.module.run=org.apache.derby.tools.run
