* can't run my jarmake output
@ 2000-04-05 0:00 John Dalbey
2000-04-06 0:00 ` JGNAT: " Geoff Bull
0 siblings, 1 reply; 2+ messages in thread
From: John Dalbey @ 2000-04-05 0:00 UTC (permalink / raw)
JGNAT looks really neat so far ...
$ jgnatmake blastoff
jgnat -c blastoff.adb
jgnatbind -x blastoff.ali
jgnatlink blastoff.ali
$ java blastoff
Countdown to JGNAT ...
10 9 8 7 6 5 4 3 2 1 0
BLASTOFF!
So my Ada code runs on the JVM ... Cool!
but I can't figure out how to run the .jar files produced by the jarmake
tool.
$ jarmake -oblastoff.jar blastoff.class
$ java -jar blastoff.jar
Failed to load Main-Class manifest attribute from
blastoff.jar
Isn't all that's necessary is to provide the -jar switch on the command
line? It is NOT an applet, so I don't use appletviewer. Am I missing
some basic concept here?
I couldn't find any reference to the word "manifest" in the user guide.
I'm stumped.
Thanks,
--jd
^ permalink raw reply [flat|nested] 2+ messages in thread
* JGNAT: Re: can't run my jarmake output
2000-04-05 0:00 can't run my jarmake output John Dalbey
@ 2000-04-06 0:00 ` Geoff Bull
0 siblings, 0 replies; 2+ messages in thread
From: Geoff Bull @ 2000-04-06 0:00 UTC (permalink / raw)
To: John Dalbey
John Dalbey wrote:
>
> JGNAT looks really neat so far ...
>
<neat stuff snipped>
>
> but I can't figure out how to run the .jar files produced by the jarmake
> tool.
>
> $ jarmake -oblastoff.jar blastoff.class
>
> $ java -jar blastoff.jar
> Failed to load Main-Class manifest attribute from
> blastoff.jar
This is because jarmake doesn't add a manifest to the jarfile,
and looking at the source I couldn't see an option to make it do so
You could add one by:
Unpacking the jar file.
$ jar xvf blastoff.jar
Creating a manifest file:
$ echo "Main-Class: blastoff" > blastoff.manifest
Then rebuild the jarfile with the command:
$ jar cmf blastoff.manifest new_blastoff.jar all_the_files_you extracted.
$ java -jar new_blastoff.jar
should work.
I think all_the_files_you extracted = blastoff.class ada_blastoff.class jgnat
I tried this with the hello example and it worked.
If there really is no way to make jarmake add a manifest
specifying the main class, then that is a major shortcoming.
There is another (better) way to work around this:
$ mkdir META-INF
$ echo "Main-Class: blastoff" > META-INF/MANIFEST.MF
$ jarmake -oblastoff.jar blastoff.class META-INF/MANIFEST.MF
$ java -jar blastoff.jar
Cheers
Geoff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-04-06 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-05 0:00 can't run my jarmake output John Dalbey
2000-04-06 0:00 ` JGNAT: " Geoff Bull
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox