I'm using Databricks Connect to run code in my Azure Databricks cluster locally from IntelliJ IDEA (Scala).

Everything works fine. I can connect, debug, inspect locally in the IDE.

I created a Databricks Job to run my custom app JAR, but it fails with the following exception:

```
19/08/17 19:20:26 ERROR Uncaught throwable from user code: java.lang.NoClassDefFoundError: com/databricks/service/DBUtils$
at Main$.<init>(Main.scala:30)
at Main$.<clinit>(Main.scala)

```

Line 30 of my Main.scala class is

```
val dbutils: DBUtils.type = com.databricks.service.DBUtils

```

Just like how it's described on [this documentation page](https://learn.microsoft.com/en-us/azure/databricks/dev-tools/databricks-connect#access-dbutils)

That pages shows a way to access DBUtils that works both locally and in the cluster. But the example only shows Python, and I'm using Scala.

What's the proper way to access it in a way that works both locally using databricks-connect and in a Databricks Job running a JAR?

**UPDATE**

It seems there are two ways of using DBUtils.

1) The DbUtils class described [here](https://learn.microsoft.com/en-us/azure/databricks/dev-tools/databricks-utils).
Quoting the docs, this library allows you to build and compile the project, but not run it. This doesn't let you run your local code on the cluster.

2) The Databricks Connect described [here](https://learn.microsoft.com/en-us/azure/databricks/dev-tools/databricks-connect). This one allows you to run your local Spark code in a Databricks cluster.

The problem is that these two methods have different setups and package name. There doesn't seem to be a way to use Databricks Connect locally (which is not available in the cluster) but then have the jar application using the DbUtils class added via sbt/maven so that the cluster has access to it.