SRL Archive - Java Help and Tutorials

Can someone answer this?


Gaston7eze

2012-01-27 17:57:23

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

2012-01-27 18:23:52

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

2012-01-27 22:14:38

Read up on how to correctly create an executable JAR file.

Gaston7eze

2012-01-29 08:32:19

From: x[Warrior]x3500
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

2012-01-29 08:38:09

I need the answer urgently… Pleaseee.

x[Warrior]x3500

2012-01-30 21:22:05

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