[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

jar problems

Posted on 2004-11-11
8
Medium Priority
?
267 Views
Last Modified: 2010-05-18
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
0
Comment
Question by:nesnemis
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 92

Accepted Solution

by:
objects earned 750 total points
ID: 12552987
looks like your " don't match
0
 
LVL 92

Expert Comment

by:objects
ID: 12552991
i'd suggest getting rid of them altogether
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 750 total points
ID: 12553004
> Class-Path: "ext_jars/jt400Native.jar"
> "ext_jars/"ext_jars/poi-2.5.1-final-20040804.jar"

Change the above to

Class-Path: ext_jars/jt400Native.jar ext_jars/poi-2.5.1-final-20040804.jar

and try again. Also make sure that your main class is the PrislisteMain and it is in the /main folder.

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 24

Expert Comment

by:sciuriware
ID: 12553061
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!
<*>
0
 
LVL 3

Author Comment

by:nesnemis
ID: 12553082
>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
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 12553095
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.
<*>
0
 
LVL 3

Author Comment

by:nesnemis
ID: 12553118
>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...
0
 
LVL 35

Expert Comment

by:girionis
ID: 12553124
:)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question