I have a strange issue with jar file I'm building, and I was wondering if anyone could point me to any manual or KB article, that would explain it... Anyhow, my application is referencing external iText-2.0.8.jar that resides in the same directory as my output jar: OUT_DIR: - my.jar - iText-2.0.8.jar the main class in my.jar is com.company.Main and whenever I'm trying to run
java -cp "my.jar;iText-2.0.8.jar" com.company.Main
my app runs fine. But as soon as I'm trying to run:
java -jar my.jar
I'm getting NoClassDefFoundError for classes from iText-2.0.8.jar Here is the manifest of my.jar:
Manifest-Version: 1.0
Main-Class: com.company.Main
Class-Path: iText-2.0.8.jar
Name: rabbitmq-client
Specification-Title: AMQP
Specification-Version: 0.9.1
Specification-Vendor: AMQP Working Group (www.amqp.org)
Implementation-Title: RabbitMQ
Implementation-Version: 3.1.3
Implementation-Vendor: Rabbit Technologies Ltd. (www.rabbitmq.com)
Could that be related to iText jar being runnable as well (it has it's own main class)? On the other hand, NoClassDefFoundError clearly indicates classpath error...