Hey all
I'm new to java and I need to use java and itext for my class project.I
installed libitext-java version 1.4.5-3 in debian using apt.When i try to
compile the HelloWorld program
import java.io.*;
import com.lowagie.text.pdf.*;
import com.lowagie.text.*;
public class HelloWorldPDF
{
public static void main(String arg[])throws Exception
{
Document document=new Document();
PdfWriter.getInstance(document,new FileOutputStream("hello.pdf"));
document.open();
document.add(new Paragraph("Hello Pdf"));
document.close();
}
}
I get this error
Exception in thread "main" java.lang.NoClassDefFoundError:
com/lowagie/text/Element
Caused by: java.lang.ClassNotFoundException: com.lowagie.text.Element
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: HelloWorldPDF. Program will exit.
Could someone please tell me what is wrong??
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php