如何设置我的 Cygwin PATH 以查找 javac? [英] How can I set my Cygwin PATH to find javac?
问题描述
我有一个安装了最新 Java 编译器的 Windows 7 系统.我也有最新的 Cygwin.我想使用 Cygwin 的 shell 中的 Java 编译器.我在 Cygwin 中编辑了 PATH 变量,如下所示:
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/"
我可以在上面的目录中看到 javac
二进制文件,但是当我尝试编译我的 *.java 文件时,我得到:
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
像这样设置 PATH 变量是不是我做错了什么?我还需要做些什么吗?我是 Java 新手,对 cygwin 不太熟悉.
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.
推荐答案
当你用双引号写它时,你不需要用
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/"
当然这也有效:
export PATH=$PATH:/cygdrive/C/Program Files/Java/jdk1.6.0_23/bin/
这篇关于如何设置我的 Cygwin PATH 以查找 javac?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!