Re: Minimal javac java Example (stand-alone) / classpath hell
Wolfgang Fahl <[email protected]> Fri, 25 Mar 2011 17:24:03 +0100
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Organization | BITPlan GmbH |
| Message-ID | <[email protected]> |
This is how I tested a few httpunit revisions. Maven is much simpler in usage than fiddling with classpath just like that. The ant scripts are checked out while doing so and you'll find a build.xml that has automated classpath building in. Anyone volunteering to add a classpath print message to that build.xml? = It would help solve the issue of what classpath is necessary when trying to start things from the command line. Also the classpath could be added to the manifest file of an example.jar = which could be created in the build.xml I'm to busy for these patches -they are certainly feasible ... root=3D`pwd` for r in 1020 1030 1040 1050 1060 1061 do cd $root svn checkout -r $r = https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit = httpunit$r cd httpunit$r mvn test done Am 25.03.11 16:45, schrieb Dee Ayy: >> For that particular example, at a minimum you need: >> java -classpath >> ../Downloads/httpunit-1.7/jars/js-1.6R5.jar:../Downloads/httpunit-1.7/ja= rs/nekohtml-0.9.5.jar:../Downloads/httpunit-1.7/jars/xercesImpl-2.6.1.jar:.= ./Downloads/httpunit-1.7/lib/httpunit.jar:. >> Example > I had tried what I thought was the above variation: > java -classpath > .:~/Downloads/httpunit-1.7/lib/httpunit.jar:~/Downloads/httpunit-1.7/jars= /activation-1.1.jar:~/Downloads/httpunit-1.7/jars/js-1.6R5.jar:~/Downloads/= httpunit-1.7/jars/jtidy-4aug2000r7-dev.jar:~/Downloads/httpunit-1.7/jars/ju= nit-3.8.1.jar:~/Downloads/httpunit-1.7/jars/mail-1.4.jar:~/Downloads/httpun= it-1.7/jars/nekohtml-0.9.5.jar:~/Downloads/httpunit-1.7/jars/servlet-api-2.= 4.jar:~/Downloads/httpunit-1.7/jars/xercesImpl-2.6.1.jar:~/Downloads/httpun= it-1.7/jars/xmlParserAPIs-2.6.1.jar > Example > Exception in thread "main" java.lang.NoClassDefFoundError: > com/meterware/httpunit/WebRequest > Caused by: java.lang.ClassNotFoundException: com.meterware.httpunit.WebRe= quest > > Why did the above fail? > I list the current directory "." to find my Example.class > Then I list httpunit.jar then the reamining jars, yet you listed > httpunit.jar last. Does this order matter? > > Your export worked! Thanks. But I'm still confused. > It seems that "-classpath" does not like relative paths? > MY_JARS now contains absolute paths. When I manually type absolute > paths it worked. > > Thanks for saving me from classpath hell. > > Dee > > -------------------------------------------------------------------------= ----- > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > Httpunit-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/httpunit-develop > -- = BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Gesch=E4= ftsf=FChrer: Wolfgang Fahl ---------------------------------------------------------------------------= --- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software = be a part of the solution? Download the Intel(R) Manageability Checker = today! http://p.sf.net/sfu/intel-dev2devmar