# Difference between runproperties and runvm?

**URL:** <https://bnd.discourse.group/t/difference-between-runproperties-and-runvm/330>\
**Category:** GENERAL\
**Created:** [August 15, 2023, 3:26pm UTC](https://bnd.discourse.group/t/difference-between-runproperties-and-runvm/330 "2023-08-15T15:26:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [August 15, 2023, 3:26pm UTC](https://bnd.discourse.group/t/difference-between-runproperties-and-runvm/330/1 "2023-08-15T15:26:29Z")

</div>

Today I was asked what is the difference between the parameters runproperties and runvm:

E.g. for jetty it seems I can write both:

```auto
-runproperties: \
 org.osgi.service.http.port=8082

```

or

```auto
-runvm:
 -Dorg.osgi.service.http.port=8082,\

```

in a `.bndrun` file.

Seems I can override both from command line via vmargs `-Dorg.osgi.service.http.port=8082`

Both seem to be system properties under the hood.

Is there some kind of advice or explanation which to use when?

---

<div class="post-metadata">

**Author:** ![glimmerveen](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/glimmerveen/32/47_2.png) [@glimmerveen](https://bnd.discourse.group/u/glimmerveen)\
**Post date:** [August 15, 2023, 7:53pm UTC](https://bnd.discourse.group/t/difference-between-runproperties-and-runvm/330/2 "2023-08-15T19:53:47Z")

</div>

The launcher of bnd uses the system properties as an override when it loads the framework properties.  
At the usage side, the BundleContext.getProperty is specified to retrieve value from the corresponding framework property, or fallback to a JVM system property when the key was not present within the framework properties.

The combination of the two allows for the flexibility you described. So either you define a framework property, and the launcher’s ability to look in the system properties allows you to override it using vmargs, or you configure it as a system property to begin with, and the fallback behaviour of BundleContext.getProperty ensures that the value is retrieved as well.

Personally I think using runproperties makes more sense, and you benefit from the launcher’s ability to override using command line arguments.
