Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Do I have to keep setting the path file for javac?

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Do I have to keep setting the path file for javac?

    Do I have to keep setting the path file for javac in cmd when compiling more than 1 program?

    For instance, I have set path for javac and compiled "forexample.java" so it now has a class file so I can now run it "java forexample".

    When I try to compile a different program with javac it says javac cannot be recognized. And I have to set path file again.

    Is there a way that I don't have to keep setting the path file for each new program?


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: Do I have to keep setting the path file for javac?

    You will need to set the path each time you open a command prompt. Once you have set the path you can compile and run as many programs as you like with the same window open. Alternatively you can set the path permanently by updating your environment variables.
    Improving the world one idiot at a time!

Similar Threads

  1. how to get value path file from jsp form- input type file
    By meeGoreng in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: October 4th, 2011, 12:05 AM
  2. WHY AM I HAVING TO PUT THE ENTIRE FILE PATH?!?!
    By CameronHussey in forum What's Wrong With My Code?
    Replies: 1
    Last Post: August 7th, 2011, 05:32 AM
  3. [SOLVED] Send File (path) as argument to method
    By efluvio in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 31st, 2011, 01:13 PM
  4. locating the path to a jar file within a program
    By nemo in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 2nd, 2011, 05:41 PM
  5. Making computer independent file path
    By Javabeginner in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: September 2nd, 2010, 03:56 PM