Question: Is there a way to skip `MissingPropertyException` while using `GroovyShell.evaluate`?

```
def sharedData = new Binding()
def shell = new GroovyShell(sharedData)
shell.evaluate("a=5; b=1") // works fine

// How to not get MissingPropertyException, or silently ignore property 'a'
shell.evaluate("a; b=1") // MissingPropertyException for 'a'

```

I know about the Expando solution, is there a way to do it without defining a class?

Answer: 
Ok, so the answer was adding this environment variable :

```
JAVA_OPTS_APPEND=-javaagent:{{path_to_elastic_apm_agent}}

```

this command allows you to launch your java application with options.
The Java agent allows multiple ways to configure it, one of which are command line system properties. Others include packaging an `elasticapm.properties` resource file or setting environment variables.

[Check out the docs](https://www.elastic.co/guide/en/apm/agent/java/current/configuration.html). Small excerpt:

> 
> * **Properties file**: The `elasticapm.properties` file is located in the same folder as the agent jar, or provided through the `config_file` option. dynamic config.
> * **Environment variables**: All configuration keys are in uppercase and prefixed with `ELASTIC_APM_`.
> 
> 
> 

Different option sources have different priority and precedence.

To attach the agent to a running JVM process (from within your application), you can use the [API to self-attach](https://www.elastic.co/guide/en/apm/agent/java/master/setup-attach-api.html#setup-attach-api-configuration).