public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: javac on cygwin
  2003-01-13  2:54 javac on cygwin Kevin Cheng
@ 2003-01-13  2:54 ` Randall R Schulz
  2003-01-13  3:01   ` Shankar Unni
  2003-01-13  3:30 ` Randall R Schulz
  1 sibling, 1 reply; 16+ messages in thread
From: Randall R Schulz @ 2003-01-13  2:54 UTC (permalink / raw)
  To: cygwin

Kevin,

Javac is not particularly special. It is a Windows-native program, and as 
such requires absolute file and directory names be provided in Windows 
format (forward slashes are OK, but drive letters are required and the 
Cygwin notion of root is completely unknown to such programs). PATH-like 
variables (specifically CLASSPATH) must be in Windows format (semicolon 
separators).

Both of these conversions is handled by the "cygpath" utility. Learn about it.

I strongly suggest that if your development environment, either 
individually or as a group, is or is at all likely to become cross-platform 
(betwen Windows and any kind of Unix), that you adopt a Unix-centered set 
of build scripts and then create cover scripts that encapsulate the 
operations that bridge the gap between the POSIX / Unix world of Cygwin and 
the underlying native Sun Java SDK tools. Do so in a way that allows those 
translations to be easily switched off, replaced or made null when not 
needed (when you're working on an actual Unix system).

I do lots of Java under Windows with Cygwin and have for quite a while. 
Feel free to come back with further questions.

Randall Schulz


At 03:52 2003-01-04, Kevin Cheng wrote:
>Ok, I've searched for articles on getting a java
>compiler working on cygwin. I got very vague info.
>
>Can someone please give me the newbie quick setup on
>setting up a java compiler to work on cygwin.
>
>I've got the java JDK 1.4.1 from java.sun.com. Now
>what do I do?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* javac on cygwin
@ 2003-01-13  2:54 Kevin Cheng
  2003-01-13  2:54 ` Randall R Schulz
  2003-01-13  3:30 ` Randall R Schulz
  0 siblings, 2 replies; 16+ messages in thread
From: Kevin Cheng @ 2003-01-13  2:54 UTC (permalink / raw)
  To: cygwin

Ok, I've searched for articles on getting a java
compiler working on cygwin. I got very vague info.

Can someone please give me the newbie quick setup on
setting up a java compiler to work on cygwin.

I've got the java JDK 1.4.1 from java.sun.com. Now
what do I do?

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13  3:01   ` Shankar Unni
@ 2003-01-13  3:01     ` Randall R Schulz
  2003-01-13  3:01       ` Christopher Faylor
  0 siblings, 1 reply; 16+ messages in thread
From: Randall R Schulz @ 2003-01-13  3:01 UTC (permalink / raw)
  To: cygwin

Shankar,

At 14:17 2003-01-04, Shankar Unni wrote:
>Randall R Schulz wrote:
>
>>Javac is not particularly special. It is a Windows-native program, and as 
>>such requires absolute file and directory names be provided in Windows 
>>format (forward slashes are OK, but drive letters are required and the 
>>Cygwin notion of root is completely unknown to such programs).
>
>Javac is a pure java program. The "windows executable" is only there as a 
>thin native wrapper that launches sun.tools.javac.Main.

That may be true, but it's irrelevant. Its external interface via its 
command line options follows the Windows conventions. That's all that 
matters. It is a Windows executable for all intents and purposes.


>The bigger problem is that Sun JRE is compiled to the native Win32 API, 
>not to cygwin, so *any* Java programs running in the Sun JRE will never 
>understand cygwin mount points.

Yes, of course. That's hardly surprising.


>In theory, someone could invest in the effort to port, say, the Linux port 
>of the Sun JRE to cygwin, but it would be a huge effort.
>
>Igor's idea (wrappers that run cygpath -m on the paths being passed to 
>Java) would be the best approach in this situation, especially for 
>well-known Java programs like "javac".

That's what I do. I have a generic one that converts anything that "looks 
like" a file name via cygpath. It's not fool-proof, but the criteria for 
converting names could be refined.

The alternative is a target-specific script that understands what all the 
arguments options and option arguments are and converts them as needed.

