views:

158

answers:

1

Hello,

I would like to have .class and .java files in a JAR. Thus, I have "bin" and "src" pastes in that JAR. How should I edit the MANIFEST.MF?

JAR
 |
  -- bin -- .class files
 |
  -- src -- .java files
 |
  -- META-INF -- MANIFEST.FM

Im doing this:

Manifest-Version: 1.0 
Class-Path: ./bin/ 
Main-Class: simul.Simulador

But with no success.

+2  A: 

The jar file structure should be something like this; the root of the package structure for the class files must be at the top level in the jar.

JAR
 |
  -- simul
 |    |
 |     -- Simulador.class
 |    |
 |     -- (other class files in "simul" package ...)
 |
  -- META-INF
      |
       -- src -- .java files
      |
       -- MANIFEST.MF

Your manifest should look like this:

Manifest-Version: 1.0
Main-Class: simul.Simulador

The Class-Path attribute should only be used to refer to other JARs (or exploded class directories) external to the current jar file. It's not a path inside the jar.

erickson