This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Java

Brian D. McGrew wrote:

None, I was asking if a standard Sun JDK could be installed on cygwin
and if so, which one?

Of course it can. But... (you knew there was a but..)

Sun's JDK is a native windows application, which means Java programs that it runs won't know how to deal with /cygdrive/c, or any of the other cygwin mounts like /usr or /.

So if you have shell (bash) scripts that invoke Java programs, and pass absolute paths (Cygwin paths) to them as arguments, you have to be careful to invoke "cygpath -m" to convert them to "real" Windows paths before passing them to the JDK.

A classic example of this style can be seen in Apache Ant's "bin/ant" bash invocation script, which is "Cygwin-aware".

On the other hand, you can invoke Cygwin tools from within Java (using Runtime.exec()) with very few problems, because Cygwin does understand Windows-style paths (though CGF will grumble about them).

PS. Our company's entire product base is written in Java, and we use Cygwin tools in our build and test environment to drive all of our Java programs.

The only issues we've ever faced are occasional "line-ending" screwups, especially when manipulating files under CVS control.. (check out from CVS, use Wordpad (grr!) to edit, check back in - oops, bogus ^Ms checked in to the repository!)

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]