Hi friends
I am right now developing a
java application that is compressed as jar. The application uses a postgresql jar and log4j jar, then as the sun tutorial mention I write in the manifest file the classpath attribute. I use absolute path for each jar and write too the attribute that indicate the main class. Then I generate my jar file and put it in a folder in C called PrinterControl .
Here is my manisfet file content
Manifest-Version: 1.0
Class-Path: C:/jars/log4j-1.2.15.jar C:/jars/postgresql-8.3-603.jdbc2.jar
Main-Class: com.mercantil.printer_control.controller.Process_Controller
When I try to run the application this crashed and return a message that say java.lang.NodefClassFound
I think that the class loader can�t find the main class .
I decided to create a folder inside C:\ PrinterControl called lib and inside lib I moved the jars and changed the manifest just like this:
Manifest-Version: 1.0
Class-Path: lib/log4j-1.2.15.jar lib/postgresql-8.3-603.jdbc2.jar
Main-Class: com.mercantil.printer_control.controller.Process_Controller
Generating the jar and running and simply everything is Ok
Someone can explain why in my first choice it didn�t work?. Why it lost the classpath for jar internal classes and didn�t found the main class ?
I would appreciate a lot your comments and help
