Link to home
Start Free TrialLog in
Avatar of nesnemis
nesnemis

asked on

jar problems

Hi

I'm trying to create a jar file which includes two jar-packages and contains a main class.

The manifest file that I have created is:
Manifest-Version: 1.0
Created-By: esi
Main-Class: main.PrislisteMain
Class-Path: "ext_jars/jt400Native.jar" "ext_jars/"ext_jars/poi-2.5.1-final-20040804.jar"

But when I run jar... the Class-Path is ignored and the manifest file in the jar looks like this:
Manifest-Version: 1.0
Created-By: esi
Main-Class: main.PrislisteMain

When I try to run the jar I get: "Could not find the main class"

I'm sure that I'm pointing to the right mainClass-file, and the external jars are included when I pack my jar.

If anyone has any idea, please help

Thanks in advance
nesnemis
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i'd suggest getting rid of them altogether
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sciuriware
sciuriware

Did you put those 2 other .jars INSIDE your primary .jar?  That's not right,
you can merge them or keep them apart, but you can't put a .jar inside another .jar!
<*>
Avatar of nesnemis

ASKER

>looks like your " don't match
I see that now, but I've tried earlier wihtout the "'s and that did'nt work either. My main class file is located correctly

But I got it to work, I added two blank lines at the end of my manifest file and it worked!!!

Do you have an idea of why you need that?

Anyway, I'm splitting the points between objects and girionis for quick answers and trying to help, and when I don't post the correct manifest file, it's not easy to see what the real problem is :)

nesnemis
The extra lines at the bottom of a manifest are mandatory, but not explained by SUN (as far as I know).
I think it's a (small) bug or some future reservation in java.
<*>
>Did you put those 2 other .jars INSIDE your primary .jar?  That's not right,
>you can merge them or keep them apart, but you can't put a .jar inside another .jar!

works for me...