Randall Schulz 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13  2:54 ` Randall R Schulz
@ 2003-01-13  3:01   ` Shankar Unni
  2003-01-13  3:01     ` Randall R Schulz
  0 siblings, 1 reply; 16+ messages in thread
From: Shankar Unni @ 2003-01-13  3:01 UTC (permalink / raw)
  To: cygwin

Randall R Schulz wrote:

> Javac is not particularly special. It is a Windows-native program, and 
> as such requires absolute file and directory names be provided in 
> Windows format (forward slashes are OK, but drive letters are required 
> and the Cygwin notion of root is completely unknown to such programs). 

Javac is a pure java program. The "windows executable" is only there as 
a thin native wrapper that launches sun.tools.javac.Main.

The bigger problem is that Sun JRE is compiled to the native Win32 API, 
not to cygwin, so *any* Java programs running in the Sun JRE will never 
understand cygwin mount points.

In theory, someone could invest in the effort to port, say, the Linux 
port of the Sun JRE to cygwin, but it would be a huge effort.

Igor's idea (wrappers that run cygpath -m on the paths being passed to 
Java) would be the best approach in this situation, especially for 
well-known Java programs like "javac".




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13  3:01     ` Randall R Schulz
@ 2003-01-13  3:01       ` Christopher Faylor
  2003-01-13 20:32         ` Shankar Unni
  0 siblings, 1 reply; 16+ messages in thread
From: Christopher Faylor @ 2003-01-13  3:01 UTC (permalink / raw)
  To: cygwin

On Sat, Jan 04, 2003 at 04:20:36PM -0800, Randall R Schulz wrote:
>At 14:17 2003-01-04, Shankar Unni wrote:
>>Randall R Schulz wrote:
>>
>>>Javac is not particularly special. It is a Windows-native program, and as 
>>>such requires absolute file and directory names be provided in Windows 
>>>format (forward slashes are OK, but drive letters are required and the 
>>>Cygwin notion of root is completely unknown to such programs).
>>
>>Javac is a pure java program. The "windows executable" is only there as a 
>>thin native wrapper that launches sun.tools.javac.Main.
>
>That may be true, but it's irrelevant. Its external interface via its 
>command line options follows the Windows conventions. That's all that 
>matters. It is a Windows executable for all intents and purposes.
>
>
>>The bigger problem is that Sun JRE is compiled to the native Win32 API, 
>>not to cygwin, so *any* Java programs running in the Sun JRE will never 
>>understand cygwin mount points.
>
>Yes, of course. That's hardly surprising.
>
>
>>In theory, someone could invest in the effort to port, say, the Linux port 
>>of the Sun JRE to cygwin, but it would be a huge effort.
>>
>>Igor's idea (wrappers that run cygpath -m on the paths being passed to 
>>Java) would be the best approach in this situation, especially for 
>>well-known Java programs like "javac".
>
>That's what I do. I have a generic one that converts anything that "looks 
>like" a file name via cygpath. It's not fool-proof, but the criteria for 
>converting names could be refined.
>
>The alternative is a target-specific script that understands what all the 
>arguments options and option arguments are and converts them as needed.

I remember speculating at one point about creating wrappers to the win32
functions like CreateFile, MoveFile, etc.  which would understand cygwin
paths.  You could theoretically modify an .exe to load cygwin1.dll and
use the wrapper functions.  Or you could use some of Windows hook
facilities to do that.

I don't think my idea met with much enthusiasm when I mentioned it, but
I always thought it would be an interesting exercise.  It wouldn't help
for programs which actually do parsing on input file specs outside of
the standard Windows API, though.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13  2:54 javac on cygwin Kevin Cheng
  2003-01-13  2:54 ` Randall R Schulz
@ 2003-01-13  3:30 ` Randall R Schulz
  1 sibling, 0 replies; 16+ messages in thread
From: Randall R Schulz @ 2003-01-13  3:30 UTC (permalink / raw)
  To: cygwin

Kevin,

Someone asked on <news:comp.lang.java.softwaretools> about makefiles for 
Java. Another person replied with a pointer to this site: 
<http://geosoft.no/javamake.html>, which appears to have a good makefile 
for Java. It should be usable as-is or easily be modified to work under Cygwin.

I haven't tried it, but I remembered your query and thought you might like 
to check it out.

Randall Schulz


