开发者

using scala jar from java project in NetBeans

开发者 https://www.devze.com 2023-01-04 05:13 出处:网络
I\'m developing a scala library, which I would like to be used by java applications. If I set up a java project in netbeans, with a reference to the scala library (jar), I can compile the java projec

I'm developing a scala library, which I would like to be used by java applications.

If I set up a java project in netbeans, with a reference to the scala library (jar), I can compile the java project without errors.

However I get problems when running the java project directly from netbeans (code from scala library is not executed e.g. for scala object methods), while when running it without ant (directly with开发者_StackOverflow中文版 java -jar .... on the command line in the /dist folder) everything works.

Does anyone have an idea why?

Boris


Without more information, it's impossible to say for sure. However, one possibility leaps immediately to mind: Your Scala library is using Scala types. If you don't have scala-library.jar in your Java programs' classpaths, they won't be able to use the Scala classes in your library.

0

精彩评论

暂无评论...
验证码 换一张
取 消