Thanks for the reply.
I tried this but it didn't work. It seemed to get further, but I think it
might not be finding the PDF
JAVA CLASS('org.apache.pdfbox.PDFBox') PARM('ExtractText' '/tmp/CONS.PDF'
'/tmp/cons.txt' ) CLASSPATH('/JavaPDF/pdfbox-1.6.0.jar')
Exception in thread "Thread-0" java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory
at java.lang.Throwable.<init>(Throwable.java:196)
at java.lang.Error.<init>(Error.java:49)
at java.lang.LinkageError.<init>(LinkageError.java:36)
at
java.lang.NoClassDefFoundError.<init>(NoClassDefFoundError.java:40)
at
org.apache.pdfbox.pdfparser.BaseParser.<clinit>(BaseParser.java:58)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1087)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1053)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:978)
at
org.apache.pdfbox.ExtractText.startExtraction(ExtractText.java:196)
at org.apache.pdfbox.ExtractText.main(ExtractText.java:76)
at org.apache.pdfbox.PDFBox.main(PDFBox.java:42)
Java program completed with exit code 1
If I try it like this without the extra quotes, I see a different message
JAVA CLASS('org.apache.pdfbox.PDFBox') PARM('ExtractText /tmp/CONS.PDF' )
CLASSPATH('/JavaPDF/pdfbox-1.6.0.jar')
usage: java pdfbox-app-x.y.z.jar <command> <args..>
Java program completed with exit code 1
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Joe Sam Shirah
Sent: Tuesday, March 06, 2012 10:25 AM
To: Java Programming on and around the IBM i
Subject: Re: Question about running a Java Class
Hi Jack,
David's answer is close but I wouldn't expect it to work as is. The
reason is that "ExtractText" and "cons.pdf" are separate arguments or
parameters. IOW, using your doc example:
usage: java -jar pdfbox-app-x.y.z.jar ExtractText [OPTIONS] <PDF file> [Text
file]
everything after the jar are arguments, including the ExtractText "command".
So, for JAVA/RUNJVA use PARM( 'ExtractText' 'cons.pdf' ), add any other
arguments as necessary.
If you run the jar as executable, your classpath should just need to be
"/JavaPDF". If you run the class as in the example, your classpath should
be "/JavaPDF/pdfbox-1.6.0.jar". The reason is that an executable jar has
its entry point (class to load) defined in the manifest.
HTH,
Joe Sam
Joe Sam Shirah - www.conceptgo.com (904) 302-6870
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum: www.ibm.com/developerworks/java/
Just the JDBC FAQs: www.jguru.com/faq/JDBC
Going International? www.jguru.com/faq/I18N
Que Java400? www.jguru.com/faq/Java400
-----Original Message-----
From: David Gibbs
Sent: Tuesday, March 06, 2012 9:51 AM
To: Java Programming on and around the IBM i
Subject: Re: Question about running a Java Class
On 3/5/2012 7:10 PM, Jack Tucky wrote:
I was able to get the extract to work on my PC using this command.
Can anyone help me "convert" the syntax to Iseries?
Try this:
qsh cmd('java -cp pdfbox-app-1.6.0.jar org.apache.pdfbox.PDFBox
ExtractTextcons.pdf')
or this:
JAVA CLASS('org.apache.pdfbox.PDFBox') PARM('ExtractTextcons.pdf')
CLASSPATH('pdfbox-app-1.6.0.jar')
david
As an Amazon Associate we earn from qualifying purchases.