At 03:52 2003-01-04, Kevin Cheng wrote:
>Ok, I've searched for articles on getting a java
>compiler working on cygwin. I got very vague info.
>
>Can someone please give me the newbie quick setup on
>setting up a java compiler to work on cygwin.
>
>I've got the java JDK 1.4.1 from java.sun.com. Now
>what do I do?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13  3:01       ` Christopher Faylor
@ 2003-01-13 20:32         ` Shankar Unni
  2003-01-13 21:13           ` Christopher Faylor
  0 siblings, 1 reply; 16+ messages in thread
From: Shankar Unni @ 2003-01-13 20:32 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:

> I remember speculating at one point about creating wrappers to the win32
> functions like CreateFile, MoveFile, etc.  which would understand cygwin
> paths.  You could theoretically modify an .exe to load cygwin1.dll and
> use the wrapper functions.  Or you could use some of Windows hook
> facilities to do that.

Hmm. Would that even work?

I remember trying, way back when, to provide a checking malloc library 
on Windows, and then discovering that there was *no* way of intercepting 
malloc() calls *inside LIBC itself*.  In the Windows PE world (unlike 
the ELF world), a call to a routine that lives inside the same DLL is 
automatically bound to the local copy without any way to hijack the call.

Thus there's no way to play games with LD_LIBRARY_PATH (or PATH, rather) 
to load a malloc that'll hijack all calls successfully. And there's 
definitely nothing like the LD_PRELOAD mechanism to wrap existing 
pre-linked programs to inject support libraries into the lib list.

So any CreateFile calls inside the windows libraries would always go to 
the built-in CreateFile.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13 20:32         ` Shankar Unni
@ 2003-01-13 21:13           ` Christopher Faylor
  2003-01-14 19:40             ` Shankar Unni
  2003-01-15 13:12             ` Chris January
  0 siblings, 2 replies; 16+ messages in thread
From: Christopher Faylor @ 2003-01-13 21:13 UTC (permalink / raw)
  To: cygwin

On Mon, Jan 13, 2003 at 11:26:28AM -0800, Shankar Unni wrote:
>Christopher Faylor wrote:
>>I remember speculating at one point about creating wrappers to the
>>win32 functions like CreateFile, MoveFile, etc.  which would understand
>>cygwin paths.  You could theoretically modify an .exe to load
>>cygwin1.dll and use the wrapper functions.  Or you could use some of
>>Windows hook facilities to do that.
>
>Hmm.  Would that even work?

Yes.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13 21:13           ` Christopher Faylor
@ 2003-01-14 19:40             ` Shankar Unni
  2003-01-15 13:12             ` Chris January
  1 sibling, 0 replies; 16+ messages in thread
From: Shankar Unni @ 2003-01-14 19:40 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:

>>Hmm.  Would that even work?

> Yes.

Hmm again. It'll be interesting to see this in action..
--
Shankar.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: javac on cygwin
  2003-01-13 21:13           ` Christopher Faylor
  2003-01-14 19:40             ` Shankar Unni
@ 2003-01-15 13:12             ` Chris January
  2003-01-15 22:04               ` Christopher Faylor
  1 sibling, 1 reply; 16+ messages in thread
From: Chris January @ 2003-01-15 13:12 UTC (permalink / raw)
  To: cygwin

> On Mon, Jan 13, 2003 at 11:26:28AM -0800, Shankar Unni wrote:
> >Christopher Faylor wrote:
> >>I remember speculating at one point about creating wrappers to the
> >>win32 functions like CreateFile, MoveFile, etc.  which would understand
> >>cygwin paths.  You could theoretically modify an .exe to load
> >>cygwin1.dll and use the wrapper functions.  Or you could use some of
> >>Windows hook facilities to do that.
> >
> >Hmm.  Would that even work?

This is a project I might work on when I have the time.

Chris


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-15 13:12             ` Chris January
@ 2003-01-15 22:04               ` Christopher Faylor
  0 siblings, 0 replies; 16+ messages in thread
From: Christopher Faylor @ 2003-01-15 22:04 UTC (permalink / raw)
  To: cygwin

