unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* OT: Run Ant in MingW shell?
@ 2003-10-09  8:18 Kai Grossjohann
  2003-10-09 11:05 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Kai Grossjohann @ 2003-10-09  8:18 UTC (permalink / raw)


I searched Google and Gmane for a pertinent group but couldn't find
one, so I thought maybe I'll be lucky here ;-)
Please don't hesitate to point me to the right group.

I started a MingW shell under Emacs via the following setup and then
hitting M-x shell:

(setq explicit-sh.exe-args '("--noediting" "--login" "-i"))
(setq explicit-shell-file-name "sh.exe")

In that shell, I say "cd work/bla", then I say "ant -emacs compile",
and this is the response:

~/work/bla> ant -emacs compile
java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
Exception in thread "main" ~/work/bla> 

I look at $CLASSPATH and it's the same as under CMD.EXE.  But there,
Ant works.

Any idea how to get it working?

tia,
Kai

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

* Re: OT: Run Ant in MingW shell?
  2003-10-09  8:18 OT: Run Ant in MingW shell? Kai Grossjohann
@ 2003-10-09 11:05 ` Eli Zaretskii
       [not found] ` <mailman.1406.1065699895.21628.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2003-10-09 11:05 UTC (permalink / raw)


> From: Kai.Grossjohann@gmx.net (Kai Grossjohann)
> Newsgroups: gnu.emacs.help
> Date: 9 Oct 2003 01:18:45 -0700
> 
> I searched Google and Gmane for a pertinent group but couldn't find
> one

There's a MinGW mailing list (sorry, I don't know its exact name)
which I think is a better place.

> I started a MingW shell under Emacs via the following setup and then
> hitting M-x shell:
> 
> (setq explicit-sh.exe-args '("--noediting" "--login" "-i"))
> (setq explicit-shell-file-name "sh.exe")
> 
> In that shell, I say "cd work/bla", then I say "ant -emacs compile",
> and this is the response:
> 
> ~/work/bla> ant -emacs compile
> java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
> Exception in thread "main" ~/work/bla> 
> 
> I look at $CLASSPATH and it's the same as under CMD.EXE.  But there,
> Ant works.
> 
> Any idea how to get it working?

No idea, but here are a few questions that might provide some insight:

  . What happens if you start the MinGW shell outside Emacs with the
    same options shown above, and then run Ant?

  . What happens if you start CMD under Emacs and then run Ant?

  . What happens if you start the MinGW shell outside Emacs, but with
    stdin and stdout redirected to a file, and then run Ant (e.g.,
    have the Ant command on the file where you redirect the shell's
    stdin)?

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

* Re: OT: Run Ant in MingW shell?
       [not found] ` <mailman.1406.1065699895.21628.help-gnu-emacs@gnu.org>
@ 2003-10-14 22:24   ` Kai Grossjohann
  2003-10-15  5:49     ` Eli Zaretskii
  2003-10-17 15:50     ` Kai Grossjohann
  0 siblings, 2 replies; 12+ messages in thread
From: Kai Grossjohann @ 2003-10-14 22:24 UTC (permalink / raw)


Eli Zaretskii <eliz@elta.co.il> writes:

>> From: Kai.Grossjohann@gmx.net (Kai Grossjohann)
>> Newsgroups: gnu.emacs.help
>> Date: 9 Oct 2003 01:18:45 -0700
>> 
>> I searched Google and Gmane for a pertinent group but couldn't find
>> one
>
> There's a MinGW mailing list (sorry, I don't know its exact name)
> which I think is a better place.

Okay, I'll have a look.  (In fact, I found
gmane.comp.gnu.mingw.{user,msys} on gmane.  I'll ask there.)

