# Setting the location of a DataSource's JVM

To configure the Java virtual machine (JVM) for a C-based DataSource application, or for a Java module within the application, use the appropriate [dfw](../deployment-framework/cdf-the-deployment-framework-command-utility-dfw.md) commands and then set up any additional configuration items as defined on the [Java (JVM) configuration reference page](datasource-java-jvm-configuration.md).

## Setting the location of a Java DataSource’s JVM

The Deployment Framework starts a Java DataSource application by using the `start-jar.sh` script packaged with the Java DataSource.

The `start-jar.sh` script uses the first `**java**` command located in the shell’s executable `PATH`. The Deployment Framework will log a warning to the console if it cannot find a valid `**java**` command.

To pass configuration options to the JVM used to run a Java DataSource application, edit the application’s `start-jar.sh` script and change the parameters passed to the `java` command used to run the application. For an example, see [Configuring a Java DataSource’s JVM heap](datasource-change-the-size-of-the-jvm-heap.md#java-datasource).

## Setting the location of a C DataSource’s JVM

The functionality of a C DataSource application can be extended with Java modules hosted in an embedded JVM. Examples of Java modules include Transformer’s Refiner module and the JMX monitoring modules of both Liberator and Transformer.

A C DataSource application loads an embedded JVM when the application’s `jvm-location` configuration item is set to the location of a JVM library. Deployment kits for Java modules set their host application’s `jvm-location` to the Deployment Framework macro `JVM_LOCATION`:

```
jvm-location       "${JVM_LOCATION}"
```

The Deployment Framework automatically derives the value of the `JVM_LOCATION` macro from the `JAVA_HOME` environment variable if it exists. If the Deployment Framework fails to correctly derive a value for `JVM_LOCATION`, then you can set it explicitly using the Deployment Framework command [`dfw java`](../deployment-framework/cdf-the-deployment-framework-command-utility-dfw.md#java).

To configure a C DataSource application’s embedded JVM, add or edit [Embedded JVM configuration](datasource-java-jvm-configuration.md) items in the appropriate file:

| Task | Configuration file location |
| --- | --- |
| Developing a C DataSource blade | The blade’s `DataSource/etc/java.conf` file |
| Configuring a deployed C DataSource blade | The Deployment Framework’s `global_config/overrides/<blade-name>/DataSource/java.conf` file |
| [Developing a Liberator Permissioning Service blade](../deployment-framework/cdf-create-a-java-based-liberator-permissioning-service-blade.md) | The blade’s `Liberator/etc/java.conf` file |
| Configuring a Liberator Permissioning Service blade | The Deployment Framework’s `global_config/overrides/<blade-name>/Liberator/etc/java.conf` file |
| [Developing a Transformer Service blade](../deployment-framework/cdf-create-a-java-based-transformer-service-blade.md) | The blade’s `Transformer/etc/java.conf` file |
| Configuring a deployed Transformer Service blade | The Deployment Framework’s `global_config/overrides/<blade-name>/Transformer/etc/java.conf` file |

---

**See also:**

* [Change the size of the JVM heap](datasource-change-the-size-of-the-jvm-heap.md)
* [Customise an existing blade](../deployment-framework/cdf-customise-an-existing-blade.md)
* [Blade types](../deployment-framework/cdf-blade-types.md)
* [Deployment Framework Structure](../deployment-framework/cdf-deployment-framework-structure.md)
