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?
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.