On Wed, Jan 15, 2003 at 09:07:42AM -0000, Chris January wrote:
>> On Mon, Jan 13, 2003 at 11:26:28AM -0800, Shankar Unni wrote:
>> >Christopher Faylor wrote:
>> >>I remember speculating at one point about creating wrappers to the
>> >>win32 functions like CreateFile, MoveFile, etc.  which would understand
>> >>cygwin paths.  You could theoretically modify an .exe to load
>> >>cygwin1.dll and use the wrapper functions.  Or you could use some of
>> >>Windows hook facilities to do that.
>> >
>> >Hmm.  Would that even work?
>
>This is a project I might work on when I have the time.

Cool!  Thanks, Chris!  I can't think of anyone better to work on this.

If you (Chris) want to send private email to discuss, feel free.  Or,
better yet, discussion on cygwin-developers would probably tap even more
experience.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: javac on cygwin
  2003-01-13  3:04     ` Igor Pechtchanski
@ 2003-01-13  3:04       ` David P. Caldwell
  0 siblings, 0 replies; 16+ messages in thread
From: David P. Caldwell @ 2003-01-13  3:04 UTC (permalink / raw)
  To: cygwin

Igor:

>Actually, the custom java.io.File wrapper is very useful in that it's
>orthogonal to the purpose of my scripts and takes care of one of the
>caveats (namely, the filenames passed to Java programs).

Actually, the way it works now, the programs I write have to be Cygwin-aware
(I don't have a java.io.File substitute -- I have an inonit.cygwin.File
class which can represent a Windows or UNIX-style path).

However, as you mention, it's at least occurred to me that the entire
java.io.File class could be re-implemented with Cygwin-aware functionality
and then could be used in preference to the java.io.File class by putting it
in front of rt.jar in the -bootclasspath (at least on JDK 1.2 and later).

One would probably also have to change FileInputStream and other classes --
I haven't looked into it extensively.

-- David.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: javac on cygwin
  2003-01-13  3:04   ` David P. Caldwell
@ 2003-01-13  3:04     ` Igor Pechtchanski
  2003-01-13  3:04       ` David P. Caldwell
  0 siblings, 1 reply; 16+ messages in thread
From: Igor Pechtchanski @ 2003-01-13  3:04 UTC (permalink / raw)
  To: David P. Caldwell; +Cc: cygwin

David,

Thanks for considering this.  The only real way to identify major (and
minor) issues, however, is testing, so, hopefully, people will use these
scripts.  Once they are deemed reasonably robust, it might even be worth
it to release a java wrapper package for Cygwin...

Actually, the custom java.io.File wrapper is very useful in that it's
orthogonal to the purpose of my scripts and takes care of one of the
caveats (namely, the filenames passed to Java programs).  It might be a
good idea to post that code along with the scripts (there must be some
tricks one can play with the CLASSPATH to transparently substitute the
real java.io.File with the wrapper, so the programs don't have to change).
	Igor

On Mon, 6 Jan 2003, David P. Caldwell wrote:

> Igor:
>
> I'm going through a big site reorganization right now (the code, not the
> material), but I do intend to get your scripts up on my site (probably in
> the FAQ).
>
> I glanced at them and didn't identify any major issues with them.  I don't
> have much of a need for them for a few reasons:
>
> (1)  I use a wrapper class for java.io.File in my own programs which
> recognizes Cygwin-style paths,
> (2)  I don't develop on UNIX, so don't have much need for portable build
> scripts,
> (3)  For most of my own projects, I use a stupid little build tool I wrote
> myself (which is similar to Ant), and for customer projects, I have used Ant
> itself.
>
> Thanks for the contribution, though ... getting those scripts out there will
> only help other people and/or make them better.
>
> -- David.
> -----Original Message-----
> From: Igor Pechtchanski [mailto:pechtcha@cs.nyu.edu]
> Sent: Saturday, January 04, 2003 4:55 PM
> To: David P. Caldwell; kevingpo@yahoo.com
> Cc: cygwin@cygwin.com
> Subject: Re: javac on cygwin
>
>
> On Sat, 4 Jan 2003, David P. Caldwell wrote:
>
> > Kevin:
> >
> > >Ok, I've searched for articles on getting a java
> > >compiler working on cygwin. I got very vague info.
> >
> > >I've got the java JDK 1.4.1 from java.sun.com. Now
> > >what do I do?
> >
> > Not sure what your background is, so I'm not sure how to answer.  Right
> now,
> > you could be someone who doesn't know Java, someone who doesn't know
> Cygwin,
> > someone who doesn't know UNIX ... so without sitting down and writing a
> > script that would satisfy all three audiences (a combined Java/Cygwin/UNIX
> > tutorial), I can't really answer your question.
> >
> > You might want to check out
> >
> > http://www.inonit.com/cygwin/
> >
> > Perhaps you can let us know specifically what you've tried and what
> happened
> > so that we can assess your situation more accurately.
> >
> > -- David.
>
> For what it's worth, I use the attached scripts as wrappers for java, jar,
> javadoc and javac (the javac one is not extensively tested as I use a
> Cygwin-compiled jikes for java compilation).  The only caveat is that
> filenames passed as parameters to Java programs and custom doclet options
> in javadoc are not converted.  You will need to change the *_EXEC values
> close to the beginning of the scripts to conform to your system (I have
> IBM JDK 1.3).
>
> Hope this helps.  David, feel free to post them on the web page if needed.
> I'd also appreciate any comments or bug reports.  Thanks.
>         Igor

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: javac on cygwin
  2003-01-13  3:01 ` Igor Pechtchanski
