How can I set the PATH variable for javac so I can manually compile my .java works?

前端 未结 9 2134
再見小時候
再見小時候 2020-12-01 23:44

Here\'s the address on my drive:

C:\\Program Files\\Java\\jdk1.6.0_18\\bin

How would I go about setting the path variable so I c

9条回答
  •  情歌与酒
    2020-12-02 00:06

    Typing the SET PATH command into the command shell every time you fire it up could get old for you pretty fast. Three alternatives:

    1. Run javac from a batch (.CMD) file. Then you can just put the SET PATH into that file before your javac execution. Or you could do without the SET PATH if you simply code the explicit path to javac.exe
    2. Set your enhanced, improved PATH in the "environment variables" configuration of your system.
    3. In the long run you'll want to automate your Java compiling with Ant. But that will require yet another extension to PATH first, which brings us back to (1) and (2).

提交回复
热议问题