Bug 50060 - Java support not working
Summary: Java support not working
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-26 12:20 UTC by Bernhard Rosenkraenzer
Modified: 2007-04-18 16:35 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Bernhard Rosenkraenzer 2001-07-26 12:20:31 UTC
[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 12:52:03 UTC
Same with gij3/gcj3, by the way.
This is a fresh beta3 install.


Comment 2 Glen Foster 2001-07-30 19:45:31 UTC
This defect is considered SHOULD-FIX for Fairfax

Comment 3 Jakub Jelinek 2001-08-03 12:57:22 UTC
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.