pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Could not find or load main class
Date Wed, 14 Jan 2015 19:26:26 GMT
Hi Lorena,

The best is that you install an IDE. There are three major ones: 
Netbeans, Eclipse and IntelliJ. Eclipse is the most popular. I recommend 


Am 14.01.2015 um 18:25 schrieb Lorena Leishman:
> 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\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,
>   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();
>      }
> }

View raw message