I am trying to compile some files using cygwin shell.
java file that I am trying to compile is C:\Users\Programs\x.java
For windows command prompt
C:\Users\Programs>javac x.java
No errors.
For Cygwin shell
$ javac /cygdrive/c/Users/Programs/x.java
Error:
javac: file not found: \cygdrive\c\Users\Programs\x.java
Why do I get an error in cygwin shell though it runs in windows command prompt
javacis Windows application. It has no clue about/cygdrive. Always keep it in mind and pass valid Windows paths.So use
javac 'c:/Users/Programs/x.java'orjavac c\:/Users/Programs/x.javaAlso, as in most Unix shells \ must be escaped if you need to use it.