Hi All,
I'm trying to run some of the demos included in the Java 2 download. They
all give the same error message. I've tried running both the jar file and
I've also compile them myself and tried running the class file. The error
message is given below and the actual program is given further
down.
Any help would be greatly appreciated.
Thanks,
Howard
triazo@linux:~/java > java
SimpleExample
Font specified in font.properties not found
[--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific]
Font
specified in font.properties not found
[--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific]
current locale is
not supported in X11, locale is set to Cjava:
../../../../../src/solaris/hpi/green_threads/src/dl-malloc.c:1214:
do_check_chunk: Assertion `(char*)p + sz <=
(char*)(((mbinptr)(&(av_[2 * (0)])))->fd)'
failed.
SIGABRT 6* abort (generated by abort(3)
routine, also SIGIOT)
si_signo [6]: SIGABRT
6* abort (generated by abort(3) routine, also
SIGIOT)
si_errno [0]: Success
si_code [0]: SI_USER [pid: 1649, uid:
500]
stackpointer=0xbfffc220
OUCH: nested memory code, to 1 levels.
Full thread dump Classic VM (JDK-1.2.2_009, green
threads):
"AWT-Motif" (TID:0x40ee78e0,
sys_thread_t:0x83a2618, state:R)
prio=5
at
sun.awt.motif.MToolkit.run(Native
Method)
at
java.lang.Thread.run(Thread.java:479)
"SunToolkit.PostEventQueue-0" (TID:0x40ee7978, sys_thread_t:0x837a290, state:CW)
prio=5
at
java.lang.Object.wait(Native
Method)
at
java.lang.Object.wait(Object.java:424)
at sun.awt.PostEventQueue.run(SunToolkit.java:413)
"AWT-EventQueue-0" (TID:0x40ee7b00, sys_thread_t:0x836db18, state:CW)
prio=6
at
java.lang.Object.wait(Native
Method)
at
java.lang.Object.wait(Object.java:424)
at
java.awt.EventQueue.getNextEvent(EventQueue.java:222)
at
java.awt.EventDispatchThread.pumpOneEventForComponent(EventDispatchThread.java:107)
at
java.awt.EventDispatchThread.pumpEventsForComponent(EventDispatchThread.java:95)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:90)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
"Finalizer" (TID:0x40ee1320, sys_thread_t:0x8108b48, state:CW)
prio=8
at
java.lang.Object.wait(Native
Method)
at
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:112)
at
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
at
java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
"Reference Handler" (TID:0x40ee13b0, sys_thread_t:0x8104080, state:CW)
prio=10
at
java.lang.Object.wait(Native
Method)
at
java.lang.Object.wait(Object.java:424)
at
java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
"Signal dispatcher" (TID:0x40ee13e0, sys_thread_t:0x8102480, state:CW)
prio=5
"main" (TID:0x40ee11e0, sys_thread_t:0x804bc58,
state:R) prio=5
at
sun.awt.motif.MFramePeer.pSetTitle(Native
Method)
at
sun.awt.motif.MFramePeer.<init>(MFramePeer.java:172)
at
sun.awt.motif.MToolkit.createFrame(MToolkit.java:144)
at
java.awt.Frame.addNotify(Frame.java:274)
at
java.awt.Window.pack(Window.java:264)
at SimpleExample.main(SimpleExample.java:158)
Monitor Cache
Dump:
java.lang.ref.Reference$Lock@40EE13C0/40F168A8:
<unowned>
Waiting to be
notified:
"Reference Handler" (0x8104080)
java.awt.EventQueue@40EE7DD8/40FBDB78:
<unowned>
Waiting to be
notified:
"AWT-EventQueue-0" (0x836db18)
java.lang.ref.ReferenceQueue$Lock@40EE1338/40F16D78:
<unowned>
Waiting to be
notified:
"Finalizer" (0x8108b48)
sun.awt.PostEventQueue@40EE7978/40FBFB60:
<unowned>
Waiting to be
notified:
"SunToolkit.PostEventQueue-0" (0x837a290)
java.awt.Component$AWTTreeLock@40EE9490/40F438F8:
owner "main" (0x804bc58) 1 entry
java.lang.Class@40EF6968/40F586E8:
owner "main" (0x804bc58) 1 entry
Registered Monitor
Dump:
utf8 hash table:
<unowned>
JNI pinning lock:
<unowned>
JNI global reference lock:
<unowned>
BinClass lock:
<unowned>
Class linking lock:
<unowned>
System class loader lock:
<unowned>
Code rewrite lock:
<unowned>
Heap lock:
<unowned>
Monitor cache lock: owner "main"
(0x804bc58) 1 entry
Dynamic loading lock:
<unowned>
Monitor IO lock:
<unowned>
User signal monitor:
<unowned>
Waiting to be
notified:
"Signal dispatcher" (0x8102480)
Child death monitor:
<unowned>
I/O monitor: owner "AWT-Motif" (0x83a2618)
1 entry
Alarm monitor:
<unowned>
Waiting to be
notified:
<unknown thread> (0x80571f8)
Thread queue lock:
owner "main" (0x804bc58) 1 entry
Monitor registry: owner
"main" (0x804bc58) 1 entry
OUCH: nested memory code, to 1
levels.
triazo@linux:~/java
>
******************************************* End of Error Messages
******************************************** SUN's demo
program
/*
* @(#)SimpleExample.java 1.23
99/04/23
*
* Copyright (c) 1997-1999 by Sun Microsystems, Inc.
All Rights Reserved.
*
* Sun grants you ("Licensee") a
non-exclusive, royalty free, license to use,
* modify and redistribute
this software in source and binary code form,
* provided that i) this
copyright notice and license appear on all copies of
* the software;
and ii) Licensee does not utilize the software in a manner
* which is
disparaging to Sun.
*
* This software is provided "AS IS,"
without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS,
REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
*
NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT
BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO
EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE,
PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL,
INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE
THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE
SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH
DAMAGES.
*
* This software is not designed or intended for
use in on-line control of
* aircraft, air traffic, aircraft navigation
or aircraft communications; or in
* the design, construction, operation
or maintenance of any nuclear
* facility. Licensee represents and
warrants that it will not use or
* redistribute the Software for such
purposes.
*/
import java.awt.*;
import java.awt.event.*;
import
javax.swing.*;
/**
* An application that displays a JButton and several
JRadioButtons.
* The JRadioButtons determine the look and feel used by
the application.
*/
public class SimpleExample extends JPanel
{
static JFrame frame;
static String metal= "Metal";
static String metalClassName = "javax.swing.plaf.metal.MetalLookAndFeel";
static String motif = "Motif";
static String motifClassName =
"com.sun.java.swing.plaf.motif.MotifLookAndFeel";
static String windows = "Windows";
static String windowsClassName =
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
JRadioButton metalButton, motifButton,
windowsButton;
public SimpleExample() {
// Create the
buttons.
JButton button = new JButton("Hello,
world");
button.setMnemonic('h');
//for looks only; button does nada
metalButton = new
JRadioButton(metal);
metalButton.setMnemonic('o');
metalButton.setActionCommand(metalClassName);
motifButton = new
JRadioButton(motif);
motifButton.setMnemonic('m');
motifButton.setActionCommand(motifClassName);
windowsButton = new
JRadioButton(windows);
windowsButton.setMnemonic('w');
windowsButton.setActionCommand(windowsClassName);
// Group the radio buttons.
ButtonGroup group = new
ButtonGroup();
group.add(metalButton);
group.add(motifButton);
group.add(windowsButton);
// Register a listener for the
radio buttons.
RadioListener myListener = new
RadioListener();
metalButton.addActionListener(myListener);
motifButton.addActionListener(myListener);
windowsButton.addActionListener(myListener);
add(button);
add(metalButton);
add(motifButton);
add(windowsButton);
}
/** An ActionListener that listens to the radio
buttons. */
class RadioListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
String lnfName = e.getActionCommand();
try
{
UIManager.setLookAndFeel(lnfName);
SwingUtilities.updateComponentTreeUI(frame);
frame.pack();
}
catch (Exception exc)
{
JRadioButton button =
(JRadioButton)e.getSource();
button.setEnabled(false);
updateState();
System.err.println("Could not load LookAndFeel: " +
lnfName);
}
}
}
public void updateState() {
String lnfName =
UIManager.getLookAndFeel().getClass().getName();
if
(lnfName.indexOf(metal) >= 0) {
metalButton.setSelected(true);
} else if (lnfName.indexOf(windows)
>= 0) {
windowsButton.setSelected(true);
} else if (lnfName.indexOf(motif)
>= 0) {
motifButton.setSelected(true);
} else
{
System.err.println("SimpleExample is using
an unknown L&F: " + lnfName);
}
}
public static void main(String s[]) {
/*
NOTE: By default, the look and feel will be set to
the
Cross Platform Look and Feel (which is currently
Metal).
The user may someday be able to override the
default
via a system property. If you as the developer
want to
be sure that a particular L&F is set, you can
do so
by calling UIManager.setLookAndFeel(). For example,
the
first code snippet below forcibly sets the UI to be
the
System Look and Feel. The second code snippet
forcibly
sets the look and feel to the Cross Platform
L&F.
Snippet 1:
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception exc)
{
System.err.println("Error loading L&F: " +
exc);
}
Snippet 2:
try
{
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (Exception exc)
{
System.err.println("Error loading L&F: " +
exc);
}
*/
SimpleExample panel = new SimpleExample();
frame =
new JFrame("SimpleExample");
frame.addWindowListener(new
WindowAdapter() {
public void
windowClosing(WindowEvent e)
{System.exit(0);}
});
frame.getContentPane().add("Center",
panel);
frame.pack();
frame.setVisible(true);
panel.updateState();
}
}