Skip to content

Fix compiled JARs not executing properly#23

Merged
Moderocky merged 1 commit intoModerocky:masterfrom
bluelhf:fix/script-runner-classloader
Dec 29, 2025
Merged

Fix compiled JARs not executing properly#23
Moderocky merged 1 commit intoModerocky:masterfrom
bluelhf:fix/script-runner-classloader

Conversation

@bluelhf
Copy link
Collaborator

@bluelhf bluelhf commented Dec 29, 2025

Currently, compiling scripts to an executable .jar doesn't actually work, because the ScriptRunner implementation in the app uses the platform class loader instead of a Skript class loader. This PR fixes the issue by using Skript#loadScript with the bytes from the class file, which allows the Skript instance to load it with its own class loader instead of the platform class loader.

fixes #19

since Skript doesn't expose a class loader instance we use loadScript to use it implicitly
@Moderocky Moderocky merged commit fe5ca82 into Moderocky:master Dec 29, 2025
@bluelhf bluelhf deleted the fix/script-runner-classloader branch December 30, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiled jars throwing error and not running.

2 participants