On 0, Carl Fink <[EMAIL PROTECTED]> wrote: > I started to learn Java back when I was running Slink. I didn't get past > chapter 3 of the book, but everything worked. > > Why not now? > > I install Jikes. I start Sun's tutorial and enter HelloWorldApp.java per > the web site. I compile it with javac. Seems OK. Then I try > > java HelloWorldApp.class
# java HelloWorldApp You are telling java to execute the named class, not the named file. You must also have the directory containing HelloWorldApp in $CLASSPATH (this can be . if you run java from the directory containing that class). > And get > > Exception in thread "main" java.lang.NoClassDefFoundError: > HelloWorldApp/class This is saying that it can't find a class called HelloWorldApp/class, which makes sense because your class is called HelloWorldApp. What it is looking for here is a directory called HelloWorldApp containing a file called class.class. Java package and class structures are different to filesystem directory and file structures, although the one is overlaid on the other. > Whoops. Quick search via Google Groups indicates that the class file needed > is by default installed where it can't actually be used. (??) So I > uninstall Jikes and install Sun's JDK. Huh? Don't know what Google's smoking here. Note that jikes and the JDK are NOT equivalent. Jikes only provides a compiler (and a much faster one than Sun's - I recommend it). You still need a virtual machine. Kaffe is not a useful virtual machine, you need to get either Sun's (1.3.1_04 works well for me) or the one from Blackdown or IBM. Note also that when you install Sun's JDK you don't get 'java' on your $PATH, unless you do some symlink fiddling or unpackage it in /usr, which is NOT recommended. > And get the same error. > > What's up? What can I do to fix this? And how did this get into Stable not > working at all without manual fixes? It works fine, but class names do not end in '.class'. Tom -- Tom Cook Information Technology Services, The University of Adelaide Classifications of inanimate objects: Those that don't work, those that break down, and those that get lost. Get my GPG public key: https://pinky.its.adelaide.edu.au/~tkcook/tom.cook-at-adelaide.edu.au
msg04507/pgp00000.pgp
Description: PGP signature