Ok well i have tried manually creating jars and manifest files, none of which seemed to work. I recently discovered that you can create a jar through JCreater-Tools. I created the jar file and unzipped it to get the META-INF folder containing MANIFEST.MF. I modified the manifest file so that it looks like this:
Manifest-Version: 1.0
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Main-Class: payroll


With payroll being the main class of the simple payroll program i created. It simply prompts the user for data and then returns data. It uses an inputFileReader to copy data to about 10 different text documents.

Anyways, whenever I attempt to execute the jar file I get this damn error message:
Failed to load Main-Class manifest attribute from
C:\Documents and Settings \Josh\My Documents\payroll\myJar.jar

any ideas????

thanks

Re: trouble executing java archive 80 80

ok I found out that I didn't update the jar zip file after I changed it. However, when I click on the jar file to ececute it, it no longer displays any error messages, it just doesnt do anything at all!

Re: trouble executing java archive 80 80

make sure there's an empty line after the mainclass argument.
This is required!

Re: trouble executing java archive 80 80

and of course use packages and proper class naming (which you don't seem to be doing at the moment)...

Re: trouble executing java archive 80 80

yes there are 2 'enters' after the main class line in the manifest....
perhaps it has something to do with how I originally created it

commands: "$[JavaHome]\bin\jar.exe"
arguments: cvf $[PrjName].jar .
initial directory: "$[OutputPath]"

I dont know what else it would be

Re: trouble executing java archive 80 80

the manifest file looks like this:

Manifest-Version: 1.0
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Main-Class: Payroll


with Payroll being the main class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.