Hi Alex, thanks for your response.
Could you please clarify:
> Classpath should have directories with *.class files or jar files
> itself.
I am specifying the JAR file in my -classpath when invoking the
launcher
> jar file is included to classpath only if it is in special directory
> $JAVA_HOME/jre/lib/ext
>
> All jar files from this "magic" directory are included to the
> classpath. Otherwise they (jar files) should be mentioned literally.
I am specifying the JAR file _literally_ in my classpath (see
marked below)
$ java -classpath ~/src:~/src/commons-codec-1.3.jar Xpacket
^^^^^^^^^^^^^^^^^^^^^
Still it refuses to find it :-(
Am I missing something? Please let me know. Thanks in advance!
-Sam
> Alex.http://www.myjavaserver.com/~alexfromohio/
sam.n.seab...@gmail.com wrote:
>> The commons-codec-1.3.jar file _is_ in the directory specified in the
>> classpath.
> Classpath should have directories with *.class files or jar [sic] files
> itself.
Which is exactly what the OP did.
>> $ java -classpath ~/src:~/src/commons-codec-1.3.jar Xpacket
And you mention it, Alex, because ... ?
> jar file is included to classpath only if it is in special directory
> $JAVA_HOME/jre/lib/ext
That is completely false.
> All jar files from this "magic" directory are included to the
> classpath.
The extension directories, comprising $JAVA_HOME/jre/lib/ext/ by default, are
intended to expand one's Java platform itself. They are not really for
application libraries.
<http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html#extclass>
The OP did the correct thing by using the classpath option to the Java command.
> Otherwise they (jar files) should be mentioned literally.
Which is exactly what the OP did. However, it is not the only way to include
JAR files. One could use the wildcard notation:
java -cp $LIBRARY_ROOT/* etc.
It's bad practice to put .class and .jar files in one's source directory, BTW.
However, none of this addresses the OP's actual problem, which was not due to
the use of the classpath option as far as I can see from here.
It would help, OP, if you posted a complete example, say one which declares
'outbytes' [sic: should be camel case]. I can't see anything wrong with what
you've posted so far, although you definitely should put Xpacket in a named
package. That might even help. Also, change your import to a single-type
import, not import-on-demand. Post a complete example with those changes, and
run it to see if it helps. I happen to have the same version of the codec
JAR, so I'd try a complete example.

Signature
Lew
Alex.From.Ohio.Java@gmail.com - 24 Mar 2008 16:41 GMT
> sam.n.seab...@gmail.com wrote:
> >> The commons-codec-1.3.jar file _is_ in the directory specified in the
[quoted text clipped - 13 lines]
>
> That is completely false.
Wow, wow, wow. Just complete false. ;)
Just try it. What we can see is simple standalone Java application.
And I doubt that some special ClassLoader was used here.
It's also not Application server and not some kind of framework (let's
say JEE) which uses such things.
Based on only information from this post There are only 2 options.
1) jar file is corrupted (which is not very possible)
2) ~ points to the directory where jar file doesn't exist.
Mentioning more complicated things only confuses people.
Alex.
Arne Vajhøj - 25 Mar 2008 02:02 GMT
> However, it is not the only way to
> include JAR files. One could use the wildcard notation:
>
> java -cp $LIBRARY_ROOT/* etc.
If Java 1.6 (or newer when the show up).
Arne