learning java network from Sun's Java tutorial

Dear all,

I am learning networking, and I copy and paste the code from java tutorial website to netbean and try to run it. However, there is error coming out. Could anyone please tell me what is the error? thanks

init:

deps-jar:

compile-single:

run-single:

java.lang.NoClassDefFoundError: javanetwork/EchoClient (wrong name: JavaNetwork/EchoClient)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$000(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

Exception in thread "main"

Java Result: 1

BUILD SUCCESSFUL (total time: 0 seconds)

copy from

http://java.sun.com/docs/books/tutorial/networking/sockets/readingWriting.html

import java.io.*;

import java.net.*;

publicclass EchoClient{

publicstaticvoid main(String[] args)throws IOException{

Socket echoSocket =null;

PrintWriter out =null;

BufferedReader in =null;

try{

echoSocket =new Socket("taranis", 7);

out =new PrintWriter(echoSocket.getOutputStream(),true);

in =new BufferedReader(new InputStreamReader(

echoSocket.getInputStream()));

}catch (UnknownHostException e){

System.err.println("Don't know about host: taranis.");

System.exit(1);

}catch (IOException e){

System.err.println("Couldn't get I/O for "

+"the connection to: taranis.");

System.exit(1);

}

BufferedReader stdIn =new BufferedReader(

new InputStreamReader(System.in));

String userInput;

while ((userInput = stdIn.readLine()) !=null){

out.println(userInput);

System.out.println("echo: " + in.readLine());

}

out.close();

in.close();

stdIn.close();

echoSocket.close();

}

}

[3692 byte] By [marco_wua] at [2007-11-27 9:33:28]
# 1
Did you actually read the error message? The package name you specified doesn't match reality. Java is case-sensitive.In fact, given that code, there shouldn't be a package at all.
CeciNEstPasUnProgrammeura at 2007-7-12 22:55:07 > top of Java-index,Java Essentials,Java Programming...