Jari,

 

You will need to include the itext jar in your classpath. For a quick test you 
can try something like the following (substitute jar name and path if necessary 
for your own)

 

java -cp lib/itext.jar HelloWorld

 

Adam Paeth

 

From: Jari Ruotsalainen [mailto:[email protected]] 
Sent: Wednesday, March 07, 2012 8:39 AM
To: [email protected]
Subject: [iText-questions] Eclipse OK, Command line not

 

Hello,
 
I just started with IText. Iam able to compile simplest example "Hello World"
using Java Eclipse and prompt Hello.pdf.
 
But once trying to do using dos and command line:
 
>java HelloWorld  following erroro appears:
 
C:\Eclipse_Java\Projektit\HelloWorld\bin>java HelloWorld
Exception in thread "main" java.lang.NoClassDefFoundError: 
com/itextpdf/text/Element
Caused by: java.lang.ClassNotFoundException: com.itextpdf.text.Element
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: HelloWorld.  Program will exit.
 
I understand that the included jar (itexpdf-5.2.0.jar) is not
coming along compiled class that is working with eclipse.
 
 
How to get command line work???
 
BR
 
JR

-- This message has been checked by ESVA and is believed to be clean. 


--
Confidentiality Notice: This e-mail, including attachments, may include 
confidential and/or proprietary information, and may be used only by the person 
or entity to which it is addressed. If the reader of this e-mail is not the 
intended recipient or his or her authorized agent, the reader is hereby 
notified that any dissemination, distribution, copying or taking any action in 
reliance upon this information is prohibited. If you have received this e-mail 
in error, please notify the sender by replying to this message and delete this 
e-mail immediately.
This message was scanned by ESVA and is believed to be clean.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to