@ 2003-01-13  3:04   ` David P. Caldwell
  2003-01-13  3:04     ` Igor Pechtchanski
  0 siblings, 1 reply; 16+ messages in thread
From: David P. Caldwell @ 2003-01-13  3:04 UTC (permalink / raw)
  To: cygwin

Igor:

I'm going through a big site reorganization right now (the code, not the
material), but I do intend to get your scripts up on my site (probably in
the FAQ).

I glanced at them and didn't identify any major issues with them.  I don't
have much of a need for them for a few reasons:

(1)  I use a wrapper class for java.io.File in my own programs which
recognizes Cygwin-style paths,
(2)  I don't develop on UNIX, so don't have much need for portable build
scripts,
(3)  For most of my own projects, I use a stupid little build tool I wrote
myself (which is similar to Ant), and for customer projects, I have used Ant
itself.

Thanks for the contribution, though ... getting those scripts out there will
only help other people and/or make them better.

-- David.
-----Original Message-----
From: Igor Pechtchanski [mailto:pechtcha@cs.nyu.edu]
Sent: Saturday, January 04, 2003 4:55 PM
To: David P. Caldwell; kevingpo@yahoo.com
Cc: cygwin@cygwin.com
Subject: Re: javac on cygwin


On Sat, 4 Jan 2003, David P. Caldwell wrote:

> Kevin:
>
> >Ok, I've searched for articles on getting a java
> >compiler working on cygwin. I got very vague info.
>
> >I've got the java JDK 1.4.1 from java.sun.com. Now
> >what do I do?
>
> Not sure what your background is, so I'm not sure how to answer.  Right
now,
> you could be someone who doesn't know Java, someone who doesn't know
Cygwin,
> someone who doesn't know UNIX ... so without sitting down and writing a
> script that would satisfy all three audiences (a combined Java/Cygwin/UNIX
> tutorial), I can't really answer your question.
>
> You might want to check out
>
> http://www.inonit.com/cygwin/
>
> Perhaps you can let us know specifically what you've tried and what
happened
> so that we can assess your situation more accurately.
>
> -- David.

For what it's worth, I use the attached scripts as wrappers for java, jar,
javadoc and javac (the javac one is not extensively tested as I use a
Cygwin-compiled jikes for java compilation).  The only caveat is that
filenames passed as parameters to Java programs and custom doclet options
in javadoc are not converted.  You will need to change the *_EXEC values
close to the beginning of the scripts to conform to your system (I have
IBM JDK 1.3).

Hope this helps.  David, feel free to post them on the web page if needed.
I'd also appreciate any comments or bug reports.  Thanks.
	Igor
--
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
  2003-01-13  2:54 David P. Caldwell
@ 2003-01-13  3:01 ` Igor Pechtchanski
  2003-01-13  3:04   ` David P. Caldwell
  0 siblings, 1 reply; 16+ messages in thread
From: Igor Pechtchanski @ 2003-01-13  3:01 UTC (permalink / raw)
  To: David P. Caldwell, kevingpo; +Cc: cygwin

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1749 bytes --]

