public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0
@ 2005-06-09 10:26 abilalh at yahoo dot com
  2005-06-09 12:40 ` [Bug AWT/21978] GCC 4.0 Awt and Swing problem pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: abilalh at yahoo dot com @ 2005-06-09 10:26 UTC (permalink / raw)
  To: java-prs

hi, i have redhat linux 9.0 installed(everything) in my pc, and i installed
gcc4.0, but when i complied the java program from deitel&deitel it throws
exceptions,


[root@dsn-bilal java test]# ./PopupTest
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
   at java.awt.Toolkit.getDefaultToolkit() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at java.awt.EventQueue.invokeLater(java.lang.Runnable)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.SwingUtilities.invokeLater(java.lang.Runnable)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.RepaintManager.addInvalidComponent(javax.swing.JComponent)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JComponent.revalidate() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JComponent.setOpaque(boolean) (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JPanel.JPanel(java.awt.LayoutManager, boolean)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JPanel.JPanel() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JRootPane.createGlassPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JRootPane.getGlassPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JRootPane.JRootPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.createRootPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.getRootPane() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.frameInit() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at javax.swing.JFrame.JFrame(java.lang.String) (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at PopupTest.PopupTest() (/root/java test/PopupTest.java:13)
   at PopupTest.main(java.lang.String[]) (/root/java test/PopupTest.java:67)
   at gnu.java.lang.MainThread.call_main() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException:
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String) (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   at java.awt.Toolkit.getDefaultToolkit() (/opt/gcc4.0/lib/libgcj.so.6.0.0)
   ...18 more
[root@dsn-bilal java test]#


i have installed gcc4.0 in /opt/gcc4.0 directory and i have checked its paths
using $PATH and $LD_LIB_PATH variables, i have previously installed gcc3.2.2 i
dont know what to do, please tell me step by step to resolve it, i dont know
weather any body have executed any swing program on gcc4.0 or not,



Version-Release number of selected component (if applicable):


How reproducible:
here is the java file

// Fig. 13.8: PopupTest.java
// Demonstrating JPopupMenus
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;

public class PopupTest extends JFrame {
   private JRadioButtonMenuItem items[];
   private Color colorValues[] = 
      { Color.blue, Color.yellow, Color.red };

   public PopupTest()
   {
      super( "Using JPopupMenus" );

      final JPopupMenu popupMenu = new JPopupMenu();
      ItemHandler handler = new ItemHandler();
      String colors[] = { "Blue", "Yellow", "Red" };
      ButtonGroup colorGroup = new ButtonGroup();
      items = new JRadioButtonMenuItem[ 3 ];

      // construct each menu item and add to popup menu; also
      // enable event handling for each menu item
      for ( int i = 0; i < items.length; i++ ) {         
         items[ i ] = new JRadioButtonMenuItem( colors[ i ] );
         popupMenu.add( items[ i ] );
         colorGroup.add( items[ i ] );
         items[ i ].addActionListener( handler );                
      }

      getContentPane().setBackground( Color.white );

      // define a MouseListener for the window that displays
      // a JPopupMenu when the popup trigger event occurs
      addMouseListener(
         new MouseAdapter() {
            public void mousePressed( MouseEvent e )
               { checkForTriggerEvent( e ); } 

            public void mouseReleased( MouseEvent e )
               { checkForTriggerEvent( e ); } 

            private void checkForTriggerEvent( MouseEvent e )
            {
               if ( e.isPopupTrigger() ) 
                  popupMenu.show( e.getComponent(),
                                  e.getX(), e.getY() );               
            }
         }
      );    

      setSize( 300, 200 );
      show();
   }

   public static void main( String args[] )
   {
      PopupTest app = new PopupTest();

      app.addWindowListener(
         new WindowAdapter() {
            public void windowClosing( WindowEvent e )
            {
               System.exit( 0 );
            }
         }
      );
   }

   private class ItemHandler implements ActionListener {
      public void actionPerformed( ActionEvent e )
      {
         // determine which menu item was selected
         for ( int i = 0; i < items.length; i++ )
            if ( e.getSource() == items[ i ] ) {
               getContentPane().setBackground(
                  colorValues[ i ] );
               repaint();
               return;
            }
      }
   }
}

-- 
           Summary: GCC 4.0 Awt and Swing problem linux 9.0
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: AWT
        AssignedTo: fitzsim at redhat dot com
        ReportedBy: abilalh at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
@ 2005-06-09 12:40 ` pinskia at gcc dot gnu dot org
  2005-06-15 13:23 ` abilalh at yahoo dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-09 12:40 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-09 12:40 -------
How did you configure GCC because the AWT library is not configured by default?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|UNCONFIRMED                 |WAITING
            Summary|GCC 4.0 Awt and Swing       |GCC 4.0 Awt and Swing
                   |problem linux 9.0           |problem


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
  2005-06-09 12:40 ` [Bug AWT/21978] GCC 4.0 Awt and Swing problem pinskia at gcc dot gnu dot org
