I get a Exception in thread "main" Exception in thread "main" java.lang.NoClassDefFoundError error when I try to run a batch file as a scheduled task on windows server 2008. The batch file runs a java program. when I run the batch file regularly it runs fine.
@ECHO OFF
:start
:playback
java -cp ../lib/*; example
:end
Tue 08/30/2011 9:29:23.19: C:\Windows\system32;C:\Windows;C:\Windows\System32\W bem;C:\Program Files (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 mon7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program F iles (x86)\Micros开发者_运维知识库oft 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 Files (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:\Pr ogram Files\System Center Operations Manager 2007\
The account that runs the batch does not seem to have its PATH configured properly. Can you add:
echo %DATE% %TIME%: %PATH% >> %TMP%\DebugFile.txt
to see that the value in path.
精彩评论