Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Unhappy Classpath variable

    Hi All,

    I am new to Java. I have installed JDK in my system and everytime I need to run a program I have to go to in the directory C:\program files\java\bin and then run it using the JAVA compiler (javac).

    I do not want to go to the directory everytime I want to compile a program.

    Is there any solution so that I can simply write on the command prompt and run my programs.


    Please tell.

    Thanks so much.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,305
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by shailenderanshuman View Post
    Hi All,

    I am new to Java. I have installed JDK in my system and everytime I need to run a program I have to go to in the directory C:\program files\java\bin and then run it using the JAVA compiler (javac).

    I do not want to go to the directory everytime I want to compile a program.

    Is there any solution so that I can simply write on the command prompt and run my programs.
    You have to add that directory (see above) to you 'path' variable (not your 'classpath' variable). The 'path' variable is consulted to check where to look for executable files.

    kind regards,

    Jos

  3. #3
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default

    Dear Jos,

    Thanks for quick reply. But can U please explain how to do it?

    Thanks.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,305
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by shailenderanshuman View Post
    Dear Jos,

    Thanks for quick reply. But can U please explain how to do it?

    Thanks.
    That's a MS Windows question; I guess you have to navigate to Cofiguration > System > Advanced Settings > Environment Variables; you can edit/add your path variable in that dialog box.

    kind regards,

    Jos

  5. #5
    siva_vs_siva is offline Member
    Join Date
    Aug 2010
    Posts
    31
    Rep Power
    0

    Default

    Answer for you..

    1. select my computer system properties(right click the my computer and choose pros).

    2. in that choose advanced tab-->choose Environment variables-->new-->give variable name and javac location.
    [IMG]e:/path.bmp[/IMG]

Similar Threads

  1. Replies: 11
    Last Post: 07-07-2010, 06:02 AM
  2. classpath variable is non modifiable
    By yairfr in forum Eclipse
    Replies: 0
    Last Post: 06-24-2009, 05:11 PM
  3. Classpath
    By dawiz001 in forum New To Java
    Replies: 3
    Last Post: 03-18-2009, 02:18 PM
  4. Set classPath?
    By rgbosque in forum New To Java
    Replies: 3
    Last Post: 02-07-2008, 02:14 PM
  5. GNU Classpath 0.96.1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-01-2007, 04:14 PM

Posting Permissions

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