swiftlang/swift-java

Failure: java.lang.NoClassDefFoundError when trying to use Java class in Swift

Closed this issue · 1 comments

After going through example in quadratic sieve I wanted to replicate such approach using my own simple class. I created java class, makefile, SPM config.
theoretically after running make, it creates wrapper in generated files in build. but in runtime it can't find jar file, thus java class. How I can pass jar path to sum target?
JavaExample.zip

java version "24.0.1" 2025-04-15
Java(TM) SE Runtime Environment (build 24.0.1+9-30)
Java HotSpot(TM) 64-Bit Server VM (build 24.0.1+9-30, mixed mode, sharing)

Xcode Version 26.0 beta (17A5241e)

Ok, you can add class path to static method for Java machine. I think it should be in docs pointed out prominently :)