---
schema_version: "1"
id: 009cc18dfa8dcb0f032d33a6bfbb27424f415a198ffa80fee9efecec6481fc9f
title: Java Module 2.0
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/java-module/latest/index.md
canonical_url: https://docs.mulesoft.com/java-module/latest/
source_site: docs.mulesoft.com
content_type: documentation
content_hash: dcce4397d69c6a4082b95a6ad8a3e6791d3d26ef3c87707b714596ea624709dd
description: MuleSoft Documentation Site
release: "2.0"
latest: true
---
---
product: Java Module
version: 2.0
is-latest-version: true
---

# Java Module 2.0

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Release Notes: [Java Module Release Notes](https://docs.mulesoft.com/release-notes/connector/java-module)  
Exchange: [Java Module](https://www.mulesoft.com/exchange/org.mule.module/mule-java-module/)

Mule 4 is built to:

- Minimize the need for custom code.

- Avoid the need for you to know or understand Java.

However, some advanced uses cases require integration with custom Java code, such as:

- Reuse of a library, such as a tax calculation library.

- Reuse of a canonical object model that is standard in the organization.

- Execution of custom logic using Java.

MEL previously served as a bridge for creating instances of Java classes and executing Java methods.
In Mule 4, interoperation with Java changed, due to the replacement of MEL by DataWeave, which is a
functional language. Functional languages do not have side effects on their input arguments, so it
does not make sense for DataWeave to execute random instance methods on random object instances.
Therefore, pure DataWeave supports calling only static Java methods, without use of the Java module.

## Java Module Versus the Scripting Module

You can use the Java module, or execute Groovy code through the
[Scripting module](https://docs.mulesoft.com/scripting-module/latest/). However, the Scripting module does not offer
DataSense support, user interface support, visual aids for methods available for each class,
autocompletion, and so on. See [Java Integration](https://docs.mulesoft.com/mule-runtime/latest/).

## See Also

- [Create an Instance of a Class](https://docs.mulesoft.com/java-module/latest/java-create-instance)

- [Invoke Methods](https://docs.mulesoft.com/java-module/latest/java-invoke-method)

- [Test for an Instance of a Class](https://docs.mulesoft.com/java-module/latest/java-instanceof)

- [Work With Throwables](https://docs.mulesoft.com/java-module/latest/java-throwable)

- [Java Module Reference](https://docs.mulesoft.com/java-module/latest/java-reference)

- [Java Module Argument Transformation](https://docs.mulesoft.com/java-module/latest/java-argument-transformation)

- [Salesforce Help](https://help.salesforce.com)
