JAR File
Java Applications can and should be packaged in a Java Archive file (JAR file). This is basically a ZIP file with an additional META-INF directory which contains a file called MANIFEST.MF.MANIFEST.MF
The MANIFEST.MF file contains a number of entries which I call tags. The most common ones are Manifest-Version, Main-Class, or Class-Path. You'll find Manifest-Version in every MANIFEST.MF file.Main-Class
The Main-Class tag is useful for an application packaging with the main class defined, but not telling the user. To start the application you usually issue something like java -jar application.jar. One of the well known examples is java -jar oc4j.jar. To specify the Main-Class tag in your MANIFEST.MF you need to include the following line:Main-Class: path.to.your.application.Main
Class-Path
The Class-Path tag is useful for specifying the list of the libraries application needs to successfully run. You can specify the class path like any other but use the blank character (' ') as the path separator. Ie. no colon (':')or semicolon (';') as for the Un*x/Linux or Win environments, respectively.To specify the Class-Path tag in your MANIFEST.MF you need to include a line like the following:
Class-Path: lib/ojdbc14.jar lib/log4j.jar
Specifying MANIFEST.MF tags in JDev
JDeveloper offers you two choices to specify your MANIFEST.MF tags. But before you can do this, you have to create a Deployment Profile for your JDev project (New... > General > Deployment Profiles). Once you have this profile in your project, open the Deployment Profile Properties dialog window. Navigate to the Options entry for specifying the tags.Include the MANIFEST.MF File
To make your specified tags available in your MANIFEST.MF, make sure to select the Include Manifest File (META-INF/MANIFEST.MF) checkbox.Setting the Main-Class Tag
Since this is one of the most used tags, it got a primary location in the dialog and you get some help to find the right class. To complete the Main Class entry you can either enter the fully qualified class name or use the Browse button to find the right class.
Picture 1: Class Browser window
Setting the Class-Path Tag
To specify the Class-Path tag in JDev you have to define a fragment file to be included in your MANIFEST.MF (or merged into the Manifest file). The fragment file could be in your source files and contains all the tags you'd like to specify.Class-Path:For ease of work, I recommend to have a single line per library.
../config/
classes12.jar
bc4jct.jar
bc4jdomorcl.jar
bc4jmt.jar
commons-beanutils-bean-collections.jar
commons-beanutils-core.jar
commons-beanutils.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-configuration-1.2.jar
commons-digester.jar
commons-lang-2.0.jar
commons-logging.jar
htbclnt.jar
j2ee/home/oc4jclient.jar

Picture 2: Deployment Profile window
Comments (2)
Thanks Olaf.
That helped me a lot - I couldn't find where to specify the classpath.
Note that you have to end the fragment file by a carriage return.
Otherwise, the file is not included in the manifest.mf file.
Regards,
Didier.
Posted by Didier | June 10, 2009 2:23 PM
Posted on June 10, 2009 14:23
Hello Olaf,
Your "Class-Path Tag" Tip resolved my Problem. I have searched a lot, but you are the only one who delivered the right Answer !
Thanks!
Posted by Furnica | October 1, 2009 2:18 PM
Posted on October 1, 2009 14:18