Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jar problem again

Status
Not open for further replies.

rs51

Technical User
Oct 13, 2001
163
0
0
PT
I have this problem: i want to create a jar file from a package called pt.rs.divelog
i use this dir:
C:\Java_Granel\Classes\pt\rs\divelog
inside this last one i've my classes and a folder named images with gifs, etc inside.
I tried creating the .mf and the .jar inside the last and first folders, but i get msgs errors.

When i run the app from msdos, i use C:\Java_Granel\Classes\pt\rs\divelog>java -classpath C:\java_granel\classes pt.rs.divelog.DiveLog

to compile from msdos i use:
C:\Java_Granel\Classes\pt\rs\divelog>javac -classpath C:\Java_Granel\Classes\ DiveLog.java

How should i organize things:
where to put the manifest?
where to create the jar?
from which dir should i run the command line?
 
In the dos prompt :
Code:
cd C:\Java_Granel\Classes
jar -cvf myjar.jar *
set CLASSPATH=%CLASSPATH%;C:\Java_Granel\Classes\myjar.jar
java pt.rs.divelog.DiveLog

forget about the manifest.
 
Thanks for your help
i tried exactly what you recomended but the result is the same i got (after i posted): i only get A PART of the final result.
I explain better: i'm following this tut from sun about GUI and i'm building a dive log app.
I'm not over yet, and (to complicate a bit) i used a more complex package: pt/rs/divelog instead of simply: divelog.
Anyway, when i run the app from msdos like this:
C:\Java_Granel\Classes\pt\rs\divelog>java -classpath C:\java_granel\classes pt.rs.divelog.DiveLog,
i get everything i made so far.
Instead, using your method or mine (with .mf file), i only see PART of the components i see when i run from msdos.
More!: when double clicking in the jar i get this error msg:
failed to load main-class manifest atribute from C:\Java_Granel\Classes\myapp.jar

Why?
 
>>>>> i only see PART of the components i see when i run from msdos

How do you mean ? Do you think you are missing classes, or images or what ?

Open the jar file with WinZip, or type :

jar -tvf myjar.jar

to view the actual contents of the jar - to check all classes are there, and you have not missed some out from another directory ...

What is the contents of your manifest ?
 
hi again
i checked from msdos and all files are inside .jar.
What i mean is that in my app , for instance, my FJrame has an icon, but when i run the jar, the icon doesnt show up,
when i run the app from dos, i see all North, South, East, West and Center pannes fullfilled, but from jar i only see north.
here's my manifest:

Manifest-Version: 1.2
Name: pt/rs/divelog/DiveLog.class
Main-Class: pt/rs/divelog.DiveLog

with a new line at the end

i also tried several changes with the manifest: without version, without the .class but allways works the same way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top