@ 2005-06-15 13:23 ` abilalh at yahoo dot com
  2005-06-15 14:19 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: abilalh at yahoo dot com @ 2005-06-15 13:23 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From abilalh at yahoo dot com  2005-06-15 13:23 -------
(In reply to comment #1)
> How did you configure GCC because the AWT library is not configured by default?

first of all i download the tar package of GCC4.0 and make a directory under
root called gcc4.0 and untar the package in it, then i make a dirctory called
objdir and confirgure the gcc using command /root/gcc4.0/configure
--prefix=/opt/gcc4.0
after that i run the bootstrap using make bootstrap command, after that i
execute make install command under objdir directory to move the binaries to
/opt/gcc4.0, then i set the PATH variable using export
PATH=/opt/gcc4.0/bin:$PATH, then i set the location of the libraries i edit the
/etc/ld/so.config and add the path of newly created library /opt/gcc4.0/lib to
the end of the file, after that i execute the ldconfig program which will
configure the dynamic linker binding, then i setup the LD_LIBRARY_PATH variable,
i edit /etc/profile file and write export LD_LIBRARY_PATH=/opt/gcc4.0/lib
after that when i use command gcc -v -E - to confirm the version of the gcc,
which was gcc4.0 and correct paths, but when i run the swing programs it gives
errors, plz tell me where i am doing wrong in these steps
this is the exect what i followed

bilal

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
  2005-06-09 12:40 ` [Bug AWT/21978] GCC 4.0 Awt and Swing problem pinskia at gcc dot gnu dot org
  2005-06-15 13:23 ` abilalh at yahoo dot com
@ 2005-06-15 14:19 ` pinskia at gcc dot gnu dot org
  2005-06-15 17:38 ` abilalh at yahoo dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-15 14:19 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-15 14:19 -------
You need to configure libgcj to produce the AWT peers using the following options:
--enable-java-awt=gtk

Please read the "AWT-Specific Options" section of <http://gcc.gnu.org/install/configure.html>.

Does this work now?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
                   ` (2 preceding siblings ...)
  2005-06-15 14:19 ` pinskia at gcc dot gnu dot org
@ 2005-06-15 17:38 ` abilalh at yahoo dot com
  2005-06-15 18:16 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: abilalh at yahoo dot com @ 2005-06-15 17:38 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From abilalh at yahoo dot com  2005-06-15 17:38 -------
