CLASSPATH?  
Author Message
Jason Teagle





PostPosted: 2004-2-5 7:17:00 Top

java-programmer, CLASSPATH? WinXP Pro, JRE 1.4.2_03

I've just discovered that according to my Environment Variables section of
the System icon (Control Panel), I don't have a CLASSPATH variable. I used
SET from a command prompt to confirm that this is the case. No such
variable. So how come I can run basic (UI) Java programs OK? Shouldn't
CLASSPATH be pointing to the jar file containing these basic classes I'm
using? The problem is, JMF installation instructions seem to say I should
add the path to the jar file to CLASSPATH, but how can I if I have no such
variable? {:v)

Am I missing something?


--

 
Steve W. Jackson





PostPosted: 2004-2-6 1:54:00 Top

java-programmer >> CLASSPATH? In article <bvrui7$vrlja$email***@***.com>,
"Jason Teagle" <email***@***.com> wrote:

>:WinXP Pro, JRE 1.4.2_03
>:
>:I've just discovered that according to my Environment Variables section of
>:the System icon (Control Panel), I don't have a CLASSPATH variable. I used
>:SET from a command prompt to confirm that this is the case. No such
>:variable. So how come I can run basic (UI) Java programs OK? Shouldn't
>:CLASSPATH be pointing to the jar file containing these basic classes I'm
>:using? The problem is, JMF installation instructions seem to say I should
>:add the path to the jar file to CLASSPATH, but how can I if I have no such
>:variable? {:v)
>:
>:Am I missing something?

Sun recommends against a CLASSPATH variable. I concur. All the classes
that are part of your JRE are automatically known to the JVM at runtime
(they're in the bootclasspath). Any others (i.e., those you create or
use from elsewhere) should be in locations designated by your classpath
setting on the java command you issue to launch the program.

That's a slight oversimplification (ignoring things like appending or
prepending to the bootclasspath and the extensions mechanism), but
generally is the idea.

= Steve =
--
Steve W. Jackson
Montgomery, Alabama
 
Jon A. Cruz





PostPosted: 2004-2-8 5:25:00 Top

java-programmer >> CLASSPATH? Jason Teagle wrote:
> WinXP Pro, JRE 1.4.2_03
>
> I've just discovered that according to my Environment Variables section of
> the System icon (Control Panel), I don't have a CLASSPATH variable.

As of JDK 1.2 and higher, a CLASSPATH was no longer necessary.