PDA

View Full Version : Can someone answer this?



Gaston7eze
01-27-2012, 10:57 PM
I got another question...
Why this doesnt compile?
I use Eclipse:

Code:


import java.util.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import acm.graphics.*;

import acm.graphics.*;
import acm.program.*;
import acm.util.*;
public class Hello extends GraphicsProgram{

public void run(){
addMouseListeners();
addKeyListeners();



}
public void keyPressed( KeyEvent e){
removeAll();


}
public void mouseDragged(MouseEvent e){
GLine gaston= new GLine(1,1,getX(),getY());
add(gaston , e.getX(),e.getY());
gaston.setColor(Color.red);


}
}

I get this error::

"Failed to load Main-Class manifest attribute from: "
What should i do?

x[Warrior]x3500
01-27-2012, 11:23 PM
ur manifest file seems incorrect. make sure "Main-Class:" is correct.

http://forums.devx.com/showthread.php?t=143960

maybe look at post 6

EDIT: just as an fyi, i didnt try to compile ur code because my eclipse is on my other OS. so am solely gettin this answer by only reading your error

EDIT2: After switching OS's, I booted up eclipse and tried it out. I downloaded the ACM jar file, and everything worked fine for me. compiling was ok.

ShawnjohnSJ
01-28-2012, 03:14 AM
Read up on how to correctly create an executable JAR file.

Gaston7eze
01-29-2012, 01:32 PM
x3500;907442']ur manifest file seems incorrect. make sure "Main-Class:" is correct.

http://forums.devx.com/showthread.php?t=143960

maybe look at post 6

EDIT: just as an fyi, i didnt try to compile ur code because my eclipse is on my other OS. so am solely gettin this answer by only reading your error

EDIT2: After switching OS's, I booted up eclipse and tried it out. I downloaded the ACM jar file, and everything worked fine for me. compiling was ok.

What do you did?I cant compile it :(?

Gaston7eze
01-29-2012, 01:38 PM
I need the answer urgently... Pleaseee.

x[Warrior]x3500
01-31-2012, 02:22 AM
sry, sorta forgot bout this :/

umm i just had to dl the jar file for the ACM library u r using. then i included it into my project, and it worked. no errors