我在Windows服务器2008上尝试将批处理文件作为计划任务运行时,在线程“main”java.lang.NoClassDefFoundError 中出现异常线程中的“异常”错误。批处理file运行一个java程序。当我定期运行批处理文件时它运行正常。
@ECHO OFF
:start
:playback
java -cp ../lib/*; example
:end
星期二08/30/2011 9:29:23.19: C:\ Windows \ system32; C:\ Windows; C:\ Windows \ System32 \ W bem; C:\ Program 文件(x86)\ Microsoft SQL Server \ 100 \ Tools \ Binn \; C:\ Program Files \ Microsoft SQL Server \ 100 \ Tools \ Binn \; C:\ Program Files \ Microsoft SQL Server \ 100 \ DTS \ Binn \; C:\ Program Files(x86)\ Microsoft SQL Server \ 100 \ Tools \ Binn \ VSShell \ Com \ tmon7 \ IDE \; C:\ Program Files (x86)\ Microsoft SQL Server \ 100 \ DTS \ Binn \; C:\ Program文件 (x86)\ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ PrivateAssemblies \; C:\ WINDOWS \ System32 \ WindowsPowerShell \ v1.0 \; C:\ Program Files(x86)\ Windows Imaging \; C:\ Pro gram Files(x86)\ IBM \ Director \ cimom \ bin; C:\ Program 文件(x86)\ Common Files \ ibm \ icc \ cimom \ bin; C:\ Program Files (x86)\ IBM \ Director \ bin; C:\ Program Files \ System Ce nter Operations Manager 2007 \; C:\ Program Files(x86)\ Java \ jdk1.6.0_25 \ bin; C:\ Program Files \ System Center Operations Manager 2007 \
答案 0 :(得分:1)
运行批处理的帐户似乎没有正确配置其PATH。你能补充一下:
echo %DATE% %TIME%: %PATH% >> %TMP%\DebugFile.txt
查看路径中的值。