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.
精彩评论