Search code examples
javacygwin

How do I run/execute .java code inside Cygwin?


Essentially, I'd like to replace Eclipse and just use Cygwin, if that's possible. I've made sure that the javac -version command points to the folder containing my JDK.

To get started I created a Main.java inside an existing project in Eclipse, that just contains a println statement. However, inside Cygwin, when I go to the src folder containing this file and type javac PrintlnFileName.java there's a bit of a wait time and then nothing. Ideally, running that command would return the println statement like the Console in Eclipse would.

Any tips? Thanks


Solution

  • First you need to compile it with javac. Then run the code with java. http://www.oracle.com/technetwork/java/compile-136656.html