Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help me please with JDK!

0 views
Skip to first unread message

ramin farhanian

unread,
Jan 17, 2002, 1:19:54 PM1/17/02
to
dear friends
first I downloaded the last version of JDK from java.sun.com but It
didn't work out on my windows 2000 ,so I used that version that was
included in Core Java Book but I still have wierd problems.Help me
please....Thank you
This is what happens:
I install JDK,
C:\jdk\bin>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

I set the path :
C:\jdk\bin ; %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

I can compile it easily and the compiler generates a class file but I
can not
run it,while I run it ,I get this message:

Exception in thread "main" java.lang.NoClassDefFoundError: c:\Welcome

Please don't tell me that you have a syntax Error.I just run Samples
of Core Java book .

In the book ,It's recommended that I run this command
jar xvf src.jar
while I do that normally,I get this message :

C:\jdk\bin>jar xvf src.jar
java.io.FileNotFoundException: src.jar (The system cannot find the
file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:64)
at sun.tools.jar.Main.run(Main.java:186)
at sun.tools.jar.Main.main(Main.java:904)

and this is the source code that I compile (Of course there's no bug):
/**
@version 1.11 2000-04-22
@author Cay Horstmann
*/

public class Welcome
{
public static void main(String[] args)
{
String[] greeting = new String[3];
greeting[0] = "Welcome to Core Java";
greeting[1] = "by Cay Horstmann";
greeting[2] = "and Gary Cornell";

for (int i = 0; i < greeting.length; i++)
System.out.println(greeting[i]);
}
}

In Core Java It's recommended that I unzip the doc file using jar
command in the end.
As there's to be some HTML document inside the doc folder,Is it quite
necessary in JDK installation?
========================================================================

Please tell me what to do...Thank you very much indeed!
Regards

Ramin Farhanian

Jon Skeet

unread,
Jan 18, 2002, 3:35:42 AM1/18/02
to
ramin farhanian <ramin_f...@hotmail.com> wrote:
> dear friends
> first I downloaded the last version of JDK from java.sun.com but It
> didn't work out on my windows 2000 ,so I used that version that was
> included in Core Java Book but I still have wierd problems.Help me
> please....Thank you
> This is what happens:

<snip>

Please see the various responses in comp.lang.java.help, then read
http://www.pobox.com/~skeet/java/newsgroups.html

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Tiom

unread,
Jan 18, 2002, 6:13:19 AM1/18/02
to
ramin_f...@hotmail.com (ramin farhanian) wrote in message news:<d2db27d3.02011...@posting.google.com>...

> dear friends
> first I downloaded the last version of JDK from java.sun.com but It
> didn't work out on my windows 2000 ,so I used that version that was
> included in Core Java Book but I still have wierd problems.Help me
> please....Thank you
> This is what happens:
> I install JDK,
> C:\jdk\bin>java -version
> java version "1.3.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
> Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
>
> I set the path :
> C:\jdk\bin ; %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
>
> I can compile it easily and the compiler generates a class file but I
> can not
> run it,while I run it ,I get this message:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: c:\Welcome
>
> Please don't tell me that you have a syntax Error.I just run Samples
> of Core Java book .
Yes you have.
Try this at c:\
C:\jdk\bin\java Welcome

This should work


>
> In the book ,It's recommended that I run this command
> jar xvf src.jar
> while I do that normally,I get this message :

Why ?

Look at:
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html

0 new messages