This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Cannot set VM parameters using j2seproject GUI | ||
---|---|---|---|
Product: | java | Reporter: | pzajac <pzajac> |
Component: | Project | Assignee: | David Konecny <dkonecny> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | dkonecny, jchalupa, jglick, mkubec, nathanaeljones, phrebejk, pjiricka |
Priority: | P2 | Keywords: | RELNOTE |
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 41537 |
Description
pzajac
2004-05-13 11:02:13 UTC
I guess you are talking about project execution??? You can customize build.xml. These options are not customizable in UI. Typical user doesn't know how to customize build.xml script. This and other possible customizations (system properties, etc.) were intentionally omitted from the GUI. They are fairly easy to control in build.xml and there will be instructions on how to do so for various cases. We may include more such things in the GUI over time but I think these are not planned for D. I will add some property through which this could be easily customized. At the moment the user would have to override whole target. Note that customization of VM parameters and customization of system properties are two different things. Re. system properties, I have commented-out code in j2seproject's build-impl.xsl showing how you could have them be autodefined given the existence of project properties matching a certain pattern. Later we could provide a GUI to set these if there is time. Re. VM properties, I don't know of a clean way to make these parametrizable in Ant, except by overriding the macrodef. I was thinking about using jvmargs attribute of <java>, but now I see that it was deprecated; I thought about: always present jvmargs="${jvm.extra.args}" where jvm.extra.args would be empty by default. OK, for now user has to override run target. Something like: <target name="run" depends="..."> <j2seproject:java xmlns:j2seproject="..."> <customize> <arg line="${application.args}"/> <jvmarg value="-X1..."/> <jvmarg value="-X2..."/> </customize> </j2seproject:java> </target> The problem with jvmargs is that it does not handle spaces or such metacharacters cleanly. May not be critical, I don't know. There is now a property you can set, at least. No GUI for D. Should consider for E. IMHO, but it is for very advanced users. The settings of properties is used in many java tutorials. Write a few lines to ant script is easy for users who know how to work with antscript very well. For normal users the build script of netbeans project is too dificult. We can do UI study for this issue. Current state is that newly created J2SE project has following placeholder in project.properties: #space separated list of JVM args for VM in which the proj will run run.jvmargs= So you do not have to override Ant targets now, just modify this property. Second thing I implemented is that any property prefixed by "run-sys-prop." is made available as system property to executed process. Needs to be at least in user's documentation. Would it be a big deal to expose run.jvmargs in the UI as a single-line text field in the project properties customizer? I know we're past the feature freeze, but it might be easy to do and make lives of users easier. Just curious. Of course it would be easy to do; we only haven't because of feature freeze, and lack of a proposed UI spec for it. Note that you can also set system properties in project/private.properties, using a different syntax (one Ant property per system property). This is also not available in the GUI. The UI for that would be somewhat more complicated since it would be some kind of table of name/value pairs. Of course you can use -Dname1=val1 -Dname2=val2 etc. in your VM args to set system properties, but this is less desirable, in particular because you cannot include spaces in any of the values (would be interpreted as multiple arguments). *** Issue 45431 has been marked as a duplicate of this issue. *** *** Issue 47504 has been marked as a duplicate of this issue. *** Assertions: I'd like to be able to turn execution of assertions on and off via the project UI. Setting 'run.jvmargs=-ea' in the project.properties file is far from obvious for the typical user. Two fields added to Running Project panel: * working directory * VM Options Fixed in: Checking in src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl; new revision: 1.34; previous revision: 1.33 Checking in src/org/netbeans/modules/java/j2seproject/ui/customizer/Bundle.properties; new revision: 1.32; previous revision: 1.31 Checking in src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerRun.form; new revision: 1.8; previous revision: 1.7 Checking in src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerRun.java; new revision: 1.13; previous revision: 1.12 Checking in src/org/netbeans/modules/java/j2seproject/ui/customizer/J2SEProjectProperties.java; new revision: 1.23; previous revision: 1.22 Re. special GUI for assertions: sorry, not covered by this, not planned for 4.0. You can just type "-ea" (or any of its many variants) into the VM arguments field. Verified in dev-200408262030 *** Issue 48504 has been marked as a duplicate of this issue. *** The GUI for jvmargs is not available on Web Projects in NetBeans 6! Is there another way to specify "-ea" for them? asserts are *very* important for development. Why on earth does NetBeans disable them by default? Web Application is executed within an application server environment and so the options like -ea would have to be set for your app server VM. I'm not sure how useful that would be; only applicable for a locally running app server I guess. You can alter your app server startup params by hand. And possibly you could file issue for serverplugins component to provide a UI for that in server customizer. nathanaeljones, you may want to add yourself to issue's CC list to be automatically notified about changes. You can read my comment to your request in issue's description. I've tried setting the server vm options, but it doesn't seem to affect unit tests... Where could I change the unit tests jvm args on a web project? On a class project they're changed in Project Properties>Run? Thanks for your help! OK, you did not mention unit testing before. Well, unfortunately it is not supported. I filed separate issue for that instead of reopening this one - issue 141464. |