Re: Fwd: GCJ version 4.3.3 (gcc --enable-languages) error : The import acm cannot be resolved

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
On 05/07/2010 10:05 AM, Malik Benkirane wrote:
> Hello,
> 
> Here is the program i wish compile with gcj :
> 
>>
>> import acm.graphics.*;
>>
>> import acm.program.GraphicsProgram;
>>
>> public class myfirstgraphics extends GraphicsProgram  {
>>
>> public void run() {
>>
>>        add(new GLabel("hello, world", 100, 100));
>>
>>        }
>>
>> }
> 
> Here is the files in the directory from where i'm running gcj :
> 
>> acm.jar  myfirstgraphics.java
> 
> But even if I specify CLASSPATH ... i always get same errors :
> $> CLASSPATH=. gcj --main=myfirstgraphics -o test myfirstgraphics.java

You have to include jarfiles in the classpath.  This is true, AFAIK, for
every java compiler.

 CLASSPATH=.:acm.jar gcj --main=myfirstgraphics -o test myfirstgraphics.java --main=myfirstgraphics

Andrew.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.