Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Eclipse/Ant/javac and fork=true
Eclipse/Ant/javac and fork=true [message #196596] Tue, 17 February 2004 17:42 Go to next message
Eclipse UserFriend
OS:Windows XP
Eclipse: 3.0M6

I have an ant build.xml file with the following target:

<target name="build" depends="init">
<!-- Make the destination directory -->
<mkdir dir="${build.dest}" />

<!-- Compile the source files & copy the support files -->
<javac fork="yes" classpath="${classpath}"
srcdir="${build.src}"
destdir="${build.dest}"
debug="${debug}"
optimize="${optimize}"
excludes="**/*~"/>
</target>

If I run ant (v 1.6) from the command line the above javac task is
processed just fine. However, if I run ant from inside Eclipse the
above target fails with the following error:

[javac] javac: invalid flag: C:\Documents

If I remove the fork="yes" from the above the build runs as expected.
I'm looking for an *easy* way to deal with this. For various reasons
my team wants to keep the fork=yes and I would like to be able to have
my Eclipse workspaces located anywhere on the file system and not
require paths that do not contain spaces (a rediculous restriction in
2004).

I'm hoping there is something obvious I'm missing in configuration and
was hoping someone out there could help, or is this a bug in Eclipse?

Shane
Re: Eclipse/Ant/javac and fork=true [message #196628 is a reply to message #196596] Tue, 17 February 2004 18:40 Go to previous messageGo to next message
Eclipse UserFriend
This could be a bug in Eclipse...I will check shortly.
How are you running the Ant build within Eclipse; in the same VM as Eclipse
or in a separate VM? Have you tried both?
Have you tried running from the commandline in the exact same location that
your workspace is in (to remove the possibility of an Ant bug)?

Darins

<sholder@chipdata.com> wrote in message news:smh9ib0j.fsf@chipdata.com...
>
> OS:Windows XP
> Eclipse: 3.0M6
>
> I have an ant build.xml file with the following target:
>
> <target name="build" depends="init">
> <!-- Make the destination directory -->
> <mkdir dir="${build.dest}" />
>
> <!-- Compile the source files & copy the support files -->
> <javac fork="yes" classpath="${classpath}"
> srcdir="${build.src}"
> destdir="${build.dest}"
> debug="${debug}"
> optimize="${optimize}"
> excludes="**/*~"/>
> </target>
>
> If I run ant (v 1.6) from the command line the above javac task is
> processed just fine. However, if I run ant from inside Eclipse the
> above target fails with the following error:
>
> [javac] javac: invalid flag: C:\Documents
>
> If I remove the fork="yes" from the above the build runs as expected.
> I'm looking for an *easy* way to deal with this. For various reasons
> my team wants to keep the fork=yes and I would like to be able to have
> my Eclipse workspaces located anywhere on the file system and not
> require paths that do not contain spaces (a rediculous restriction in
> 2004).
>
> I'm hoping there is something obvious I'm missing in configuration and
> was hoping someone out there could help, or is this a bug in Eclipse?
>
> Shane
>
Re: Eclipse/Ant/javac and fork=true [message #197405 is a reply to message #196628] Wed, 18 February 2004 17:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hhzz60.hotmail.com

Always put quotes around directories that contain spaces. This will allow
the ant script to work inside and outside of eclipse (with or without
forking).



"Darin Swanson" <Darin_Swanson@us.ibm.com> wrote in message
news:c0u8ap$vu6$1@eclipse.org...
> This could be a bug in Eclipse...I will check shortly.
> How are you running the Ant build within Eclipse; in the same VM as
Eclipse
> or in a separate VM? Have you tried both?
> Have you tried running from the commandline in the exact same location
that
> your workspace is in (to remove the possibility of an Ant bug)?
>
> Darins
>
> <sholder@chipdata.com> wrote in message news:smh9ib0j.fsf@chipdata.com...
> >
> > OS:Windows XP
> > Eclipse: 3.0M6
> >
> > I have an ant build.xml file with the following target:
> >
> > <target name="build" depends="init">
> > <!-- Make the destination directory -->
> > <mkdir dir="${build.dest}" />
> >
> > <!-- Compile the source files & copy the support files -->
> > <javac fork="yes" classpath="${classpath}"
> > srcdir="${build.src}"
> > destdir="${build.dest}"
> > debug="${debug}"
> > optimize="${optimize}"
> > excludes="**/*~"/>
> > </target>
> >
> > If I run ant (v 1.6) from the command line the above javac task is
> > processed just fine. However, if I run ant from inside Eclipse the
> > above target fails with the following error:
> >
> > [javac] javac: invalid flag: C:\Documents
> >
> > If I remove the fork="yes" from the above the build runs as expected.
> > I'm looking for an *easy* way to deal with this. For various reasons
> > my team wants to keep the fork=yes and I would like to be able to have
> > my Eclipse workspaces located anywhere on the file system and not
> > require paths that do not contain spaces (a rediculous restriction in
> > 2004).
> >
> > I'm hoping there is something obvious I'm missing in configuration and
> > was hoping someone out there could help, or is this a bug in Eclipse?
> >
> > Shane
> >
>
>
Re: Eclipse/Ant/javac and fork=true [message #197838 is a reply to message #196628] Thu, 19 February 2004 11:22 Go to previous messageGo to next message
Eclipse UserFriend
"Darin Swanson" <Darin_Swanson@us.ibm.com> writes:

> This could be a bug in Eclipse...I will check shortly.
> How are you running the Ant build within Eclipse; in the same VM as Eclipse
> or in a separate VM? Have you tried both?

Assuming you're talking about the "Run Ant..."/JRE tab I just tried
both options of "Run in the same JRE as the workspace" and "Alternate
JRE" (no additional arguments) with the same outcome. (FWIW I'm
running 1.4.2.01 SDK).

> Have you tried running from the commandline in the exact same location that
> your workspace is in (to remove the possibility of an Ant bug)?

CD'ing to my workspace/project directory and running ant on the
commandline yeilds a successful build of the project.

Shane
Re: Eclipse/Ant/javac and fork=true [message #197842 is a reply to message #197405] Thu, 19 February 2004 11:25 Go to previous messageGo to next message
Eclipse UserFriend
"Kurt" <hhzz60@hotmail.com> writes:

> Always put quotes around directories that contain spaces. This will allow
> the ant script to work inside and outside of eclipse (with or without
> forking).

I thought I had, the classpath is set to "${classpath}" how many do I
need? :)

>> > <javac fork="yes" classpath="${classpath}"
>> > srcdir="${build.src}"
>> > destdir="${build.dest}"
>> > debug="${debug}"
>> > optimize="${optimize}"
>> > excludes="**/*~"/>
Re: Eclipse/Ant/javac and fork=true [message #197849 is a reply to message #197842] Thu, 19 February 2004 11:55 Go to previous message
Eclipse UserFriend
If you could take the time to log a bug report against Platform Ant I can
take a look.
Please include all the details like a sample buildfile, a sample classpath
etc.

Thanks
Darins

<sholder@chipdata.com> wrote in message news:brnvhw8e.fsf@chipdata.com...
> "Kurt" <hhzz60@hotmail.com> writes:
>
> > Always put quotes around directories that contain spaces. This will
allow
> > the ant script to work inside and outside of eclipse (with or without
> > forking).
>
> I thought I had, the classpath is set to "${classpath}" how many do I
> need? :)
>
> >> > <javac fork="yes" classpath="${classpath}"
> >> > srcdir="${build.src}"
> >> > destdir="${build.dest}"
> >> > debug="${debug}"
> >> > optimize="${optimize}"
> >> > excludes="**/*~"/>
Previous Topic:new search view
Next Topic:Associate Editor with File extension like *.bz.xsd"
Goto Forum:
  


Current Time: Tue Jun 03 23:37:48 EDT 2025

Powered by FUDForum. Page generated in 0.05107 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top