I'm using intellij idea ide and when I try to run my libgdx project as desktop application I get this message.
Exception in thread "main" java.lang.ClassNotFoundException: com.nivekbryan.labirint.desktop.DesktopLauncher
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
I had a same problem so i fixed with this solution. Basically compiler is not getting DesktopLauncher class, so you need to run the task through gradle this way:
Look for the Gradle panel in the IDE,
you only need to do this the first time for launch DesktopLauncher class after that you will not get this exception.
I hope it will work for you, cheers.