Bug 50060 - Java support not working
Java support not working
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-26 08:20 EDT by Bernhard Rosenkraenzer
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-30 15:45:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bernhard Rosenkraenzer 2001-07-26 08:20:31 EDT
[root@zell JAVA]# rpm -q gcc-java libgcj libgcj-devel
gcc-java-2.96-95
libgcj-2.96-26
libgcj-devel-2.96-26
[root@zell JAVA]# cat GijTest.java
public class GijTest {
        public static void main(String[] args) {
                int sum=0;
                for(int current=1; current<=10; current++) {
                        sum+=current;
                }
                System.out.println("Sum = " + sum);
        }
}
[root@zell JAVA]# gij GijTest.java
Segmentation fault (core dumped)
[root@zell JAVA]# gcj GijTest.java
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function 
`_start':
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18): 
undefined reference to `main'
collect2: ld returned 1 exit status
Comment 1 Bernhard Rosenkraenzer 2001-07-26 08:52:03 EDT
Same with gij3/gcj3, by the way.
This is a fresh beta3 install.
Comment 2 Glen Foster 2001-07-30 15:45:31 EDT
This defect is considered SHOULD-FIX for Fairfax
Comment 3 Jakub Jelinek 2001-08-03 08:57:22 EDT
Both command lines are wrong.
gcj should be either used:
gcj -C GijTest.java
(this one compiles it into bytecodes GijTest.class) or
gcj -fmain=GijTest GijTest.java -o GijTest
(this one compiles/links GijTest program).
gij is Java bytecode interpreter, so giving it Java source file is a bad idea.

Note You need to log in before you can comment on or make changes to this bug.