appletviewer does not kick in linux

i'm new to java and am testing it to both linux and windows. i started with basic simple tutorial after installing j2sdk1.4.2_06 in windows and linux. i have no problem with windows except with linux. i can compile and run using javac and java commands in the terminal however, when i started with appletviewer command the result is

-bash: appletviewer: command not found.

Also i run and compliled the program below in linux

import javax.swing.JOptionPane;

public class Welcome4 {

public static void main (String args[])

{

JOptionPane.showMessageDialog(

null, "Welcome\nto\nJava\nProgramming!");

System.exit (0); //terminate program

}

}

but the result is

Exception in thread "main" java.lang.InternalError: unexpected exception during

linking: java.lang.ClassNotFoundException: javax.swing.JOptionPane

at 0x40268e17: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/./libgcj.so.3)

at 0x4025bc8e: java.lang.Error.Error(java.lang.String) (/usr/lib/./libgcj.so.3)

at 0x402691fa: java.lang.VirtualMachineError.VirtualMachineError(java.lang.String) (/usr/lib/./libgcj.so.3)

at 0x4025d62e: java.lang.InternalError.InternalError(java.lang.String) (/usr/lib/./libgcj.so.3)

at 0x4025ad82: java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)

at 0x4024646c: java.lang.Class.initializeClass() (/usr/lib/./libgcj.so.3)

at 0x40244d04: java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/./libgcj.so.3)

at 0x40244d9f: java.lang.Class.forName(java.lang.String) (/usr/lib/./libgcj.so.3)

at 0x402ad01d: gnu.gcj.runtime.FirstThread.run() (/usr/lib/./libgcj.so.3)

at 0x4024fc4c: _Jv_ThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)

at 0x4021c8ac: _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/./libgcj.so.3)

at 0x08048910: ? (?:0)

at 0x42015574: __libc_start_main (/lib/tls/libc.so.6)

at 0x080486c1: ? (?:0)

i installed j2sdk and j2re in a /home/raport/Java after following the instructions in the sun installation page.

thank you so much for any help on this matter.

rporticio

[2258 byte] By [rporticio] at [2007-9-30 20:41:21]
# 1
i got some idea from previous forum using the path command. the appletviewer already kicks. but the JOptionPane thing is still a problem.please help.thanks again.rporticio
rporticio at 2007-7-7 1:30:23 > top of Java-index,Administration Tools,Sun Connection...
# 2
java -version will tell which version of java is found, given a PATH setting. Some distributions might come with a default 1.1 java version .
BIJ001 at 2007-7-7 1:30:23 > top of Java-index,Administration Tools,Sun Connection...