TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG-DEVEL:110] classpaths





Erick Stohr wrote:

> [java, bash shell]
>
> Am I doing class paths right?

No

>
>  First., I have some set in .bashrc in my home directory, this file
> looks like this:
>
> *snip*
>
> #class paths
>
> export JAVA_HOME=":/usr/jdk1.2.2/bin:"
>

JAVA_HOME=/usr/jdk1.2.2/bin
export JAVA_HOME

>
> export
> CLASSPATH=":/usr/jdk1.2.2/lib/mysql_comp.jar:/usr/jdk1.2.2/lib/gnu-regexp.jar:/usr/jpda.jar:/usr/jdk1.2.2/lib/jaxp.jar:/usr/lib/netscape/java/classes/java40.jar:/usr/jdk1.2.2/lib/dt.jar:
>
> /usr/jdk1.2.2/lib/tools.jar:/usr/jdk1.2.2/lib/servlet.jar:/usr/jdk1.2.2/lib/DB.jar:/usr/jdk1.2.2/lib/Pagelab.jar:"

CLASSPATH=/usr/jdk1.2.2/lib/mysql_comp.jar:/usr/jdk1.2.2/lib/gnu-regexp.jar:/usr/jpda.jar:/usr/jdk1.2.2/lib/jaxp.jar:/usr/lib/netscape/java/classes/java40.jar:/usr/jdk1.2.2/lib/dt.jar:

/usr/jdk1.2.2/lib/tools.jar:/usr/jdk1.2.2/lib/servlet.jar:/usr/jdk1.2.2/lib/DB.jar:/usr/jdk1.2.2/lib/Pagelab.jar

export CLASSPATH

In addition, you do not the tools.jar file or the dt.jar file

>
> *snip*
>
> the JVM cannot seem to find classes in a program I am writing from teh
> DB.jar and Pagelab.jar files.

Try the above

>
>
> So... I have tried using the -classpath <path> option when I compile and
> it seems to make no difference.  I have no idea what is wrong. Is there
> another main file for the system I need to set my paths instead? Is
> there
> something wrong with the currenty way (probably). Any help would be
> appreciated, little simple things are tough for me for some reason.

If you are putting in leading quotes, then -classpath will not work either

>
>
> I have read the Java docs on Sun's site numerous times and still can't
> seem to get it right. I am using a bash shell.
> I did read teh email today earlier about not needing the ":"'s, how do i
> seperate the paths then?

You do use ':' but only to seperate entries after the first one like this:

javac -classpath foo1.jar:foo2.jar com/something/Foo.java

>
>
> Thanks,
>
> Erick
>
> --
>
> Erick Stohr - PageLab Network, Inc.
> mailto:erick@pagelab.net  http://pagelab.net
>
> Your search-to-sale global e-commerce solution!
>
> Toll free 1-800-447-0607
> Voice 612-362-9224
> Fax 612-362-9227
> 43 Main Street SE, Suite 228
> Minneapolis, Minnesota 55414

--

Perry Hoekstra - dutchman@mn.uswest.net
-------------------------------------------------
All that is Microsoft does not glitter,
Not all those who wander are lost;
The old AT&T Unix that is strong does not wither,
Deep roots are not reached by frost.

From the ashes of Spec1170 a fire shall be woken,
A light from the shadows shall spring;
Renewed shall be the Unix OS that was broken,
Linux shall be king.