Reputation: 51
I just installed cygwin
and I am wondering how do I compile and run my java code through cygwin
?
My java code is at my desktop saved in a file named Java.
Upvotes: 3
Views: 18338
Reputation: 3515
Assuming you have Java SDK for Windows installed.
In the simplest case:
Ensure/Add java to PATH in cygwin:
export PATH=$PATH:"/cygdrive/C/Program\ Files/Java/jdk1.8.0_31/bin/"
(don't forget the backslash after Program)
cd
to your desktop:
cd /path/to/Desktop
run java compiler:
javac HelloWorld.java
In complex projects you will need to provide a bunch or arguments to javac
to make it compile.
Upvotes: 5