Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
729 views
in Technique[技术] by (71.8m points)

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

Here's the address on my drive:

C:Program FilesJavajdk1.6.0_18in

How would I go about setting the path variable so I can go in command window (windowskey+r "cmd") and be able to type things like:

javac TestApp.java

I'm using Windows 7 Professional.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

That would be:

set "PATH=%PATH%;C:Program FilesJavajdk1.6.0_18in"

You can also append ;C:Program FilesJavajdk1.6.0_18in to the PATH in the user environment dialog. That would allow you to use javac and other java tools directly form any cmd shell without setting the path first. The user environment dialog used to be somewhere in the system properties in XP, I have no idea where it is in Windows 7.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...