Results 1 to 6 of 6

Thread: Classpath

  1. #1
    Preethi is offline Member
    Join Date
    Jan 2008
    Posts
    83
    Rep Power
    0

    Default Classpath

    i want to set classpath to execute my java file.
    My java program was in "C:\Documents and settings\xmlfile"

    Java was in "c:\Program Files\java\jdk1.5.0_08\bin"

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Go to System Properties.

    @ the Advance tab,
    click for Environmental Variables,

    Look for "Path" or "path" variable under System Variables...
    Click edit

    add
    ;C:\Program Files\java\jdk1.5.0_08\bin
    after the last values

    Test it....
    Last edited by sukatoa; 05-26-2008 at 05:53 PM.
    freedom exists in the world of ideas

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by sukatoa View Post
    after the last semicolon...
    If there is no any semicolon at the end, better to add it first. Otherwise your previous settings on other applications can be clashed.

    After that just open the command prompt and type javac. You'll get options you have with javac, if you do it correctly. This is the easiest way to do it.

  4. #4
    farooqza is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default alternative

    another way to do it if u don't have admin rights is to,
    open ur dos prompt and type
    @path=%path%;C:\Program Files\java\jdk1.5.0_08\bin;
    this will be saved only for that perticler session though..

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by farooqza View Post
    another way to do it if u don't have admin rights is to,
    open ur dos prompt and type
    @path=%path%;C:\Program Files\java\jdk1.5.0_08\bin;
    this will be saved only for that perticler session though..
    There is much simpler way too. Wheather you have admin rights or not,

    Java Code:
    path=C:\Program Files\java\jdk1.6.0_05\bin\

  6. #6
    farooqza is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default yeah

    %path% will allow u to keep existing entries of path variable....

Similar Threads

  1. Set classPath?
    By rgbosque in forum New To Java
    Replies: 3
    Last Post: 02-07-2008, 02:14 PM
  2. GNU Classpath 0.96.1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-01-2007, 04:14 PM
  3. GNU Classpath 0.96
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-16-2007, 06:35 PM
  4. Doubt with classpath
    By fred in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 01:58 AM

Posting Permissions

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