Ant java task to start application

V

vnssoftware

If I use Core Ant 'java' task to start application it doesn't allow me
to do Remote Debugging? How can I remote debug the application by
running using 'java 'task. The reason I have to use Ant and not
command line is that the classpath is too big to fit and I get line
too long. I am happy to use Ant. I am using fork="yes" but the remotre
debuggers cannot connect. Please help.

Thank you!
 
M

Matt Parker

vnssoftware said:
If I use Core Ant 'java' task to start application it doesn't allow me
to do Remote Debugging? How can I remote debug the application by
running using 'java 'task. The reason I have to use Ant and not
command line is that the classpath is too big to fit and I get line
too long. I am happy to use Ant. I am using fork="yes" but the remotre
debuggers cannot connect. Please help.

Thank you!

Why not write a batch file or shell script to start it?

Matt
 
D

Dave Glasser

Why not write a batch file or shell script to start it?

That probably wouldn't solve the problem of the too-long command line.
There's a Windows limitation on the length of command lines (I'm
assuming he's using Windows, because *nix limits are usually much
higher) and you can't even set the CLASSPATH environment variable with
a shell command if the CLASSPATH is huge.
 
D

Dave Glasser

(e-mail address removed) (vnssoftware) wrote on 23 Feb 2004 13:55:53
-0800 in comp.lang.java.programmer:
If I use Core Ant 'java' task to start application it doesn't allow me
to do Remote Debugging? How can I remote debug the application by
running using 'java 'task. The reason I have to use Ant and not
command line is that the classpath is too big to fit and I get line
too long. I am happy to use Ant. I am using fork="yes" but the remotre
debuggers cannot connect. Please help.


I can't help you get the debugger to work when you're launching with
Ant, but there are a number of ways to work around the command line
problem. One is to put all of the jars you're using into a single
directory, and make that the extension directory like this:

java -Djava.ext.dirs=C:/myjardir -classpath C:/myclasses MyAppClass

Be careful though, only files with names ending in .jar will be found
in that directory, not .zip. Rename *.zip to *.jar and they'll be
found.

Another way would be to have an empty jar file in the classpath, and
the Class-Path header of its manifest file would reference all of the
other jars you need, so you don't need to include them in the
classpath. See:

http://java.sun.com/j2se/1.4.2/docs/guide/extensions/index.html

for more info.
 
O

Oscar kind

vnssoftware said:
If I use Core Ant 'java' task to start application it doesn't allow me
to do Remote Debugging? How can I remote debug the application by
running using 'java 'task. The reason I have to use Ant and not
command line is that the classpath is too big to fit and I get line
too long. I am happy to use Ant. I am using fork="yes" but the remotre
debuggers cannot connect. Please help.

You need to set some JVM arguments to instruct the JVM you're starting to
allow a remote debugger to attach. You can find some information here:
http://java.sun.com/products/jpda/doc/conninv.html


Oscar
 
V

vnssoftware

Dave Glasser said:
(e-mail address removed) (vnssoftware) wrote on 23 Feb 2004 13:55:53
-0800 in comp.lang.java.programmer:



I can't help you get the debugger to work when you're launching with
Ant, but there are a number of ways to work around the command line
problem. One is to put all of the jars you're using into a single
directory, and make that the extension directory like this:

java -Djava.ext.dirs=C:/myjardir -classpath C:/myclasses MyAppClass

Be careful though, only files with names ending in .jar will be found
in that directory, not .zip. Rename *.zip to *.jar and they'll be
found.

Another way would be to have an empty jar file in the classpath, and
the Class-Path header of its manifest file would reference all of the
other jars you need, so you don't need to include them in the
classpath. See:

http://java.sun.com/j2se/1.4.2/docs/guide/extensions/index.html

for more info.


I am on Windows. Is this limitation of ANT a known LIMITATION?
I really wanted to do using ANT.
 
V

vnssoftware

