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

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!

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

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

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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.