Hi Tobias,
Thank you for an early reply.
To reflect what I am working on, and how I set my path,classpath I am attaching the contents of my file "pather.bat". It does have the classpath set to the multiple .jar files. Please check through it. I have copied the Directory location from windows icon right click-properties and then the name. So I am doubly sure I have not misspelt any dir names or file names this time.
I then CD to the directory pmd-1.8\etc> and then issue a
"run F:\amit.t\java_profilers\PMD\pmd-1.8\etc\TestHprof.java xml/text rulesets/basic.xml" command.
It still gives me the same error message as below:
=============================================================
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/parsers/DocumentBuilderFactory
at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:100)
at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:88)
at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:59)
at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:78)
at net.sourceforge.pmd.PMD.main(PMD.java:108)
============================================================
where I have placed the required java file in the pmd-1.8\etc folder (for convinience) I even tried moving the java file to F:\ (root) and issued a command "run F:\TestHprof.java xml rulesets/basic.xml" and I still get the same error message.
If you can, please go through the pather.bat file below, which illustrates my original path/classpath, how I set my path/classpath and other environment variables like PMD_HOME and the final path/classpath.
If I have set the correct classpaths, and path, and it still doesnt work,
could it have a problem with the xerces...jar files. They are a standard distribution from the website. I have downloaded the binary pmd-bin-1.8.zip file worth 4MB and it is for Windows platform. (I am sure it wouldn't have worked , if it was for a Unix platform)
Following are the contents of my "pather.bat" file
==========================================================================
REM Before running the pather.bat file the path and classpath is as set when the
REM system boots. I cannot set environment variables from
REM Start-settings-Control Panel-System-Advanced-Environment Variables on a
REM Windows 2000 Professional Operating System
REM Initial PATH is as follows: (after system boots, from the command prompt)
REM Path=F:\Perl\bin;C:\Program Files\Compaq\Compaq Management Agents\Dmi\Win32\Bin;
REM C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;c:\system;c:\j2sdk1.4.1_06\bin
REM PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
REM Initial CLASSPATH is as follows

after system boots, from the command prompt)
REM CLASSPATH=.
REM =============================================================
REM adding a path to Java compiler
set JAVA_HOME=F:\Program Files\IBM\Websphere Studio\runtimes\base_v5\java\bin
set path=%JAVA_HOME%;%path%
REM define a PMD_HOME for the folder containing the pmd jar files
REM set PMD_HOME=F:\amit.t\java_profilers\PMD\pmd-1.8\lib
REM =============================================================
set PMD_HOME=F:\amit.t\java_profilers\PMD\pmd-1.8\lib
REM add classpath to the PMD jar files
REM =============================================================
set classpath=;%classpath%;
REM use the following to set classpath to PMD
REM =============================================================
set classpath=%PMD_HOME%\jaxen-core-1.0-fcs.jar;%classpath%
set classpath=%PMD_HOME%\pmd-1.8.jar;%classpath%
set classpath=%PMD_HOME%\saxpath-1.0-fcs.jar;%classpath%
set classpath=%PMD_HOME%\xercesImpl-2.0.2.jar;%classpath%
set classpath=%PMD_HOME%\xmlParserAPIs-2.0.2.jar;%classpath%
REM use the following to set classpath to Cougar Version of PMD
REM =============================================================
REM set COUHOME=F:\amit.t\java_profilers\cpmd\pmd\lib
REM set classpath=%COUHOME%\pmd-0.3.jar;%classpath%
REM set classpath=%COUHOME%\xercesImpl-2.0.2.jar;%classpath%
REM set classpath=%COUHOME%\xmlParserAPIs-2.0.2.jar;%classpath%
REM add an additional classpath to the PerfAnal.jar file
REM =============================================================
REM set classpath=F:\amit.t\java_profilers\PerfAnal.jar;%classpath%
REM =============================================================
REM AFTER executing this batch file as pather.bat the following classpath
REM and Environment Variables get set.
REM Path=F:\Program Files\IBM\Websphere Studio\runtimes\base_v5\java\bin;F:\Perl\bin;
REM C:\Program Files\Compaq\Compaq Management Agents\Dmi\Win32\Bin;
REM C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;c:\system;c:\j2sdk1.4.1_06\bin
REM PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
REM CLASSPATH=F:\amit.t\java_profilers\PMD\pmd-1.8\lib\xmlParserAPIs-2.0.2.jar;
REM CLASSPATH=F:\amit.t\java_profilers\PMD\pmd-1.8\lib\xercesImpl-2.0.2.jar;
REM CLASSPATH=F:\amit.t\java_profilers\PMD\pmd-1.8\lib\saxpath-1.0-fcs.jar;
REM CLASSPATH=F:\amit.t\java_profilers\PMD\pmd-1.8\lib\pmd-1.8.jar;
REM CLASSPATH=F:\amit.t\java_profilers\PMD\pmd-1.8\lib\jaxen-core-1.0-fcs.jar;;.;
REM the other variable PMD_HOME=F:\amit.t\java_profilers\PMD\pmd-1.8\lib
============================================================================
I did try to provide exact data reflecting my environment on the OS that I use (Win 2000 Professional). I hope it helps you for some "troubleshooting" !!!
Sincerely,
- Amit