Dave Glasser said:
(e-mail address removed) (vnssoftware) wrote on 23 Feb 2004 13:55:53
-0800 in comp.lang.java.programmer:



I can't help you get the debugger to work when you're launching with
Ant, but there are a number of ways to work around the command line
problem. One is to put all of the jars you're using into a single
directory, and make that the extension directory like this:

java -Djava.ext.dirs=C:/myjardir -classpath C:/myclasses MyAppClass

Be careful though, only files with names ending in .jar will be found
in that directory, not .zip. Rename *.zip to *.jar and they'll be
found.

Another way would be to have an empty jar file in the classpath, and
the Class-Path header of its manifest file would reference all of the
other jars you need, so you don't need to include them in the
classpath. See:

http://java.sun.com/j2se/1.4.2/docs/guide/extensions/index.html

for more info.


Also..
I don't have the entire classpath in Jar.
Its in directory form in some paths and I don't want to go into
jarring it wach time the classes change on those paths.
 
M

Matt Parker

vnssoftware said:
I am on Windows. Is this limitation of ANT a known LIMITATION?
I really wanted to do using ANT.

It's a limitation of Windows...

Matt
 
V

vnssoftware

Matt Parker said:
It's a limitation of Windows...

Matt

Well...the remote debugging not working when starting from Ant is an
ANT limitation because you cannot interact with forked jvm(as the
manual says) it seems. And the line too long is a Windows limitation
from Command line.

So, what is my option for Remote Debugging? Which ever tool I like-
command line or Ant --- I have to leave because of their limitations.
I didn't expect this from Ant. I am blocked.....
 
A

Andrew Thompson

"Collin VanDyck" ...
....
...
http://groups.google.com/[email protected]&rn
....
That's a huge pet peeve of mine. I have no idea how to avoid it except to
encode a post as HTML*

There is always tinyurl.com, two
reasons I do not use them though.

1) I heard the URL's only work for
days, whereas my links are
'wisdom for the ages' [ ;-) ]

2) If the recipient in an IT group
cannot repair an URL, what hope
is there for them?
*anger everyone on USENET.

You did not cross-post it widely
enough to anger _everyone_...
 
S

Sudsy

Collin VanDyck wrote:
That's a huge pet peeve of mine. I have no idea how to avoid it except to
encode a post as HTML*

Most newsreaders (even on Linux!) respect angle brackets used to keep
a long URL from being split over multiple lines. I believe someone
posted this same fact just a couple of days ago...
So just stick your URLs inside angle brackets and you should be good-
to-go.
 
A

Andrew Thompson

Sudsy said:
Collin VanDyck wrote:


Most newsreaders (even on Linux!) respect angle brackets used to keep
a long URL from being split over multiple lines. I believe someone
posted this same fact just a couple of days ago...
So just stick your URLs inside angle brackets and you should be good-
to-go.

Irritatingly, I started doing that recently,
it seemed to be working right up until
that post...

I do not know what has changed
at this end. :-(
 
T

Tony Morris

vnssoftware said:
If I use Core Ant 'java' task to start application it doesn't allow me
to do Remote Debugging? How can I remote debug the application by
running using 'java 'task. The reason I have to use Ant and not
command line is that the classpath is too big to fit and I get line
too long. I am happy to use Ant. I am using fork="yes" but the remotre
debuggers cannot connect. Please help.

Thank you!

You simply pass the appropriate system properties to the <java> task.
http://ant.apache.org/manual

--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform
 
A

Andrew Thompson

"Christophe Vanfleteren" ...
Andrew Thompson wrote:
....
You can shorten that url:

google.com/groups?selm=354DBC68.4B57%40deltaelectronics.com&rnum=2

specifying the groups subdomain is not necessary.

Handy to know, I have been playing with
trimming unnecessary bits off post URL's,
but that one had eluded me.

I am also toying with setting up a page
that will take an URL and (attempt to)
determine the shortest version that will
reach the resource..

Before I do that though, I need more
practise at it myself.. ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top