Working on a Mod for Spigot/Minecraft (Class Not Found Err)

Wanted to make a quick skeleton project to show what my issue is. I’m wanting to use Kotlin to develop a mod using Spigot for Minecraft, but I’m getting an error “java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics”. I’ve read several different things and am not sure what the solution is.

I’ve heard of a shadow jar or something? Not sure what that is. I’m hoping that there is a straightforward solution though! :sweat_smile:


New Project -> Kotlin JVM

/hello -> Error Log:

[Server thread/WARN]: Unexpected exception while parsing console command "hello"
org.bukkit.command.CommandException: Unhandled exception executing command 'hello' in plugin KotlinSkeleton v1.0.0
at org.bukkit.command.PluginCommand.execute( ~[spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at org.bukkit.command.SimpleCommandMap.dispatch( ~[spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand( ~[spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchServerCommand( [spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at net.minecraft.server.v1_14_R1.DedicatedServer.handleCommandQueue( [spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at net.minecraft.server.v1_14_R1.DedicatedServer.b( [spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at net.minecraft.server.v1_14_R1.MinecraftServer.a( [spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at [spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at Source) [?:1.8.0_221]
Caused by: java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
at com.talvysh.kotlinskeleton.KotlinCmd.onCommand(KotlinCmd.kt) ~[?:?]
at org.bukkit.command.PluginCommand.execute( ~[spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
... 8 more
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
at Source) ~[?:1.8.0_221]
at ~[spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at ~[spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
at com.talvysh.kotlinskeleton.KotlinCmd.onCommand(KotlinCmd.kt) ~[?:?]
at org.bukkit.command.PluginCommand.execute( ~[spigot-1.14.4.jar:git-Spigot-798ea6a-368f4e9]
... 8 more


package com.talvysh.kotlinskeleton


public class KotlinSkeleton: JavaPlugin(){
    override fun onEnable() {"Enabled.")

    override fun onDisable() {}


package com.talvysh.kotlinskeleton

import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
import org.bukkit.command.CommandSender

public class KotlinCmd: CommandExecutor{
    override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
        if(label.equals("hello", true)) {
            sender.sendMessage("Hello, World!")
            return true

        return false

Additional Info

Modules -> Dependencies:

  • Spigot.jar
  • Spigot API folder

Artifacts -> Output Layout

  • KotlinJavaRuntime
  • ‘KotlinSkeleton’ compile output

Everything else is left default.

The problem is that the runtime can’t find the kotlin standard library. If you are building with gradle or maven the solution would be using the shadow plugin. There are multiple tutorials on how to do that on the internet. Just search “kotlin shadowjar gradle” or “kotlin shadowjar maven” and you should find plenty of examples on how to do that.
I’m not sure how to set this up using Intellij’s build system. You need to either include the standard-lib into your own jar or link to it using the manifest file and copy the standard-lib along with your jar.
As far as I can tell you can set this up when you create the artifact under “JAR files from libraries”. Not sure how to change that later.