LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-02-2005, 10:01 AM   #1
General_Redneck
LQ Newbie
 
Registered: Feb 2005
Posts: 2

Rep: Reputation: 0
Java jives


Ok here is the deal, With the Java 2 SDK 1.4.2, I am having problems running certain programs...

A program like this
Code:
public class Test
{
	public static void main(String[] args)
	{
		System.out.println("Welcome to Java!");
	}
}
compiles fine and then when I run it using java it will print out "Welcome to Java!"

BUT...................

A program like this
Code:
import javax.swing.*;

public class MyFrame
{
	public static void main(String[] args)
	{
		JFrame frame = new JFrame("Test Frame");
		frame.setSize(400,300);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}
This one compiles just fine too but when I run it using java (I use java /home/dsl/MyFrame), I have this error "Exception in thread "main" java.lang.NoClassDefFoundError: MyFrame

Thanks if you can help here.
 
Old 02-02-2005, 10:07 AM   #2
General_Redneck
LQ Newbie
 
Registered: Feb 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Stupid me... I installed as root... so I have to run as root... :S ah well...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 03:04 AM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 12:57 PM
Updated Java... now java apps dont work zidane2010 Linux - Software 6 05-04-2004 08:02 PM
2 Questions: java calling system commands? PERL vs Java? randomx Programming 28 11-28-2003 08:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration