So there is a package in /somedir/somewhere/stuff.jar
If I look in stuff.jar I see subdirs like this:
/com/mycompany/connection/*.class
My CLASSPATH has /somedir/somewhere in it, and my code has this import statement:
import com.mycompany.connection.*
But yet I get an error when I try to compile with "javac mycode.java"
package com.mycompany.connection does not exist
What on Earth is going on here? I'm using java 1.4.2. Thanks.
chris
Chris Smith - 15 Apr 2004 00:26 GMT
> So there is a package in /somedir/somewhere/stuff.jar
>
[quoted text clipped - 11 lines]
>
> What on Earth is going on here? I'm using java 1.4.2. Thanks.
Your classpath needs the whole JAR file, "/somedir/somewhere/stuff.jar".
Including "/somedir/somewhere" in your classpath tells the Java compiler
that the class might be in a file called
"/somedir/somewhere/com/mycompany/connection/ClassName.class"... which,
of course, it is not.

Signature
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Roedy Green - 16 Apr 2004 00:06 GMT
>My CLASSPATH has /somedir/somewhere in it, and my code has this import statement:
See http://mindprod.com/jgloss/classpath.html
Note especially what you must do to get it to look in jar files. You
DON'T just put jars somewhere on the classpath.
There are two techniques -- the ext directory -- easiest, and adding
individual jars to the classpath.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.