Page 1 of 1

Can't get the new version to work or build.

PostPosted: Thu Dec 08, 2011 8:18 am
by JdeBruin

I'm fairly new at the whole java / eclipse thing so I'm sure it's a silly mistake I'm making, but I am stuck. I downloaded the getting started document, and first tried to download the 2.7.1 binaries, and test the Parts List example. This didn't work; The following message kept popping up: Exception in thread main, java.lang.NoClassDefFoundError: org/docx4j/samples/PartList

Then I figured, I'll just rebuild the whole thing and start fresh. So I followed all instructions again, installed eclipse, maven, maven plugins etc, and tried to build the file. This also resulted in a bust, because apparently the xhtmlrenderer snapshot is nowhere to be found.

I know this all sounds very vague and you probably want more specifics, but as I said, I followed the tutorial to the letter, both for binaries and compilation. I even tried to compile it with maven, but this also resulted in a bust: I got the message that the xhtmlrenderer snapshot 1.0.0 was not present in the repository.

Can someone please help me with one or both errors, (binaries and build)


Re: Can't get the new version to work or build.

PostPosted: Thu Dec 08, 2011 3:53 pm
by jason
If you are building trunk from source, you currently need to include ... 111113.jar on your classpath (or delete the class which requires it).

If you are trying to get started using 2.7.1 binaries, I'd recommend you follow the steps in the blog post ... n-central/

Re: Can't get the new version to work or build.

PostPosted: Thu Dec 15, 2011 11:26 pm
by Pierre

I'm trying to build from trunk, added the xhtmlrenderer jar you indicated above, and still have some build issues.

Many imports that are not resolved :
- org.plutext.*
- org.docx4j.openpackaging.packages.PresentationMLPackage
- etc ...

I have other errors like method declared as @override without a corresponding method in superclass. I guess I have a wrong dependency version somewhere, but where ?

What I did :
- checkout docx4j from svn
- create an exclipse project in the same directory
- enable maven dependencies
- add docx4j-xhtmlrenderer-nightly-20111113.jar to classpath

Thanks for reading this.


Re: Can't get the new version to work or build.

PostPosted: Fri Dec 16, 2011 9:23 am
by jason
Hi Pierre

Finally (per the Getting Started guide):

Set compiler version & system library:
• Right click on the project (or Alt-Enter)
• Choose "Java Compiler", then set JDK compliance to 1.6
• Choose "Java Build Path", and check you are using 1.6 "JRE System Library". If not, remove, then click "Add Library"

Now, we need to check the class path etc within Eclipse so that it can build.
• Build Path > Configure Build Path > Java Build Path > Source tab
• Verify it contains:
o src/diffx
o src/glox4j
o src/main/java
o src/pptx4j/java (remove "Excluded: **" if present!)
o src/svg
o src/xslx4j/java
o src/xslfo

I don't know why m2eclipse doesn't get this right. Note especially "remove "Excluded: **" if present!" -- you should check there is no such exclusion on any of the build path entries.

Regarding - it is possible the pre-built xhtmlrenderer jar is a bit out of date. I will need to check. Or you can simply delete the package for now so that you don't need it.

cheers .. Jason

Re: Can't get the new version to work or build.

PostPosted: Tue Dec 20, 2011 1:18 am
by jason
Please try with ... 111219.jar
The docx4j nightly of the same date (in the same dir) should work with it.