On Sat, 4 Jan 2003, David P. Caldwell wrote:

> Kevin:
>
> >Ok, I've searched for articles on getting a java
> >compiler working on cygwin. I got very vague info.
>
> >I've got the java JDK 1.4.1 from java.sun.com. Now
> >what do I do?
>
> Not sure what your background is, so I'm not sure how to answer.  Right now,
> you could be someone who doesn't know Java, someone who doesn't know Cygwin,
> someone who doesn't know UNIX ... so without sitting down and writing a
> script that would satisfy all three audiences (a combined Java/Cygwin/UNIX
> tutorial), I can't really answer your question.
>
> You might want to check out
>
> http://www.inonit.com/cygwin/
>
> Perhaps you can let us know specifically what you've tried and what happened
> so that we can assess your situation more accurately.
>
> -- David.

For what it's worth, I use the attached scripts as wrappers for java, jar,
javadoc and javac (the javac one is not extensively tested as I use a
Cygwin-compiled jikes for java compilation).  The only caveat is that
filenames passed as parameters to Java programs and custom doclet options
in javadoc are not converted.  You will need to change the *_EXEC values
close to the beginning of the scripts to conform to your system (I have
IBM JDK 1.3).

Hope this helps.  David, feel free to post them on the web page if needed.
I'd also appreciate any comments or bug reports.  Thanks.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune

[-- Attachment #2: Type: TEXT/PLAIN, Size: 560 bytes --]

#!/bin/bash
#
# A wrapper for calling Java from Cygwin
# Author: Igor Pechtchanski <pechtcha@cs.nyu.edu>
#

ME="`basename $0`"
JAVA_EXEC="/cygdrive/c/Program Files/IBM/Java13/jre/bin/java.exe"
ARGS=""

while [ -n "$1" ]; do
   arg="$1"
   shift
   case "$arg" in
      -cp | -classpath)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;
      -Xbootclasspath*:*)
         arg="${arg%%:*}:`cygpath -p -w "${arg#*:}"`"
         ;;
   esac
   ARGS="$ARGS '$arg'"
done

eval "set -- $ARGS"

exec "$JAVA_EXEC" "$@"


[-- Attachment #3: Type: TEXT/PLAIN, Size: 807 bytes --]

#!/bin/bash
#
# A wrapper for calling Jar from Cygwin
# Author: Igor Pechtchanski <pechtcha@cs.nyu.edu>
#

ME="`basename $0`"
JAR_EXEC="/cygdrive/c/Program Files/IBM/Java13/bin/jar.exe"
ARGS=""
if [ -n "$1" ]; then
   firstarg="$1"; shift
   ARGS="$ARGS '$firstarg'"
   # Check for filename
   case "$firstarg" in
      *f*) arg="`cygpath -w "$1"`"
           shift
           ARGS="$ARGS '$arg'";;
   esac
   # Check for manifest
   case "$firstarg" in
      *m*) arg="`cygpath -w "$1"`"
           shift
           ARGS="$ARGS '$arg'";;
   esac
fi
# Change all filenames
while [ -n "$1" ]; do
   arg="$1"
   shift
   case "$arg" in
      -*) ;;
      *) arg="`cygpath -p -w "$1"`" ;;
   esac
   ARGS="$ARGS '$arg'"
done

eval "set -- $ARGS"

exec "$JAR_EXEC" "$@"