(In reply to comment #3)
> You need to configure libgcj to produce the AWT peers using the following 
options:
> --enable-java-awt=gtk
> Please read the "AWT-Specific Options" section of 
<http://gcc.gnu.org/install/configure.html>.
> Does this work now?

thanks, but i have configured the gcc, should i have to build the gcc once 
again, which takes long time, or should i download the libgcj package and then 
configure it, plz tell me simple step by step approch to follow, 
thanks


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
                   ` (3 preceding siblings ...)
  2005-06-15 17:38 ` abilalh at yahoo dot com
@ 2005-06-15 18:16 ` pinskia at gcc dot gnu dot org
  2005-06-18 12:57 ` abilalh at yahoo dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-15 18:16 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-15 18:16 -------
(In reply to comment #4)
Yes you have to recompile GCC/GCJ.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
                   ` (4 preceding siblings ...)
  2005-06-15 18:16 ` pinskia at gcc dot gnu dot org
@ 2005-06-18 12:57 ` abilalh at yahoo dot com
  2005-06-19  1:07 ` rmathew at gcc dot gnu dot org
  2005-06-20 14:53 ` abilalh at yahoo dot com
  7 siblings, 0 replies; 9+ messages in thread
From: abilalh at yahoo dot com @ 2005-06-18 12:57 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From abilalh at yahoo dot com  2005-06-18 12:57 -------
(In reply to comment #5)
> (In reply to comment #4)
> Yes you have to recompile GCC/GCJ.

i recomplie gcc4.0 with --enable-java-awt=gtk configure option but it gave error
on make bootstrap command that gtk version greater than 2.0 is needed , then i
installed gtk 2.4.14 version which need , pango,atk, and glib updated versions,
then i installed the pango, atk and glib updated versions, then i run the
command on gcc directory i.e. ./configure --prefix=/opt/gcc4.0 --enable-java-awt=gtk
this is the following out put

[root@bilal gcc-4.1-20050417]# ./configure --prefix=/opt/gcc4.1
--enable-java-awt=gtk
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for gnatbind... gnatbind
checking whether compiler driver understands Ada... yes
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for MPFR... no
The following languages will be built: c,c++,java,objc
*** This configuration is not supported in the following subdirectories:
     target-libada gnattools target-libgfortran
    (Any other directories should still work fine.)
checking for bison... bison
checking for bison... bison -y
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for i686-pc-linux-gnu-ar... no
checking for ar... ar
checking for i686-pc-linux-gnu-as... no
checking for as... as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... dlltool
checking for i686-pc-linux-gnu-ld... no
checking for ld... ld
checking for i686-pc-linux-gnu-nm... no
checking for nm... nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-linux-gnu-windres... no
checking for windres... windres
checking for i686-pc-linux-gnu-objcopy... no
checking for objcopy... objcopy
checking for i686-pc-linux-gnu-objdump... no
checking for objdump... objdump
checking for i686-pc-linux-gnu-ar... no
checking for ar... ar
checking for i686-pc-linux-gnu-as... no
checking for as... as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... dlltool
checking for i686-pc-linux-gnu-ld... no
checking for ld... ld
checking for i686-pc-linux-gnu-nm... no
checking for nm... nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-linux-gnu-windres... no
checking for windres... windres
checking whether to enable maintainer-specific portions of Makefiles... no
checking if symbolic links between directories work... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
[root@bilal gcc-4.1-20050417]#

then i run the make bootstrap command and some last lines are listed below


Using host-linux.o for host machine hooks.
checking whether NLS is requested... yes
checking for catalogs to be installed...  be ca da de el es fr ja nl rw sv tr
checking what assembler to use... /usr/bin/as
checking what linker to use... /usr/bin/ld
checking what nm to use... nm
checking what objdump to use... objdump
checking assembler for .balign and .p2align... yes
checking assembler for .p2align with maximum skip... yes
checking assembler for working .subsection -1... yes
checking assembler for .weak... yes
checking assembler for .nsubspa comdat... no
checking assembler for .hidden... yes
checking linker for .hidden support... yes
checking assembler for .sleb128 and .uleb128... yes
checking assembler for eh_frame optimization... yes
checking assembler for section merging support... yes
checking assembler for COMDAT group support... no
checking assembler for COMDAT group support... no
checking assembler for thread-local storage support... yes
checking linker -Bstatic/-Bdynamic option... yes
checking assembler for filds and fists mnemonics... yes
checking assembler for cmov syntax... no
checking assembler for GOTOFF in data... yes
checking assembler for dwarf2 debug_line support... yes
checking assembler for buggy dwarf2 .file directive... no
checking assembler for --gdwarf2 option... yes
checking assembler for --gstabs option... yes
checking linker read-only and read-write section mixing... read-write
checking linker PT_GNU_EH_FRAME support... yes
checking linker position independent executable support... no
checking linker --as-needed support... no
Using ggc-page for garbage collection.
checking whether to enable maintainer-specific portions of Makefiles... no
Links are now set up to build a native compiler for i686-pc-linux-gnu.
updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gccbug
config.status: creating mklibgcc
config.status: creating libada-mk
config.status: creating auto-host.h
config.status: executing default commands
Bootstrapping the compiler
make[1]: Entering directory `/root/gcc4.1/gcc-4.1-20050417/gcc'
make[1]: *** No rule to make target `bootstrap'.  Stop.
make[1]: Leaving directory `/root/gcc4.1/gcc-4.1-20050417/gcc'
make: *** [bootstrap] Error 2
[root@bilal gcc-4.1-20050417]#


what should i do now ?
gtk and other dependencies are installed correctly

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
                   ` (5 preceding siblings ...)
  2005-06-18 12:57 ` abilalh at yahoo dot com
@ 2005-06-19  1:07 ` rmathew at gcc dot gnu dot org
  2005-06-20 14:53 ` abilalh at yahoo dot com
  7 siblings, 0 replies; 9+ messages in thread
From: rmathew at gcc dot gnu dot org @ 2005-06-19  1:07 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rmathew at gcc dot gnu dot org  2005-06-19 01:07 -------
I think you're trying to configure and compile GCC in 
the source folder. Unfortunately, this is not yet supported.
Try creating a new folder totally outside of the GCC source 
tree and then run configure and "make bootstrap" in this
folder.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug AWT/21978] GCC 4.0 Awt and Swing problem
  2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
                   ` (6 preceding siblings ...)
  2005-06-19  1:07 ` rmathew at gcc dot gnu dot org
@ 2005-06-20 14:53 ` abilalh at yahoo dot com
  7 siblings, 0 replies; 9+ messages in thread
From: abilalh at yahoo dot com @ 2005-06-20 14:53 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From abilalh at yahoo dot com  2005-06-20 14:52 -------
(In reply to comment #7)
> I think you're trying to configure and compile GCC in 
> the source folder. Unfortunately, this is not yet supported.
> Try creating a new folder totally outside of the GCC source 
> tree and then run configure and "make bootstrap" in this
> folder.

thanks a lot i am finally running with java swing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21978


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-06-20 14:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-09 10:26 [Bug AWT/21978] New: GCC 4.0 Awt and Swing problem linux 9.0 abilalh at yahoo dot com
2005-06-09 12:40 ` [Bug AWT/21978] GCC 4.0 Awt and Swing problem pinskia at gcc dot gnu dot org
2005-06-15 13:23 ` abilalh at yahoo dot com
2005-06-15 14:19 ` pinskia at gcc dot gnu dot org
2005-06-15 17:38 ` abilalh at yahoo dot com
2005-06-15 18:16 ` pinskia at gcc dot gnu dot org
2005-06-18 12:57 ` abilalh at yahoo dot com
2005-06-19  1:07 ` rmathew at gcc dot gnu dot org
2005-06-20 14:53 ` abilalh at yahoo dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).