Web Design and Development Forums

Problem running Java

This is a discussion on "Problem running Java" within the Java, JSP, Cold Fusion section. This forum, and the thread "Problem running Java are both part of the Program Your Website category.

Old Mar 23rd, 2007, 20:41   #1 (permalink)
New Member
 
Join Date: Mar 2007
Location: England
Age: 27
Posts: 7
Question Problem running Java

Hi there!

I am currently at university studying computing and at present learning how to program in Java. I am learning how to generate graphics using the 'Animax' console. I am using Textpad to edit, compile and run the code but its running the code that is proving to be impossible at the moment.
I have downloaded the latest JDK from the JAVA SUN website along with the Animax package. I have tried to compile a simple output program ("Hello World") which is syntacticly correct as it compile with no error message, but when i run the program the command line window consists of the message:

Exception in thread "main" java.lang.NoClassDefFoundError: Demo
Press any key to continue . . .

Insted of:

Hello World
Press any key to continue . . .

I would be very grateful if someone could help me to come up with a solution so i can proceed with my work.
Thanks, Stroodle

Last edited by stroodle01; Mar 23rd, 2007 at 20:44.
stroodle01 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Mar 24th, 2007, 16:08   #2 (permalink)
Moderator
 
spinal007's Avatar
 
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,609
Blog Entries: 1
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Problem running Java

here's what you need matey:
Code: Select all
/** 
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}
But I can tell the most common mistakes are:

- improper case:
public static void Main(String[] args) {
...instead of...
public static void main(String[] args) {

- missing line delimiters:
System.out.println("Hello World!")
...instead of...
System.out.println("Hello World!");
Maybe that's what you did wrong...
__________________
Diego - SEO Consultant London (My Blog | Fight Me)
jQuery: Star Rating - Multiple File Upload - FCKEditor/Codepress
Before we work on artificial intelligence why don't we do something about natural stupidity?
spinal007 is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Mar 24th, 2007, 19:27   #3 (permalink)
New Member
 
Join Date: Mar 2007
Location: England
Age: 27
Posts: 7
Re: Problem running Java

The code is as follows:


class Demo001
{
public static void main(String[] args)
{
System.out.println("Blimey!!");
System.out.println("It Works!!");
}
}


The code seems fine to me, perhaps you may be able to spot an error?? the class path may be the problem. I have named the class correctly. I have a feeling a program may be interfering with the JAVA program path, which may involve messign arong with the registry settings (which i have no idea about!). Although saying this it has no problem compiling, the compiler JAVAC is located in the same folder as the JAVA program, although the program will still not run wich to me seems very wierd!!
stroodle01 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
running java

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem running php from the command line edwarrj1 PHP Forum 2 Dec 5th, 2006 18:06
not sure if this is Flash or Java problem . . . mcvinnie Flash & Multimedia Forum 3 Aug 22nd, 2006 20:56
Problem with CSS/Java graphic placement MikeX CSS Forum 4 Aug 21st, 2006 19:26
Not sure if this is Flash or Java problem . . . mcvinnie JavaScript Forum 2 Jul 19th, 2006 10:51
Java problem!! gem gem JavaScript Forum 2 Jul 11th, 2005 08:44



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 16:26.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59