Page 1 of 1

How to install docx4java

PostPosted: Wed Apr 24, 2013 9:00 pm
by zzzimon
Hi!

How do I install docx4java so I can use it?
I downloaded the jar file and double clicked on it but there came a small window that said "A java exception has occured".
I then went into command prompt and did "jar -x docx4j.jar" but nothing happened.

Im not so familiar with jar files or working with eclipse. I use mainly notepad and compile at the command line.

Can somone help me?

regards, Simon

Re: How to install docx4java

PostPosted: Thu Apr 25, 2013 12:51 pm
by lazywednesday
you can use the docx4j jar by adding it to the library of your project. to do so,
First copy the docx4j jar file into your project workspace libraries
>> Then right click on you project in eclipse(which can be seen in project explorer)
>>Then point on Build Path
>>Then click Configure Build Path
>>In Libraries tab, you can edit or add a library for your docx4j jar. after adding or editing
>>Double click on your library
>>Click User Libraries.
>>Click Add JARs
>>Then find your docx4j jar file
>> Click OK and Finish.

and you can now use docx4j in your project. you might wanna refresh your project by right-clicking the project and choose Refresh to be sure. Hope this helps

Re: How to install docx4java

PostPosted: Thu Apr 25, 2013 1:40 pm
by jason
Just to add to lazyw's reply, you'll need to add all the jars docx4j is dependent on. You don't need to do them one by one. You can select the lot at once.

I'd really encourage you to use and come to grips with Eclipse or another IDE!

I wrote java code using a text editor (JEditor) circa y2000, so I know first hand what a tremendous productivity boost a modern IDE is...

But, you can compile from the command line if you want. You need to include a class path argument with docx4j and all its dependent jars though. So you'd probably end up with a bat/sh file to do it. Or you could write an ant task (which you could base on docx4j's build.xml).