User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Unread 4 Oct 2006, 23:41   #1
Androme
☆ ♥ 
 
Androme's Avatar
 
Join Date: Jan 2003
Posts: 3,489
Androme can only hope to improve
Wierd Java Error

I've just installed Sun's Java JDK 1.5_08 and I've set PATH Cath to java\bin under Environment Variables.

Compiling a java program I've written works fine as the .class file appears. But when it comes to running it via e.g. "java hello" after I've compiled via "javac hello.java" it doesn't seem to run and instead, I get this error:

C:\ComSci\DCS100>javac hello.java
C:\ComSci\DCS100>java hello
Exception in thread "main" java.lang.NoClassDefFoundError: hello

Code:
	
/* ***************************************
   AUTHOR: Paul Curzon
	A program that prints a welcome message
	Notice how the program called hello is 
	made of 2 methods. One called main
	and one called helloMessage.
   ****************************************/

class hello
{
    public static void main (String[] param)
    {
        // We want to print out the message defined in method helloMessage
		
		helloMessage();
		System.exit(0);
		
    } // END main


/* ***************************************************
	   Define some commands of our own to use above
   *************************************************** */
	

	
	/* ***************************************
	*
	*	Define a method to print a welcome message
	*/
	
    public static void helloMessage ()
    {
 
        System.out.println("Hello Mark");
		
    } // END helloMessage
	
	
	
} // END class hello
__________________
R3: LegioN (came #32) || R4: BlueTuba
R5: WolfPack Order || R6: Wolfpack
R7: Fury
----------retired-------
R52-R55: Apprime
R56-R57: FaceLess
R58-60: Apprime/Ultores
Androme is offline   Reply With Quote
 



Forum Jump


All times are GMT +1. The time now is 11:43.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018