Index: lcb.bat
===================================================================
--- lcb.bat	(revision 0)
+++ lcb.bat	(revision 0)
@@ -0,0 +1,8 @@
+set _CLASSPATHCOMPONENT=%1
+:argCheck
+if %2a==a goto gotAllArgs
+shift
+set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
+goto argCheck
+:gotAllArgs
+set CLASSPATH=%_CLASSPATHCOMPONENT%;%CLASSPATH%
Index: tika.bat
===================================================================
--- tika.bat	(revision 642047)
+++ tika.bat	(working copy)
@@ -15,4 +15,15 @@
 REM  See the License for the specific language governing permissions and
 REM  limitations under the License.
 
-java -jar lib/${project.build.finalName}.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
+SETLOCAL
+:: This will give the path where the bat-file lives.
+SET TIKA_BIN=%~dp0
+pushd %TIKA_BIN%\..
+set TIKA_HOME=%CD%
+popd 
+
+FOR %%a IN (%TIKA_HOME%\lib\*.jar) DO call %TIKA_BIN%\lcb.bat %%a
+
+java -cp %CLASSPATH%. -jar %TIKA_HOME%\lib\tika-0.2-SNAPSHOT.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
+::java -cp %CLASSPATH%. %1 %2 %3 %4 %5 %6 %7 %8 %9
+ENDLOCAL
Index: tika.sh
===================================================================
--- tika.sh	(revision 642047)
+++ tika.sh	(working copy)
@@ -14,5 +14,11 @@
 # 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.
-
-java -jar lib/${pom.build.finalName}.jar $*
+#
+TIKA_CLI=$0
+TIKA_BIN=`dirname "$0"`
+TIKA_HOME=`dirname "$TIKA_BIN/.."`
+# Build the classpath with all needed jar files
+CP=`find $TIKA_HOME/lib -type f -name "*.jar" -exec echo -n {}: \;`
+#
+java -cp .:$CP -jar $TIKA_HOME/lib/${pom.build.finalName}.jar $*
