LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-16-2007, 05:45 AM   #1
LinuxNewbie999
Member
 
Registered: Oct 2006
Distribution: FreeBSD
Posts: 162

Rep: Reputation: 30
Java helloworld program help*


What is wrong with this program?

class helo{
public static void main(String[] args){
System.out.println("Hello World");
}
}


I got this error.
Exception in thread "main" java.lang.NoClassDefFoundError: helo

Type "java helo" to compile right?
 
Old 09-16-2007, 06:16 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You use "javac helo.java" to compile and then "java helo" to run the program.
 
Old 09-16-2007, 07:32 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
By the way, it's a recommended practice to capitalize java class names and a good one to avoid spelling mistakes so you'd rather name your file Hello.java and the class itself Hello.
 
  


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
ubuntu newbie helloworld will not run sleepyjake Linux - Newbie 7 09-02-2007 04:11 PM
Compiling "HelloWorld.java" on Slackware 10.2 halfpower Programming 2 09-07-2006 09:54 AM
compiling HelloWorld with QT fakie_flip Programming 1 01-18-2006 01:12 PM
Stop java program(threaded program..should end cleanly) rmanocha Programming 4 11-09-2004 09:36 AM
Anyone have a HelloWorld Python Qt script? SheldonPlankton Programming 1 07-22-2004 02:52 PM

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

All times are GMT -5. The time now is 05:24 PM.

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