[-- Attachment #4: Type: TEXT/PLAIN, Size: 2235 bytes --]

#!/bin/bash
#
# A wrapper for calling Javadoc from Cygwin
# Author: Igor Pechtchanski <pechtcha@cs.nyu.edu>
#

ME="`basename $0`"
JAVADOC_EXEC="/cygdrive/c/Program Files/IBM/Java13/bin/javadoc.exe"
ARGS=""

while [ -n "$1" ]; do
   arg="$1"
   shift
   case "$arg" in
      # Generic options
      -overview)
         arg="$arg' '`cygpath -w "$1"`"
         shift
         ;;
      -public | \
      -protected | \
      -package | \
      -private | \
      -help | \
      -1.1 | \
      -verbose)
         ;;
      -doclet | \
      -locale | \
      -encoding)
         arg="$arg' '$1"
         shift
         ;;
      -docletpath | \
      -sourcepath | \
      -classpath | \
      -bootclasspath | \
      -extdirs)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;

      # Java flags option
      -Jcp | -Jclasspath)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;
      -JXbootclasspath*:*)
         arg="${arg%%:*}:`cygpath -p -w "${arg#*:}"`"
         ;;
      -J*)
         ;;

      # Doclet options
      -d | \
      -helpfile | \
      -stylesheetfile)
         arg="$arg' '`cygpath -w "$1"`"
         shift
         ;;
      -use | \
      -version | \
      -author | \
      -splitindex | \
      -nodeprecated | \
      -nodeprecatedlist | \
      -nosince | \
      -notree | \
      -noindex | \
      -nohelp | \
      -nonavbar | \
      -serialwarn)
         ;;
      -windowtitle | \
      -doctitle | \
      -title)
         arg="$arg' '$1"
         shift
         ;;
      -header | \
      -footer | \
      -bottom)
         # Quote single quotes
         arg="$arg' '`echo "$1" | sed "s/'/'"'"'"'"'"'"'/g"`"
         shift
         ;;
      -link)
         arg="$arg' '$1"
         shift
         ;;
      -link)
         arg="$arg' '$1' '$2"
         shift
         shift
         ;;
      -group)
         arg="$arg' '$1' '$2"
         shift
         shift
         ;;
      -charset | \
      -docencoding)
         arg="$arg' '$1"
         shift
         ;;
   esac
   ARGS="$ARGS '$arg'"
done

eval "set -- $ARGS"

exec "$JAVADOC_EXEC" "$@"


[-- Attachment #5: Type: TEXT/PLAIN, Size: 542 bytes --]

#!/bin/bash
#
# A wrapper for calling Javac from Cygwin
# Author: Igor Pechtchanski <pechtcha@cs.nyu.edu>
#

ME="`basename $0`"
JAVAC_EXEC="/cygdrive/c/Program Files/IBM/Java13/bin/javac.exe"
ARGS=""

while [ -n "$1" ]; do
   arg="$1"
   shift
   case "$arg" in
      -classpath | \
      -sourcepath | \
      -bootclasspath | \
      -extdirs | \
      -d)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;
   esac
   ARGS="$ARGS '$arg'"
done

eval "set -- $ARGS"

exec "$JAVAC_EXEC" "$@"


[-- Attachment #6: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: javac on cygwin
@ 2003-01-13  2:54 David P. Caldwell
  2003-01-13  3:01 ` Igor Pechtchanski
  0 siblings, 1 reply; 16+ messages in thread
From: David P. Caldwell @ 2003-01-13  2:54 UTC (permalink / raw)
  To: kevingpo, cygwin

Kevin:

>Ok, I've searched for articles on getting a java
>compiler working on cygwin. I got very vague info.

>I've got the java JDK 1.4.1 from java.sun.com. Now
>what do I do?

Not sure what your background is, so I'm not sure how to answer.  Right now,
you could be someone who doesn't know Java, someone who doesn't know Cygwin,
someone who doesn't know UNIX ... so without sitting down and writing a
script that would satisfy all three audiences (a combined Java/Cygwin/UNIX
tutorial), I can't really answer your question.

You might want to check out

http://www.inonit.com/cygwin/

Perhaps you can let us know specifically what you've tried and what happened
so that we can assess your situation more accurately.

-- David.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2003-01-15 20:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13  2:54 javac on cygwin Kevin Cheng
2003-01-13  2:54 ` Randall R Schulz
2003-01-13  3:01   ` Shankar Unni
2003-01-13  3:01     ` Randall R Schulz
2003-01-13  3:01       ` Christopher Faylor
2003-01-13 20:32         ` Shankar Unni
2003-01-13 21:13           ` Christopher Faylor
2003-01-14 19:40             ` Shankar Unni
2003-01-15 13:12             ` Chris January
2003-01-15 22:04               ` Christopher Faylor
2003-01-13  3:30 ` Randall R Schulz
2003-01-13  2:54 David P. Caldwell
2003-01-13  3:01 ` Igor Pechtchanski
2003-01-13  3:04   ` David P. Caldwell
2003-01-13  3:04     ` Igor Pechtchanski
2003-01-13  3:04       ` David P. Caldwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).