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
311 views
in Technique[技术] by (71.8m points)

java - How can I set my Cygwin PATH to find javac?

I have a Windows 7 system on which I have installed the latest Java compiler. I also have the latest Cygwin. I want to use the Java compiler from Cygwin's shell. I edited the PATH variable in Cygwin as follows:

export PATH=$PATH:"/cygdrive/C/Program Files/Java/jdk1.6.0_23/bin/"

I can see the javac binary in the above directory, however when I try to compile my *.java file I get:

javac command not found

Am I doing something wrong in setting the PATH variable like this? Do I have to do something else? I am new to Java and not very familiar with cygwin.

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

as you write the it with double-quotes, you don't need to escape spaces with

export PATH=$PATH:"/cygdrive/C/Program Files/Java/jdk1.6.0_23/bin/"

of course this also works:

export PATH=$PATH:/cygdrive/C/Program Files/Java/jdk1.6.0_23/bin/

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

...