Setting variable classpath

I am using jdk.1.5.0.

My bin directory is located at C:\Program Files\Java\jdk1.5.0\bin. I can run programs which dont use java's predefined classes or packages.

But programs which has got java's packages dont run. I think I need to set classpath variable. Can somebody help me setting the classpath variable?

Under jdk1.5.0 I have got the following folders.

bin, lib, demo, include, jre, sample.

Under jdk1.5.0 I have got the following files.

LICENSE, COPYRIGHT.

Under jdk1.5.0 I have got the following rtf document

LICENSE.rtf

Under jdk1.5.0 I have got the following html document.

README.html

Under jdk1.5.0 I have got the following zip folder

src.zip

[735 byte] By [Mausamia] at [2007-11-27 2:40:04]
# 1

set your classpath to jre\lib\rt.jar or jre\lib, or both, or something similar. You can set it in your environmental vars, but it's considered better to set it for each app/package ... for instance, create a .bat file, the contents of which might resemble:

javac -classpath .;c:\whateverjavaversion\jre\lib\rt;c:\whateverjavaversion\jre\lib\rt.jar MyClassToRun.java

Check this out [url http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html]Setting the classpath[/url]

HTH

abillconsla at 2007-7-12 3:02:39 > top of Java-index,Java Essentials,New To Java...
# 2

> I can run programs which

> dont use java's predefined classes or packages.

No you can't. Not with the Sun VM. If it doesn't have things like java.lang.String then it will not even get to the point where it attempts to load your class.

> But programs which has got java's packages dont run.

> I think I need to set classpath variable. Can

> somebody help me setting the classpath variable?

>

For the Sun VM for every version above 3 you never set the class path for the Java API.

Not sure what you think is happening but as a guess.

- You aren't running the Sun VM, it is a VM but just not the Sun one (and note the Sun Java API is not going to run with another VM.)

- The way you are importing classes is wrong.

jschella at 2007-7-12 3:02:40 > top of Java-index,Java Essentials,New To Java...