Can I execute programs installed under the Window's directory?
E.g., javac.
A: There is no difference between executable programs
under cygwin and those "native" to Windows. For instance,
if you have installed the java compiler "javac" in the
standard location (say C:/"Program Files"/jdk1.4.1/bin) then
you can directly invoke it. Better still, just link to it:
> cd /usr/local/bin
> ln -s /cygdrive/c/"Program Files"/jdk1.4.1/bin/javac.exe .
> rehash
> javac myProg.java
If you need to access CLASSPATH, you can set this in the Control
Panel, under Systems. Alternatively, you can give it as
an argument to javac. E.g., you have a jar file in your cygwin
directory "/java/lib/pg73jdbc.jar", you can access it thus:
> javac -classpath C:/cygwin/java/lib/pg73jdbc.jar myProg.java
Note that the path here begins from C:, and assumes
your cygwin is found under C:/cygwin.
REMARK: other software that I like to link to are acrobat reader
(for viewing pdf files), miktex (for tex/latex processor),
gsview (for viewing postscript files),
gvim (editor).
其中rehash命令在Cygwin中会出错,可以采用hash -r 来代替
cygwin中使用javac
最新推荐文章于 2021-03-03 22:41:12 发布