File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What do I use instead of ANT_OPTS ?

 
Dave Alvarado
Ranch Hand
Posts: 436
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm running Ant 1.6 through Eclipse 3.4 Ganymede on Win XP. I'm running into OutOfMemroyErrors when compiling and running my JUnit tests through Ant. I read that Eclipse does not pay attention to the "ANT_OPTS" argument. Where can I set the memory size for Ant within Eclipse?

Thanks, - Dave
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are your running Ant in a separate process or within Eclipse's process? If the former, then are you running Ant as a task or as a builder? Either way, there should be a JRE tab for the Ant run configuration properties - you can add the heap settings there. If you are running within the Eclipse process, then you can set heap size for Eclipse in eclipse.ini within the Eclipse home directory.

If this does not help, please state exactly how you are running Ant within Eclipse.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if I'm running as an Ant task or a builder. Here's what I'm doing ...

From Package Explorer view, right clicking on my build file, select "Run As" and then selecting "Ant Build".

Then I went to Window -> Preferences, and selected Ant -> Runtime, but I can't find the options you reference in there either ...

http://screencast.com/t/Vn93Bo0Gq

Any follow-up advice is much appreciated, - Dave
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that running the Ant build that way runs it within Eclipse (that is, in the same JVM as Eclipse). So you would set the JVM options for Eclipse in eclipse.ini.

If you want to run Ant as a separate process, try this. Go to Project | Properties, then Builders and click New. Select Ant Builder, then in the Edit Configuration place your build.xml file in the Buildfile field on the Main tab, and then on the JRE tab select Separate JRE and add the JVM options in the VM Arguments field. Then back on the project Properties dialog,. unselect the other builder so that only the Ant builder is selected. Now any time you build the project it will use Ant in a separate process.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As as follow up to this, I increased my heap size but when I started Eclipse I got this screen

http://screencast.com/t/IZ5YNfIoLUK

I have 2 GB of RAM on my system so I'm not sure why the JVM is terminating with exit code = 1.

Thanks, - Dave
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are setting the heap to 1GB and the permgen to 1/2GB. You are might be running out of memory (though when I set my memory too high I get a "Could not create Java virtual machine" dialog). Eclipse generates a log file for such an error, and it will have more details (I would tell you where it is, but I can't find the file).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic