Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could not compile JTidy (jtidy-04aug2000r7-src) with JDK1.6

 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am having difficulty compiling the latest version of JTidy source code on Windows XP, SP2 platform with the following error:


I am using the build.xml from MKSearch Ant build file for re-packaging the JTidy classes
(https://svn.mkdoc.com/mksearch/trunk/ant/build.xml).

Also tried compiling on jtidy-04aug2000r7-dev & jtidy-04aug2000r7-bin without much luck either.

There are numerous forum conversations on how to use JTidy but nothing on how to build it especially on overcoming Class the compatibility conflict with standard Java distributions that occurred since JDK1.5 back in 2004. I am surprised that no one has updated JTidy to overcome this issue.
Any advice or suggestion on this issue would be appreciated.

Thanks,

Jack
 
Paul Clapham
Sheriff
Pie
Posts: 20966
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But to me it doesn't look like you have run into anything like Java 5 incompatibility.
java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
Looks more like you just messed up your classpath and java.exe just can't find Ant's main class.
[ July 07, 2008: Message edited by: Paul Clapham ]
 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

I have fixed the AntMain error and the following incompatibility error returned:


Would you be able to interpret what the resolution step is from JTidy development notes (http://www.codestyle.org/java/jtidy/JTidyDevelopmentNotes.shtml) since I couldn't follow its instruction, or not sure whether it is still relevant?

Thanks,

Jack
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would follow the suggestion to use -source 1.4
(use -source 1.4 or lower to use 'enum' as an identifier)


-OR- change the source code to rename the "enum" variable name.
Bill
 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I overcame the 'enum' limitation by renaming this variable to non-reserved Java word and successfully completed the Ant build. However, only the Tidy.jar file was generated as opposed to JTidy.jar.

The following program was use to convert a HTML file to XML without success still:



It turned out that the Patient.xml file was still in HTML format. I cross checked the conversion by running the following command using the Tidy utility which successfully produced an equivalent XML file:



In short, the Ant build failed despite having resolved the 'enum' limitation.

The errfile turned out to be slightly different.

Any suggestion would be appreciated.

Thanks,

Jack
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic