# importClass

### Overview:

<table data-header-hidden><thead><tr><th>Functions:</th></tr></thead><tbody><tr><td>Functions:</td></tr><tr><td><pre class="language-javascript"><code class="lang-javascript">importClass(className)
</code></pre></td></tr></tbody></table>

### API Reference

### `importClass()`

Returns the specified class if it exists.

```js
let Bukkit = importClass("org.bukkit.Bukkit")
```

**Parameters:**

* `className`*(String)*\
  Name of the class to import.

***

### Example:

{% code title="Get java logger with importClass(..)" %}

```js
var javaLogger = importClass("java.util.logging.Logger")
var logger = javaLogger.getLogger("OpenJSPluginLogger");
logger.info("This is a log message.");
```

{% endcode %}

{% hint style="warning" %}
**This example is for demonstration only.**

Logging directly with `java.util.logging.Logger` will obscure the log source, making debugging and support difficult.\
**It is recommended to use the**[ **embedded logging system**](https://openjs.docdb.org/openjs-components/in-build-classes/logging) **instead.**
{% endhint %}