>> I started a MingW shell under Emacs via the following setup and then
>> hitting M-x shell:
>> 
>> (setq explicit-sh.exe-args '("--noediting" "--login" "-i"))
>> (setq explicit-shell-file-name "sh.exe")
>> 
>> In that shell, I say "cd work/bla", then I say "ant -emacs compile",
>> and this is the response:
>> 
>> ~/work/bla> ant -emacs compile
>> java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
>> Exception in thread "main" ~/work/bla> 
>> 
>> I look at $CLASSPATH and it's the same as under CMD.EXE.  But there,
>> Ant works.

Correction: it seems that $CLASSPATH looks like c:/foo;c:/bar, note
the semicolon and the forward slashes.

>> Any idea how to get it working?
>
> No idea, but here are a few questions that might provide some insight:
>
>   . What happens if you start the MinGW shell outside Emacs with the
>     same options shown above, and then run Ant?

Same as above.

>   . What happens if you start CMD under Emacs and then run Ant?

Works fine.

>   . What happens if you start the MinGW shell outside Emacs, but with
>     stdin and stdout redirected to a file, and then run Ant (e.g.,
>     have the Ant command on the file where you redirect the shell's
>     stdin)?

No idea.

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

* Re: OT: Run Ant in MingW shell?
  2003-10-14 22:24   ` Kai Grossjohann
@ 2003-10-15  5:49     ` Eli Zaretskii
  2003-10-17 15:50     ` Kai Grossjohann
  1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2003-10-15  5:49 UTC (permalink / raw)


> From: Kai Grossjohann <kai.grossjohann@gmx.net>
> Newsgroups: gnu.emacs.help
> Date: Wed, 15 Oct 2003 00:24:34 +0200
> >> 
> >> I look at $CLASSPATH and it's the same as under CMD.EXE.  But there,
> >> Ant works.
> 
> Correction: it seems that $CLASSPATH looks like c:/foo;c:/bar, note
> the semicolon and the forward slashes.

That shouldn't be a problem: I'm guessing that $CLASSPATH is
interpreted by Ant, not by CMD, so it's not necessarily a problem.
Semi-colon is what is used on Windows since a colon is a valid part of
an absolute file name.

Does $CLASSPATH look different under the MinGW shell?

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

* Re: OT: Run Ant in MingW shell?
  2003-10-09  8:18 OT: Run Ant in MingW shell? Kai Grossjohann
  2003-10-09 11:05 ` Eli Zaretskii
       [not found] ` <mailman.1406.1065699895.21628.help-gnu-emacs@gnu.org>
@ 2003-10-15 11:07 ` Kai Grossjohann
  2003-10-16  6:38   ` Eli Zaretskii
       [not found]   ` <mailman.1779.1066286649.21628.help-gnu-emacs@gnu.org>
  2003-10-15 17:04 ` Paul Kinnucan
  3 siblings, 2 replies; 12+ messages in thread
From: Kai Grossjohann @ 2003-10-15 11:07 UTC (permalink / raw)


Kai.Grossjohann@gmx.net (Kai Grossjohann) wrote in message news:<e808b168.0310090018.4caa0f5c@posting.google.com>...

> In that shell, I say "cd work/bla", then I say "ant -emacs compile",
> and this is the response:
> 
> ~/work/bla> ant -emacs compile
> java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
> Exception in thread "main" ~/work/bla> 
> 
> I look at $CLASSPATH and it's the same as under CMD.EXE.  But there,
> Ant works.
> 
> Any idea how to get it working?

Silly me.  Typing "ant" will run the Bourne shell script.  I need to
say "ant.bat" to run the Windows thing.

Alas, typing "ant.bat -emacs compile" in the MinGW shell leads to the
shell trying to interpret ant.bat as a shell script.  That won't work,
of course.

~/work/evITA-Web> ant.bat -emacs compile
/c/Programme/Apache-Group/apache-ant-1.5.4/bin/ant.bat: @echo: command
not found
/c/Programme/Apache-Group/apache-ant-1.5.4/bin/ant.bat: line 3: syntax
error near unexpected token `(c'
/c/Programme/Apache-Group/apache-ant-1.5.4/bin/ant.bat: line 3: `REM  
Copyright (c) 2001-2003 The Apache Software Foundation.  All rights'
~/work/evITA-Web> 

Hm.  Googling for "bat mingw shell"...  Ah!  Found an article on
Cygwin with the same problem.  Typing

cmd //c /c/Programme/Apache-Group/apache-ant-1.5.4/bin/ant.bat -emacs
compile

really works!

Now it would be nice if it could be made automatic.  I'll ask the
MinGW folks, I guess.

Kai

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

* Re: OT: Run Ant in MingW shell?
  2003-10-09  8:18 OT: Run Ant in MingW shell? Kai Grossjohann
                   ` (2 preceding siblings ...)
  2003-10-15 11:07 ` Kai Grossjohann
@ 2003-10-15 17:04 ` Paul Kinnucan
  2003-10-15 19:27   ` Kai Grossjohann
  3 siblings, 1 reply; 12+ messages in thread
From: Paul Kinnucan @ 2003-10-15 17:04 UTC (permalink / raw)


Hi Kai,

I just wanted to make sure that you are aware that the
JDEE provides comprensive support for running Ant scripts
from Emacs. You have a choice of either launching a 
vm directly from Emacs to run the Ant script or to
run the Ant from the BeanShell. In either case, there
is no need to use an intermediate shell and hence deal
with environment variable inheritance issues.

Paul

Kai.Grossjohann@gmx.net (Kai Grossjohann) writes:

> I searched Google and Gmane for a pertinent group but couldn't find
> one, so I thought maybe I'll be lucky here ;-)
> Please don't hesitate to point me to the right group.
> 
> I started a MingW shell under Emacs via the following setup and then
> hitting M-x shell:
> 
> (setq explicit-sh.exe-args '("--noediting" "--login" "-i"))
> (setq explicit-shell-file-name "sh.exe")
> 
> In that shell, I say "cd work/bla", then I say "ant -emacs compile",
> and this is the response:
> 
> ~/work/bla> ant -emacs compile
> java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
> Exception in thread "main" ~/work/bla> 
> 
> I look at $CLASSPATH and it's the same as under CMD.EXE.  But there,
> Ant works.
> 
> Any idea how to get it working?
> 
> tia,
> Kai

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

* Re: OT: Run Ant in MingW shell?
  2003-10-15 17:04 ` Paul Kinnucan
@ 2003-10-15 19:27   ` Kai Grossjohann
  0 siblings, 0 replies; 12+ messages in thread
From: Kai Grossjohann @ 2003-10-15 19:27 UTC (permalink / raw)


Paul Kinnucan <paulk@mathworks.com> writes:

> I just wanted to make sure that you are aware that the JDEE provides
> comprensive support for running Ant scripts from Emacs.

Yes, I set the build function to use Ant, and told <f9> <f9> to do
like C-c C-v C-b.  That's what you mean?

Very nifty.  Use it often.

However: I'm doing servlet developing, so I have an Ant target for
running Tomcat.  It never stops, so that I can look at the output.
So in the morning, I open a shell window (eshell currently), then
invoke "ant -emacs tomcat" from there, and from then on I can see all
debugging output in an Emacs window, for easy searching etc.

I do use <f9> <f9> routinely for compiling my *.java files and for
removing and restarting the servlet (using the Ant tasks provided for
this).

Hm.  Now that I think of it, if there is an easy way to tell C-c C-v
C-b to run a different target, then I could use it to run the
"tomcat" target, then rename the resulting compilation buffer.  This
would give me the same thing, but in two compilation buffers.

Hm.  Hmmm...  Why not?  Let me try (tomorrow).

Kai

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

* Re: OT: Run Ant in MingW shell?
  2003-10-15 11:07 ` Kai Grossjohann
@ 2003-10-16  6:38   ` Eli Zaretskii
       [not found]   ` <mailman.1779.1066286649.21628.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2003-10-16  6:38 UTC (permalink / raw)


> From: Kai.Grossjohann@gmx.net (Kai Grossjohann)
> Newsgroups: gnu.emacs.help
> Date: 15 Oct 2003 04:07:37 -0700
> 
> Typing
> 
> cmd //c /c/Programme/Apache-Group/apache-ant-1.5.4/bin/ant.bat -emacs
> compile
> 
> really works!
> 
> Now it would be nice if it could be made automatic.

Automatic in what sense?  The shell cannot know that a file foo.bat
needs to be run thru "cmd /c", so it's your responsibility to type
that on the command line.

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

* Re: OT: Run Ant in MingW shell?
       [not found]   ` <mailman.1779.1066286649.21628.help-gnu-emacs@gnu.org>
@ 2003-10-16 20:32     ` Kai Grossjohann
  2003-10-17  6:28       ` Eli Zaretskii
       [not found]       ` <mailman.1848.1066372440.21628.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Kai Grossjohann @ 2003-10-16 20:32 UTC (permalink / raw)


"Eli Zaretskii" <eliz@elta.co.il> writes:

> Automatic in what sense?  The shell cannot know that a file foo.bat
> needs to be run thru "cmd /c", so it's your responsibility to type
> that on the command line.

Why can't the shell know?  In a Windows environment, it seems useful
to just tell it so.

(Actually, there must be a registry of some kind in Windows that
says that *.bat files are associated with cmd, but I don't know the
details.)

Am I on the wrong track in some way?

Kai

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

* Re: OT: Run Ant in MingW shell?
  2003-10-16 20:32     ` Kai Grossjohann
@ 2003-10-17  6:28       ` Eli Zaretskii
       [not found]       ` <mailman.1848.1066372440.21628.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2003-10-17  6:28 UTC (permalink / raw)


> From: Kai Grossjohann <kai.grossjohann@gmx.net>
> Newsgroups: gnu.emacs.help
> Date: Thu, 16 Oct 2003 22:32:18 +0200
> 
> > The shell cannot know that a file foo.bat
> > needs to be run thru "cmd /c", so it's your responsibility to type
> > that on the command line.
> 
> Why can't the shell know?  In a Windows environment, it seems useful
> to just tell it so.

That means someone should hack the Bash sources to add the code to do
this.  Originally, Bash simply looks at the executable bit returned by
`stat' and at the magic number.  If the magic number is "#!", it then
reads the first line of the script looking for the interpreter.
(Actually, I think this is in the kernel, at least on some flavors of
Unix.)

> (Actually, there must be a registry of some kind in Windows that
> says that *.bat files are associated with cmd, but I don't know the
> details.)

No, AFAIK the association of *.bat files in inside CMD itself, not in
the registry.

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

* Re: OT: Run Ant in MingW shell?
       [not found]       ` <mailman.1848.1066372440.21628.help-gnu-emacs@gnu.org>
@ 2003-10-17  7:19         ` Jason Rumney
  0 siblings, 0 replies; 12+ messages in thread
From: Jason Rumney @ 2003-10-17  7:19 UTC (permalink / raw)


"Eli Zaretskii" <eliz@elta.co.il> writes:

> > (Actually, there must be a registry of some kind in Windows that
> > says that *.bat files are associated with cmd, but I don't know the
> > details.)
> 
> No, AFAIK the association of *.bat files in inside CMD itself, not in
> the registry.

That is correct. The association for .bat files in the registry is
"%1" "%*", so the real association must be done inside CMD and
Explorer.

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

* Re: OT: Run Ant in MingW shell?
  2003-10-14 22:24   ` Kai Grossjohann
  2003-10-15  5:49     ` Eli Zaretskii
@ 2003-10-17 15:50     ` Kai Grossjohann
  1 sibling, 0 replies; 12+ messages in thread
From: Kai Grossjohann @ 2003-10-17 15:50 UTC (permalink / raw)


Kai Grossjohann <kai.grossjohann@gmx.net> wrote in message news:<86n0c3v4nx.fsf@slowfox.dyndns.org>...
> 
> Correction: it seems that $CLASSPATH looks like c:/foo;c:/bar, note
> the semicolon and the forward slashes.

The forward slashes come from some code in my .emacs file.  I forget
why I have this, but if that proves to be the problem, then I'll of
course change that code in .emacs (or remove it, or whatever).

Kai

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

end of thread, other threads:[~2003-10-17 15:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-09  8:18 OT: Run Ant in MingW shell? Kai Grossjohann
2003-10-09 11:05 ` Eli Zaretskii
     [not found] ` <mailman.1406.1065699895.21628.help-gnu-emacs@gnu.org>
2003-10-14 22:24   ` Kai Grossjohann
2003-10-15  5:49     ` Eli Zaretskii
2003-10-17 15:50     ` Kai Grossjohann
2003-10-15 11:07 ` Kai Grossjohann
2003-10-16  6:38   ` Eli Zaretskii
     [not found]   ` <mailman.1779.1066286649.21628.help-gnu-emacs@gnu.org>
2003-10-16 20:32     ` Kai Grossjohann
2003-10-17  6:28       ` Eli Zaretskii
     [not found]       ` <mailman.1848.1066372440.21628.help-gnu-emacs@gnu.org>
2003-10-17  7:19         ` Jason Rumney
2003-10-15 17:04 ` Paul Kinnucan
2003-10-15 19:27   ` Kai Grossjohann

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).