WINDOWS版:
@ECHO OFF
REM @ECHO STARTUP App
REM @ECHO 设置环境变量,循环当前目录下的lib目录下所有jar文件,并设置CLASSPATH
FOR %%F IN (lib\*.jar) DO call :addcp %%F
goto extlibe
:addcp
SET CLASSPATH=%CLASSPATH%;%1
goto :eof
:extlibe
REM @ECHO 当前目录下的bin目录为class文件存放目录,设置bin目录到CLASSPATH中
SET CLASSPATH=%CLASSPATH%;bin\
REM @ECHO 显示CLASSPATH
REM SET CLASSPATH
REM @ECHO 运行应用程序
REM JAVA com.paul.socket.charge.client.ClientJFrame
start javaw com.paul.socket.charge.client.ClientJFrame
LINUX版:
#!/bin/sh
classpath=".:../classes/:../lib/*"
hdfs_input=hadoop/input
hdfs_output=hadoop/output0
mainclass=main.WordFinderMain
classesfolder=/job/classes
java -cp $classpath $mainclass $hdfs_input $hdfs_output $classesfolder