You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modules may need to use some external library in the form of a JAR file. While talking with Chris, we tried merging an external JAR with the module JAR such that all .class files are in the same JAR (just like Janeway includes Gson). This didn't work, we got a NoClassDefFoundError when Janeway tries to load the module.
I think what's happening is that the module is compiled with the expectation that the external classes will be found in the external JAR that's on the classpath at runtime. Possible solutions:
Just get the external source, copy into your src directory, that should work (obviously not feasible for some libraries)
Copy .class files from external JAR into build directory before running javac. Don't include the external JAR on the classpath. Maybe when javac runs, it will just "link" against the existing .class files in the build directory?
Maybe the original solution is wrong in some subtle way (maybe we need some way to say "you will find the .class files from the external JAR sitting next to you in the same JAR at runtime")?
Modify how modules are loaded in Janeway - maybe something is subtly wrong there, or we need some way to explicitly load dependencies.
At the moment, it seems like the only solution is to include the external JAR in the same way that Janeway includes the Gson JAR. This breaks modularity and requires developers to modify the Janeway buildfile, but it's the fastest way to get something working for Friday.
The text was updated successfully, but these errors were encountered:
Modules may need to use some external library in the form of a JAR file. While talking with Chris, we tried merging an external JAR with the module JAR such that all .class files are in the same JAR (just like Janeway includes Gson). This didn't work, we got a NoClassDefFoundError when Janeway tries to load the module.
This looks like what we were trying to do, but it didn't work: http://www.knowledgetip.com/index.php/home/software-development/1-java/42-externaljarsant
I think what's happening is that the module is compiled with the expectation that the external classes will be found in the external JAR that's on the classpath at runtime. Possible solutions:
At the moment, it seems like the only solution is to include the external JAR in the same way that Janeway includes the Gson JAR. This breaks modularity and requires developers to modify the Janeway buildfile, but it's the fastest way to get something working for Friday.
The text was updated successfully, but these errors were encountered: