pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: Could not find or load main class
Date Wed, 14 Jan 2015 17:43:35 GMT
Please excuse my previous typo: ”provably" —> “probably"

-- John

> On 14 Jan 2015, at 09:42, John Hewson <john@jahewson.com> wrote:
> 
> Hi Lorena,
> 
> You provably need to read an introductory book on Java. These sorts of questions
> aren’t really suitable for the PDFBox mailing list.
> 
> Or, if you’re in a hurry, try Googling the error message:
> https://www.google.com/#q=Could+not+find+or+load+main+class <https://www.google.com/#q=Could+not+find+or+load+main+class>
> 
> Thanks,
> 
> -- John
> 
>> On 14 Jan 2015, at 09:25, Lorena Leishman <lorenaleishman@yahoo.com.INVALID <mailto:lorenaleishman@yahoo.com.INVALID>>
wrote:
>> 
>> My environmental CLASSPATH  is set to .;C:\Users\Dad\Downloads\pdfbox-app-1.8.8.jar
>> I can't run anythhing anymore. I can compile this FillTestField file but I can't
run it. Or anything else. Not even Welcome.Class. I keep getting "Could not find or load main
class FillTestField" I have tried:Changing the classpath to .;C:\Users\Dad\Downloads\pdfbox-app-1.8.8.jar;C:\Users\Dad\Downloads
.;C:\Users\Dad\Downloads\pdfbox-app-1.8.8.jar;.;C:\Users\Dad\Downloads
>> .;C:\Users\Dad\Downloads\pdfbox-app-1.8.8.jar;C:\Users\Dad\Downloads\FillTestField.class
>> or from the prompt line: java -cp . FillTestField (from same folder where file is)java
-cp C:\Users\Dad\Downloads\FillTestField (With this one I got a whole list of java help commands,
etc)
>>  Any ideas? Thanks for all your help.
>> //FillTestFieldpackage org.apache.pdfbox.examples.acroforms;import java.io.File;
>> import java.io.IOException;
>> import org.apache.pdfbox.pdmodel.PDDocument;
>> import org.apache.pdfbox.exceptions.*;
>> import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;import org.apache.pdfbox.pdmodel.interactive.form.PDField;
>> import org.apache.pdfbox.pdmodel.interactive.form.PDTextbox;
>> 
>> public class FillTestField {  
>> public static void main(String[] args)  throws IOException    {  String formTemplate
= "Users/Dad/Desktop/TCRM/game plan 12-16.pdf";           String filledForm = "Users/Dad/JavaTest/game
plan 12-16.pdf";               // load the document        PDDocument pdfDocument = PDDocument
               .load(new File(formTemplate),null);        
>> // get the document catalog        PDAcroForm acroForm = pdfDocument.getDocumentCatalog().getAcroForm();
       // as there might not be an AcroForm entry a null check is necessary        if (acroForm
!= null)        { // Retrieve an individual field and set it's value.            PDTextbox
field = (PDTextbox) acroForm.getField( "Goal" );            field.setValue("Text Entry");
                       // If a field is nested within the form tree a fully qualified name
            // might be provided to access the field.            field = (PDTextbox) acroForm.getField(
"fieldsContainer.nestedSampleField" );            field.setValue("Text Entry");  }
>>         // Save and close the filled out form.
>> //pdfDocument.save(filledForm); pdfDocument.close();
>>     }
>> }
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message