perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

Exception in thread "main" java.lang.NoClassDefFoundError: spark/Route #1268

Open heav-4 opened 1 year ago

heav-4 commented 1 year ago

i'm trying to run old software (2015ish) that is made using spark.

  Exception in thread "main" java.lang.NoClassDefFoundError: spark/Route
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:488)
      at java.base/java.lang.Class.forName(Class.java:467)
      at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
  Caused by: java.lang.ClassNotFoundException: spark.Route
      at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      ... 4 more
lepe commented 1 year ago

My guess is that your class path or the way you are compiling your project is mistaken. The class spark.Route should exists (just check in your dependencies or external libraries).