classpath?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: classpath?

  1. #1
    Terry Guest

    classpath?


    Hey all...Hope everyone stayed dry and safe.

    Anyway, This classpath statement, Is that like a path statement in
    DOS or Windows? Path=c:\DOS\WINDOWS\ETC.

    If so how would you compile a program (newbie.java) if it wasn't
    in windows98 path? maybe make a call like javac c:\javatest\newbie.java ?

    Thanks
    Terry

  2. #2
    Kyle Gabhart Guest

    Re: classpath?


    "Terry" <javasuperclass@hotmail.com> wrote:
    >
    >Hey all...Hope everyone stayed dry and safe.
    >
    >Anyway, This classpath statement, Is that like a path statement in
    >DOS or Windows? Path=c:\DOS\WINDOWS\ETC.
    >
    >If so how would you compile a program (newbie.java) if it wasn't
    >in windows98 path? maybe make a call like javac c:\javatest\newbie.java

    ?
    >
    >Thanks
    > Terry


    Terry,

    Yes, the Classpath is very similar to the path statement in DOS. The classpath
    indicates where the java compiler (javac) and java interpreter (java) should
    look for class files that they require. Assuming that the bin directory
    of the JDK is in your PATH statement, then you can invoke the 'javac' command
    from anywhere within the DOS environment. To use your example, this means
    that from the root directory (c:/) you could compile the 'newbie.java' source
    file that is located in the 'javatest' folder with the following command:
    javac c:\javatest\newbie.java

    This is precisely what you anticipated. Good job and an excellent question.
    Let me know if you any further questions.

    Happy Coding!

    Cordially,

    Kyle Gabhart
    DevX Java Pro


  3. #3
    yi Guest

    Re: classpath?


    Hi,

    I always do like that:

    eg. newbie.java is in ur c:\java ,

    1) set classpath=%classpath%;c:\java;

    like that you just need to do once, then u can compile anytime.

    good luck.



    "Terry" <javasuperclass@hotmail.com> wrote:
    >
    >Hey all...Hope everyone stayed dry and safe.
    >
    >Anyway, This classpath statement, Is that like a path statement in
    >DOS or Windows? Path=c:\DOS\WINDOWS\ETC.
    >
    >If so how would you compile a program (newbie.java) if it wasn't
    >in windows98 path? maybe make a call like javac c:\javatest\newbie.java

    ?
    >
    >Thanks
    > Terry



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center