Results 1 to 9 of 9

Thread: help setting classpath

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    help setting classpath

    I have to work with a bunch of .jar files. I don't want to have to always do the following:

    javac -cp "c:\jarFolder\aa.jar;c:\jarFolder\bb.jar;c:\jarFolder\cc.jar;c:\jarFolder\dd.jar;c:\jarFolder\ee.jar (and so on and so on)" myProg.java

    How do I compile myProg.java without having to type so many ? All my .jar files are located in "jarFolder" folder.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: help setting classpath

    insert "." at the end of your classpath, then whenever you call Javac from the any folder it will look for classes in that folder, if you want to use this folder from another path put ";C:\jarFolder;" at the end of the classpath.

    ClassPath:
    1- Go to System Properties from the Control Panel
    2- Advanced Tab
    3- Environment Variables
    4- System Variables, Double click the ClassPath, and if you don't have it, add new one
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Re: help setting classpath

    Sorry, but I don't quite understand what you mean. Where am I putting the "."? In the command line or in the System Properties(System variables)? This is what I did based on how I understood your explanation. I opened that Advanced Tab and created a CLASSPATH in the System variables. I named it CLASSPATH and the value I put a "." at the end of the classpath like so:

    "c:\jarFolder\."

    Then in the dos cmd line, i put:

    javac StockQuoteService.java

    but it didn't work.

  4. #4
    Addicted Member stefano5's Avatar
    Join Date
    Jul 2006
    Location
    London UK
    Posts
    131

    Re: help setting classpath

    Try c:\jarFolder\;.;

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Re: help setting classpath

    In the command line after "-cp" or in the Advanced Tab->System Variabled->CLASSPATH?

  6. #6
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: help setting classpath

    in the classpath
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Re: help setting classpath

    I tried putting it inthe Advanced Tab, CLASSPATH, and ran this command:

    javac MyNameService.java

    and I still get the "cannot find symbol" error.

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: help setting classpath

    Have you listed every JAR in the CLASSPATH variable? It doesn't do automatic resolution. (Java6 will.)

    I stand by my point from the other thread, though: use an IDE or an Ant build file.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Re: help setting classpath

    ok, i'll try that. Thanks for the responses.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width