Hello,

i'm beginner in eclipse and i try the helloWorld.java with Eclipse
After creating the JAR file, if i click it, i have an error message:

Failed to load Main.Class manifest attribute from D:\Ecipse\workspace\HelloWorld\

I don't understand why i can't launch my HelloWorld.jar

My java version is 6.1.7.600

and i use Win7

thank you for your help

long time i nothing to do (meaning compile, just import workbech) in Eclipse, but other IDE has project properties, where you can set main class by name (if needed with argument too, but I think that isn't your..)

Did you create a runnable jar ? or just a jar ?

For a runnable jar you can give the runtime configuration, which will include the main class, something your manifest file seems to be missing.

From the console try running your jar file as:-

java -jar jarfilename.jar <fully qualified name of Main Class>

If it runs via the above command, then the only issue is the main class attribute in your manifest file, else extract your jar file using any zip extraction utilities and check what you are missing.

If you are creating jar files for the first time then knowing the jar file format helps understand such problems, you can check the following link: http://download.oracle.com/javase/tutorial/deployment/jar/index.html

OK thank you.

i unzip the HelloWorld.jar and in the folder of HelloWorld i found:

META-INF
.classpath
.project
HelloWorld.class

When i open the manifest file which is inside the META-INF the content is :

Manifest-Version: 1.0

I think it's not complete what do i have to put here?
Thank you
and nothing else

no, you don't edit or change anymore, these value are generated by project setting, have you set project properties from Eclipse IDE

How do i have to set project properties from eclipse ide.

on the left of the screen there is Package Explorer
then
i right the HelloWorld
then i click on Properties

i have a new windows of "Properties of HelloWorld
and here i don't know what to do.

thank you

somebody don't like you, be sure that I ... about Eclipse, but depends of Version

1/ set mainClass to project properties

2/ for build you have to use some script or download plugin (just reading basic stuff from Eclipse....)

3/ for Java code I using Netbeans, witch is AntiTechnocrati, and contains standard Java Compilator, not custom as in Eclipse

4/ maybe something can hepl you with that..., I'm outta from this thread

Thank you
if somebody don't like me i close this thread now.
but i never use private message here or anywhere else.

If you are out of this thread, it's ok
thank you for your help

i'm reading all tutorial about eclipse and netbeans, i will find

thanks

:-)

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.