i am brand new to java and i get this error at the command line with this code below -
i compiled into class and then try to run
***********************************************
c:\>javac GetPropertyDemo.java
c:\>java GetPropertyDemo
Exception in thread "main" java.lang.NoClassDefFoundError: GetPropertyDemo
************************************************
could someone explain to me why this is?
Code:import java.lang.*; class GetPropertyDemo { public static void main(String args[]) throws SecurityException { System.out.println ("OS Name: " + System.getProperty("os.name")); System.out.println ("OS Architecture: " + System.getProperty("os.arch")); System.out.println ("OS Version: " + System.getProperty("os.version")); System.out.println ("User: " + System.getProperty("user.name")); System.out.println ("Home Dir: " + System.getProperty("user.home")); System.out.println ("Java Version: " + System.getProperty ("java.version")); System.out.println ("Java Home: " + System.getProperty ("java.home")); } }




Reply With Quote