# ApplicationBaseGLFWGL3 (ClassNotFoundException)

**URL:** <https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613>\
**Category:** Installation and setup\
**Created:** [November 29, 2023, 3:53pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613 "2023-11-29T15:53:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericydauenhauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/ericydauenhauer/32/668_2.png) [@ericydauenhauer](https://openrndr.discourse.group/u/ericydauenhauer)\
**Post date:** [November 29, 2023, 3:53pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/1 "2023-11-29T15:53:26Z")

</div>

This is essentially a self-help guide for an issue that mysteriously popped up for me in the past month. If the moderators would prefer this to be moved to StackOverflow, I’m happy to do so.

## Background

I have used OPENRNDR for a few years on both Intel and Apple Silicon chips and it has always worked great. I am currently using a setup that is extremely similar to the openrndr-template. Recently for no apparent reason (no OS updates, no dependency updates, no configuration updates), I started getting this error trying to run any OPENRNDR sketch:

```auto
/Users/eric/Library/Java/JavaVirtualMachines/azul-13.0.14/Contents/Home/bin/java [...elided for clarity]
Warning: Running on macOS without -XstartOnFirstThread JVM argument. Restarting JVM with -XstartOnFirstThread.
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.

│ sketch.S55_Synthesizer1Kt.main(S55_Synthesizer1.kt:-1)
├─ sketch.S55_Synthesizer1Kt.main(S55_Synthesizer1.kt:25)
│ org.openrndr.ApplicationBuilderKt.application(ApplicationBuilder.kt:86)
│ org.openrndr.ApplicationBuilderJVM.<init>(ApplicationBuilder.kt:106)
│ org.openrndr.ApplicationBase.Companion.initialize(ApplicationBase.kt:21)
│ org.openrndr.ApplicationBase.Companion.loadApplicationBase(ApplicationBase.kt:36)
├─ java.lang.ClassLoader.loadClass(ClassLoader.java:522)
├─ jdk.internal.loader.ClassLoaders.AppClassLoader.loadClass(ClassLoaders.java:178)
├─ jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
│
↑ org.openrndr.internal.gl3.ApplicationBaseGLFWGL3 (ClassNotFoundException) 

Process finished with exit code 0

```

Where `S55_Synthesizer1` is the name of the file I was trying to run. It wasn’t clear to me why something wouldn’t be on the classpath, but I inspected closely and determined it was a line from OPENRNDR causing the issue, because I didn’t have `org.openrndr.internal.gl3` on my classpath.

I have to assume something changed in my computer’s GL library, I’m not sure, I’ve never touched that.

## The fix

I had to just change 3 lines in my `build.gradle.kts` file to fix the issue.

1. Remove [this line](https://github.com/openrndr/openrndr-template/blob/d97e80c903f55765c63c20951fe79abcb5f191d9/build.gradle.kts#L164)
2. Change [these two lines](https://github.com/openrndr/openrndr-template/blob/d97e80c903f55765c63c20951fe79abcb5f191d9/build.gradle.kts#L286-L287) from

```kts
runtimeOnly(openrndr("gl3"))
runtimeOnly(openrndrNatives("gl3"))

```

to

```kts
implementation(openrndr("gl3"))
implementation(openrndrNatives("gl3"))

```

I didn’t test all of these changes independently, so it is possible only one of these changes is required.

Then, I rebuilt my Gradle project, and now the OPENRNDR applications run as expected. I hope this is useful for someone else.

---

<div class="post-metadata">

**Author:** ![ericydauenhauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/ericydauenhauer/32/668_2.png) [@ericydauenhauer](https://openrndr.discourse.group/u/ericydauenhauer)\
**Post date:** [November 29, 2023, 3:53pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/2 "2023-11-29T15:53:56Z")

</div>

Discourse limited the number of links I could post in the OP, but this is the line that was causing the issue in the OPENRNDR application

> <https://github.com/openrndr/openrndr/blob/e8cbe4361e868e03f6c4219c6b34eaec952d74d9/openrndr-application/src/jvmMain/kotlin/org/openrndr/ApplicationBase.kt#L36>

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [November 29, 2023, 5:10pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/3 "2023-11-29T17:10:40Z")

</div>

Hi! Thanks a lot for taking the time to share your discovery! 👍 🙂

I’ll mention it in Slack in case something needs to be updated.

And welcome to the forum 😉

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [November 29, 2023, 5:21pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/4 "2023-11-29T17:21:38Z")

</div>

I was wondering… what if you clone the `openrndr-template` and try `./gradlew run` there? does it work without any changes?

---

<div class="post-metadata">

**Author:** ![ericydauenhauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/ericydauenhauer/32/668_2.png) [@ericydauenhauer](https://openrndr.discourse.group/u/ericydauenhauer)\
**Post date:** [November 29, 2023, 9:29pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/5 "2023-11-29T21:29:55Z")

</div>

Hm, strangely cloning openrndr-template and running `./gradlew run` works just fine. This definitely makes me think I mistakenly touched something fragile in my repo, but I’m not sure what. Almost certainly user error 🙂

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [November 30, 2023, 9:00am UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/6 "2023-11-30T09:00:33Z")

</div>

What if you clone your own project in a new folder and try to build it without the changes you just did? I’ve seen sometimes funny behavior with something odd being cached in Idea… (in case it’s related to Gradle / Idea and not your code).

---

<div class="post-metadata">

**Author:** ![ericydauenhauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/ericydauenhauer/32/668_2.png) [@ericydauenhauer](https://openrndr.discourse.group/u/ericydauenhauer)\
**Post date:** [November 30, 2023, 8:58pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/7 "2023-11-30T20:58:01Z")

</div>

Well. That’s disappointing. Re-cloning my own project builds just fine. I guess you’re correct that it was a Gradle/Idea caching issue rather than an issue with the template or configuration.

Sorry to raise this issue, although perhaps it will still help someone else if this pops up. Thank you for the thorough replies and help!

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [December 1, 2023, 1:07pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/8 "2023-12-01T13:07:57Z")

</div>

No need to be sorry. It’s very valuable to know that this can happen.

It’s a pity that it’s not easy to reproduce so we could tell the JB / Gradle people about it. It’s not even easy to write a “if X happens” post because I think X can manifest in various ways, not always with the same error message 😞

I any case great that it’s back working for you! 🥳

---

<div class="post-metadata">

**Author:** ![camrawne](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@camrawne](https://openrndr.discourse.group/u/camrawne)\
**Post date:** [January 18, 2024, 5:28am UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/9 "2024-01-18T05:28:05Z")

</div>

I’m seeing this issue as well. Is there an easy way to fix other than re-cloning? I’ve tried `File > Invalidate Caches` in Idea and manually deleting the gradle cache folder in `~/.gradle/caches`, both to no avail.

---

<div class="post-metadata">

**Author:** ![ericydauenhauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/ericydauenhauer/32/668_2.png) [@ericydauenhauer](https://openrndr.discourse.group/u/ericydauenhauer)\
**Post date:** [January 18, 2024, 5:04pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/10 "2024-01-18T17:04:05Z")

</div>

The solution I posted in the OP did work for me, under the heading “The fix”

Ultimately I chose to re-clone because I wasn’t really sure what was the implication of the changes I was making to the build.gradle.kts, and I didn’t want to cause other unintended consequences

---

<div class="post-metadata">

**Author:** ![camrawne](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@camrawne](https://openrndr.discourse.group/u/camrawne)\
**Post date:** [June 30, 2024, 3:27pm UTC](https://openrndr.discourse.group/t/applicationbaseglfwgl3-classnotfoundexception/613/11 "2024-06-30T15:27:23Z")

</div>

An update on this problem in case other people keep running into it (because I keep running into it): I solved it recently by closing Idea and deleting the (`.gradle`, `.idea`, and `build`) folders, and reopening. Idea will take a while to set stuff up like you’re opening it for the first time and re-create those folders. This to me is easier than re-cloning and moving everything over. I’m also sure I only needed to delete one of those folders, so next time this happens I’ll experiment one by one.

Also in terms of reproduction steps: I left Idea open and put my computer to sleep, and when it woke up this morning it wasn’t working.
