Problem with an executable jar

Hello everyone,

I have a working jar file built by an ant script and it's working correctly. I am trying to rework the script so that the jar would be executable. I put the manifest attribute Main-Class and pointed it at the correct location of the class whose main() method should be run, but when I try to execute the jar file via the jar.exe, the main class cannot find the external libraries (I'm using log4j, ojdbc, etc.) and those I have included in the class path with the script creating the jar.

Another thing, when I'm using the standard src and bin dirs for java and class files, do I need to include them in the package path to the main class.

E.g. For example, my main class is located in:

ProjectName/src/package1/package2/MainClass.java

ProjectName/bin/package1/package2/MainClass.bin

and as value for the main-class manifest attribute I've put:

package1/package2/MainClass

Is that correct and have you got any idea what to do so that the application can read from the external libraries (relate them in some specific way, put them in a specific dir)?

Thanks,

A. Dobrev

null

[1168 byte] By [argh313ba] at [2007-11-27 10:14:10]
# 1

i think you package names should have periods not slashes

example:

package1.package2.MainClass

also did you remember to hit enter an the end of the line in your manifest file.

thanks

khalidkattana at 2007-7-28 15:31:35 > top of Java-index,Desktop,Deploying...
# 2

I actually solved it and as most of the times it was my own fault that I always think about the complicity of the problem and do not start from the easy part. I had messed the paths to the external libraries from my working directory. Fixed the ant script and it's working now.

argh313ba at 2007-7-28 15:31:35 > top of Java-index,Desktop,Deploying...