NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

How do I set MAVEN_OPTS?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
neu242



Joined: 25 Nov 2008
Posts: 9

PostPosted: Wed Nov 26, 2008 8:31 am    Post subject: How do I set MAVEN_OPTS? Reply with quote

Hi.

I have set MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m" in my shell, which I need to compile my large project with maven2. If I start NetBeans from the shell it honors MAVEN_OPTS and my project compiles like it should within the IDE. However, if I start NetBeans by just double clicking it I get java.lang.OutOfMemoryError: Java heap space when compiling.

I have tried adding -J-Xmx512m to netbeans_default_options in /Applications/NetBeans/NetBeans\ 6.5.app/Contents/Resources/NetBeans/etc/netbeans.conf, but that doesn't help. I guess that only affects JAVA_OPTS anyway, and would not work.

How do I set MAVEN_OPTS within NetBeans?

(I'm using MacOSX Leopard on a MacBook Pro with 4GB RAM.)
Back to top
neu242



Joined: 25 Nov 2008
Posts: 9

PostPosted: Wed Nov 26, 2008 9:17 am    Post subject: Re: How do I set MAVEN_OPTS? Reply with quote

I have even tried adding ...
Code:
   <key>LSEnvironment</key>
   <dict>
      <key>MAVEN_OPTS</key>
      <string>-Xmx512m -XX:MaxPermSize=128m</string>
   </dict>

... to /Applications/NetBeans/NetBeans\ 6.5.app/Contents/Info.plist. This should have worked according to http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html , but sadly it didn't.
Back to top
neu242



Joined: 25 Nov 2008
Posts: 9

PostPosted: Wed Nov 26, 2008 9:34 am    Post subject: How to set environment variables for NetBeans Reply with quote

I finally discovered how to do it. I'm talking to myself here Smile

In ~/.netbeans/6.5/, create etc/netbeans.conf. Add your environment variables there, e.g.:

Code:
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m"
Back to top
kabriel



Joined: 24 Jul 2009
Posts: 2

PostPosted: Fri Jul 24, 2009 12:57 am    Post subject: Reply with quote

Is this still the only way to change the options for maven?

I need to adjust the heap size used by the maven process, is there any easy way to do this? Is this something that could be easily added to the maven plugin?
Back to top
mkleint
Posted via mailing list.





PostPosted: Fri Jul 24, 2009 8:27 am    Post subject: How do I set MAVEN_OPTS? Reply with quote

kabriel wrote:
Quote:
Is this still the only way to change the options for maven?



I need to adjust the heap size used by the maven process, is there any easy way to do this? Is this something that could be easily added to the maven plugin?





netbeans should be able to pick up the MAVEN_OPTS you have normally in
your OS.\

http://www.netbeans.org/issues/show_bug.cgi?id=166874

Milos
Back to top
emiddio-verizon
Posted via mailing list.





PostPosted: Fri Jul 24, 2009 5:44 pm    Post subject: How do I set MAVEN_OPTS? Reply with quote

the only way i found -- since i'm not an expert on Maven -- is to
modify the mvn.bat file -- i added

set MAVEN_OPTS=-Xmx512m -Dmaven.test.skip=true %MAVEN_OPTS%

to the file.

i dont want a global environment variable -- and dont know or see a way to
do in in netbeans.

gary

----- Original Message -----
From: "mkleint" <address-removed>
To: <address-removed>
Sent: Friday, July 24, 2009 1:27 AM
Subject: Re: [nbusers] How do I set MAVEN_OPTS?


Quote:
kabriel wrote:
Quote:
Is this still the only way to change the options for maven?



I need to adjust the heap size used by the maven process, is there any
easy way to do this? Is this something that could be easily added to the
maven plugin?





netbeans should be able to pick up the MAVEN_OPTS you have normally in
your OS.\

http://www.netbeans.org/issues/show_bug.cgi?id=166874

Milos
Back to top
mkleint
Posted via mailing list.





PostPosted: Fri Jul 24, 2009 5:52 pm    Post subject: How do I set MAVEN_OPTS? Reply with quote

emiddio-verizon wrote:
Quote:
the only way i found -- since i'm not an expert on Maven -- is to
modify the mvn.bat file -- i added

set MAVEN_OPTS=-Xmx512m -Dmaven.test.skip=true %MAVEN_OPTS%

to the file.

i dont want a global environment variable -- and dont know or see a
way to do in in netbeans.
changing the mvn.bat is sort of more "global" that setting the env.
variable. But do what suits you. Please note that with these options
running tests in netbeans might not work. A better way to disable test
execution is to do it in Tools/Options/Misc dialog.

Milos

Quote:

gary

----- Original Message ----- From: "mkleint" <address-removed>
To: <address-removed>
Sent: Friday, July 24, 2009 1:27 AM
Subject: Re: [nbusers] How do I set MAVEN_OPTS?


Quote:
kabriel wrote:
Quote:
Is this still the only way to change the options for maven?



I need to adjust the heap size used by the maven process, is there
any easy way to do this? Is this something that could be easily
added to the maven plugin?





netbeans should be able to pick up the MAVEN_OPTS you have normally
in your OS.\

http://www.netbeans.org/issues/show_bug.cgi?id=166874

Milos
Back to top
kabriel



Joined: 24 Jul 2009
Posts: 2

PostPosted: Fri Jul 24, 2009 5:59 pm    Post subject: Reply with quote

Wouldn't it be great to just have a Options field in the settings dialog that lets you define project specific (or global) options for when you run maven? This could then set the MAVEN_OPTS before executing the mvn command.

Just a thought/request.
Back to top
Ludovic Champenois
Posted via mailing list.





PostPosted: Sat Jul 25, 2009 5:02 pm    Post subject: How do I set MAVEN_OPTS? Reply with quote

On 7/24/09 10:59 AM, kabriel wrote:
Quote:
Wouldn't it be great to just have a Options field in the settings dialog that lets you define project specific (or global) options for when you run maven? This could then set the MAVEN_OPTS before executing the mvn command.



Just a thought/request.





RFE:http://www.netbeans.org/issues/show_bug.cgi?id=166874
Ludo
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo