Error when trying to run java program with gij
Per-Olof Wallin
perwal-6@student.luth.se
Fri Apr 19 07:20:00 GMT 2002
> Try setting your CLASSPATH environment variable to point to where
> `hello.class' is found.
Sorry, I forgot to mention that. I'd already done that, but it didn't work.
Any other suggestions?
Also let me make an addition and make it clear what I have done. Someone thought
it wasn't clear what I'd done.
I compiled my program, the classic Hello World-program, with gcj into a class
file: >>gcj -C hello.java.
That works fine but when trying to run with gij: >>gij hello, I get an error
message:
>> Exception in thread "main" java.lang.ClassNotFoundException: hello
If I try to run the compiled class-file using jdk 1.3: >>java hello, the program
works fine.
The program I'm trying to run is sitting in a file called hello.java:
public class hello{
public static void main(String argv[]) {
System.out.println("Hello World!");
}
}
Additional problem:
Today I've also tried compiling the program into object files using: >>gcj
hello.java and >>gcj hello.class, but neither of the commands work. I get the
message:
>>Undefined first referenced
>> symbol in file
>>main
>>/users/pwallin/gcc/3.0.4/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/crt1.o
>>ld: fatal: Symbol referencing errors. No output written to a.out
>>collect2: ld returned 1 exit status
Thanks for any help.
/Per-Olof Wallin
More information about the Java
mailing list