Hello everybody,
Currently, I am using the �SCP for
Java 2 (Second Edition) � Syngress� book as a reference. In it�s first chapter (Language Fundamental - Exercise 1-2: Creating a Package and Inserting Classes � pg. 7), I tried the sample but has been unsuccessful. I am able to compiled the MyClass.java file but not running it. Below are the details:
>>> I have created 2 directories:
�C:\mypgms\Osborne� <== Stores the MyClass.java source file
�C:\mypackages\com\syngress� <== Stores the MyClass.class file
>>> MyClass.java source file is as follow:
package com.syngress;
public class MyClass {
public static void main (
String[] args) {
System.out.println ("This is demo on setting up JAVA PACKAGE");
}
}
>>> The WinXP OS�s Environment variable for Path is set as follow:
C:\mypgms\Osborne>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Co
mmon Files\Adaptec Shared\System;C:\PROGRA~1\IBM\CLIENT~1;C:\PROGRA~1\IBM\CLIENT
~1\Shared;C:\PROGRA~1\IBM\CLIENT~1\Emulator;C:\j2sdk1.4.0\bin\.;C:\mypackages\.;
>>> Successful compilation: MyClass.class is created in the �C:\mypackages\com\syngress� path
C:\mypgms\Osborne>javac MyClass.java -d c:\mypackages\
>>> HOWEVER, the following failed:
C:\mypgms\Osborne>java com.syngress.MyClass
Exception in
thread "main" java.lang.NoClassDefFoundError: com/syngress/MyClass
Does anyone know where can I get the errata for this book?
Thanks for the help�.:-)