
Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
[..]
> This has nothing to do with the code you are trying to run. AFAIK,
> argument files such as @run are not supported by java, only javac.
You're correct, "java" doesn't support arg files :(
However, I still get the same error. (?)
I've tried some variations. Test16.java doesn't belong to any packages
at this moment, it's just an exact copy/paste from the JTidy site. I'm
thinking it might need to be in package atreides.jtidy, though. On the
other hand, at least it compiled :)
C:\>java C:\java\classes\atreides\jtidy\Test16.class
Exception in thread "main" java.lang.NoClassDefFoundError:
C:\java\classes\atreides\jtidy\Test16/class
C:\>java C:\java\sources\atreides\jtidy\Test16.java
http://thufir.lecktronix.net/xhtml/ C:\fooOut.txt
Exception in thread "main" java.lang.NoClassDefFoundError:
C:\java\sources\atreides\jtidy\Test16/java
C:\>java C:\java\sources\atreides.jtidy.Test16.java
http://thufir.lecktronix.net/xhtml/ C:\fooOut.txt
Exception in thread "main" java.lang.NoClassDefFoundError:
C:\java\sources\atreides/jtidy/Test16/java
thanks,
Thufir Hawat
Ian Shef - 17 Jan 2005 19:28 GMT
"thufir" <thufir.hawat@mail.com> wrote in news:1105981301.532569.156070
@f14g2000cwb.googlegroups.com:
> [..]
>> This has nothing to do with the code you are trying to run. AFAIK,
[quoted text clipped - 25 lines]
>
> Thufir Hawat
The program "java" does not want an extension on the class file name.
Try this:
C:\>java C:\java\classes\atreides\jtidy\Test16
Notice that the error message you got before from:
C:\>java C:\java\classes\atreides\jtidy\Test16.class
was:
Exception in thread "main" java.lang.NoClassDefFoundError:
C:\java\classes\atreides\jtidy\Test16/class
which ended with "Test16/class". This is because to "java", the refence to
"Test16.class" means find the package Test16 and use the class file called
class (actually class.class).

Signature
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *
Gordon Beaton - 17 Jan 2005 19:35 GMT
> You're correct, "java" doesn't support arg files :(
> However, I still get the same error. (?)
Please read the relevant documentation, a tutorial or some
introduction to java. Did you actually read the documentation for
"java" as I suggested in my previous reply?
If you had, maybe you'd have seen that it takes a *classname*, not a
filename. If you need to specify a path so the JVM can find the
classfile, do so using the classpath argument.
If Test16 doesn't belong to any package, you can run it like this:
java -classpath c:\java\classes\atreides\jtidy Test16
(followed by any arguments)
/gordon

Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
thufir - 18 Jan 2005 00:17 GMT
[..]
> Please read the relevant documentation, a tutorial or some
> introduction to java. Did you actually read the documentation for
> "java" as I suggested in my previous reply?
[..]
I read it, including the .class was an error on my part :(
I think I've read everything regarding packages and environmental
variable on sun's website. I'll be reading it again, and googling
(sp).
Until I get some insight into this here are my most recent errors, if
anyone would care take a look:
C:\>java -classpath C:\java\classes\atreides\jtidy\ Test16
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Test16.main(Test16.java:56)
C:\>java C:\java\classes\atreides\jtidy\ Test16
Exception in thread "main" java.lang.NoClassDefFoundError:
C:\java\classes\atreides\jtidy\
C:\>java C:\java\classes\atreides\jtidy\Test16
Exception in thread "main" java.lang.NoClassDefFoundError:
C:\java\classes\atreides\jtidy\Test16
thanks,
Thufir Hawat
thufir - 18 Jan 2005 02:16 GMT
A bit of experimentation produced:
C:\>type comp
-d C:\java\classes\
-g
-sourcepath C:\java\sources\
-classpath .;C:\java\classes\;C:\java\classes\org\w3c\tidy\Tidy.jar
C:\java\sources\atreides\hello\HelloWorldSwing.java
C:\>javac @comp
C:\>java -classpath C:\java\classes\ atreides.hello.HelloWorldSwing
While I don't understand a bit of it, it does what I want :)
thanks for all the help,
Thufir Hawat
Jean Pierre Daviau - 19 Jan 2005 23:13 GMT
On winXP after I removed the line at the top of the file
package ..........
c:\jdk1.1.8\bin\javac -classpath
.;c:\ant\ant.jar;c:\jdk1.1.8\lib\Tidy.jar;c:\jdk1.1.8\lib\classes.zip
Test16.java
No problem
>A bit of experimentation produced:
>
[quoted text clipped - 14 lines]
>
> Thufir Hawat
thufir - 20 Jan 2005 04:18 GMT
> On winXP after I removed the line at the top of the file
> package ..........
>
> c:\jdk1.1.8\bin\javac -classpath
> .;c:\ant\ant.jar;c:\jdk1.1.8\lib\Tidy.jar;c:\jdk1.1.8\lib\classes.zip
> Test16.java
>
> No problem
Thanks :)
I believe I've got it now.
--
Thufir Hawat
Jean Pierre Daviau - 19 Jan 2005 23:19 GMT
Hi,
Test16 t1 = new Test16(args[0], args[1], args[2], true);
Test16 t2 = new Test16(args[3], args[4], args[5], false);
By the way ??? You dont specify a usage for the arguments.
JP
thufir - 20 Jan 2005 04:16 GMT
> Hi,
> Test16 t1 = new Test16(args[0], args[1], args[2], true);
[quoted text clipped - 3 lines]
>
> JP
I don't specify a usage for the arguments because it's not my code ;)
see
<http://sourceforge.net/docman/display_doc.php?docid=1298&group_id=13153>
Also, I think I got it working, I didn't include enough path info for
the "java" command. And, I edited the code a bit and have a newer
thread that makes more sense, but, I think it's moot :)
thanks,
Thufir Hawat