[rhn-users] Newbie: Installing jdk1.5.0_06 on FC3

Mallasch, Paul Paul.Mallasch at Tectura.com
Tue Jun 6 19:07:02 UTC 2006


I've had to also put Java in the path.
 
export PATH=$JAVA_HOME/bin:$PATH
 

-paul


  _____  

From: rhn-users-bounces at redhat.com [mailto:rhn-users-bounces at redhat.com] On Behalf Of Peter Kühnlein
Sent: Tuesday, June 06, 2006 11:50 AM
To: rhn-users at redhat.com
Subject: [rhn-users] Newbie: Installing jdk1.5.0_06 on FC3


Dear Colleagues,

I'm a bloody java beginner and got an installation/configuration problem. I downloaded and installed sun's jdk1.5.0_06 to my FC3 box in /usr/share/jdk1.5.0_06/. I fiddled around with the symlinks to point to the binaries in .../bin/ and javac etc. now run. However, I get a 

java.lang.ClassCastException: SwingUI
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
        at sun.applet.AppletPanel.run(AppletPanel.java:324)
        at java.lang.Thread.run(Thread.java:595)

when I try to view the class built from the simple code at the end of this message with appletviewer (all of the code there for completeness). I do think java doesn't find javax.* - and don't know how to tell it where it is. I've set my 

JAVA_HOME=/usr/share/jdk1.5.0_06/

(that's where my installation is).

Any idea what is going wrong here? (I posted a similar question to the parallel sun-list, but got no solution from there...)

THX, Peter

Code:

import java.awt.Color;
import java.awt.BorderLayout;
import java.awt.event.*;
import javax.swing.*;

   public class SwingUI extends JFrame
                 implements ActionListener {
   JLabel text, clicked;
   JButton button, clickButton;
   JPanel panel;
   private boolean _clickMeMode = true;
   public void init() {
        System.out.println("starting...");
  }

   public SwingUI(){ //Begin Constructor
     text = new JLabel("I'm a Simple Program");
     button = new JButton("Click Me");
     button.addActionListener(this);

     panel = new JPanel();
     panel.setLayout(new BorderLayout());
     panel.setBackground(Color.white);
     getContentPane().add(panel);
     panel.add(BorderLayout.CENTER, text);
     panel.add(BorderLayout.SOUTH, button);
   } //End Constructor

   public void actionPerformed(ActionEvent event){
        Object source = event.getSource();
        if (_clickMeMode) {
          text.setText("Button Clicked");
          button.setText("Click Again");
          _clickMeMode = false;
        } else {
          text.setText("I'm a Simple Program");
          button.setText("Click Me");
          _clickMeMode = true;
        }
   }

   public static void main(String[] args){
     SwingUI frame = new SwingUI();
     frame.setTitle("Example");
          _clickMeMode = false;
        } else {
          text.setText("I'm a Simple Program");
          button.setText("Click Me");
          _clickMeMode = true;
        }
   }

   public static void main(String[] args){
     SwingUI frame = new SwingUI();
     frame.setTitle("Example");
     WindowListener l = new WindowAdapter() {
       public void windowClosing(WindowEvent e) {
         System.exit(0);
       }
     };

     frame.addWindowListener(l);
     frame.pack();
     frame.setVisible(true);
  }

}


-- 

http://www.peter-kuehnlein.net

"The Way of the Samurai is in desperateness. Ten men or more cannot

 kill such a man."

(Hagakure)



Upcoming event:

http://www.constraints-in-discourse.org/cid06
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhn-users/attachments/20060606/d3d4e50b/attachment.htm>


More information about the rhn-users mailing list