comp.lang.ada
 help / color / mirror / Atom feed
From: Geoff Bull <geoff@research.canon.com.au>
To: John Dalbey <jdalbey@calpoly.edu>
Subject: JGNAT: Re: can't run my jarmake output
Date: 2000/04/06
Date: 2000-04-06T03:55:47+00:00	[thread overview]
Message-ID: <38EC0AE3.C65548D0@research.canon.com.au> (raw)
In-Reply-To: 38EBF447.6C287831@calpoly.edu

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




      reply	other threads:[~2000-04-06  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-05  0:00 can't run my jarmake output John Dalbey
2000-04-06  0:00 ` Geoff Bull [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox