-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java 9 module support #39
Comments
I haven't used Java 9 modules yet but that's first hit that I get. Is there another module where you require the same packages? |
I don't think so. I have strictly only one class in this test project, the Test class, and only one dependency, ejml. The 8 jar files are in ModulePath of the project. With only ejml.core and ejml.ddense, it works, but if I add ejml.cdense, it doesn't work anymore Thanks |
I hope that's not the case. Would require a lot code breaking changes and result in a less consistent package layout. Plus a ton of other libraries would not be Java 9 modules compatible. Could you hack around it by converting everything into a single jar? |
Yes it work. |
Hi, The solution consists in using unique package names across the modules of the library. Is it possible for @lessthanoptimal to do it? |
This might happen, but not in the next release. In the past massive API breaking refactorings have caused a a splinter that takes a 2+ years to resolve as no one wants to update when every function call is broken. Last time I provided a script that did about 80% of the work. Not sure anyone used it or not. I was forced to attempt to create a small Module based project recently. Couldn't get it to work the proper way and ended up "disabling" Modules, but I did learn a bit more about Modules. There does seem to be command line arguments that you can pass to javac and java that enable you to include a non-Module API. I also wonder if I can provide identical |
Hi, I have played now with modules as well and actually, the only drawback in EJML is that the Jars in Maven Central have some common packages aka split packages which is very painful. As @dev-sce mentioned, having a single JAR containing everything would help. So I see the complexity and the work involved. In order to lets say, slowly remove some blockings w/o disturbing long time users, following proposal:
Making EJML compatible with Java modules does not necessarily require to move to modules. This would also keep the required work at minimum. What do you thing @lessthanoptimal? I could help you with that. |
Since Android now allows for Java 11 byte code I was thinking of changing the minimum version to 11, where it will probably stay for a long time. So this is probably a good time to revisit modules. I've still yet to create a module project, but everything you've said seems to make sense and would be a good first pass. |
Hi @lessthanoptimal, happy new year at first! I'd be open and willing to create a PR for step 1, for creating an artifact called Regards! |
Sounds like a great plan. |
Hello,
Is it possible to add java 9 module support to ejml.
For the moment, if I create a module:
module EjmlTest {
requires ejml.core;
requires ejml.cdense;
requires ejml.ddense;
requires ejml.fdense;
requires ejml.dsparse;
requires ejml.experimental;
requires ejml.simple;
requires ejml.zdense;
}
with a sample test:
package test;
import org.ejml.data.DMatrix3x3;
public class Test {
public static void main(String[] args) {
DMatrix3x3 a = new DMatrix3x3();
a.print();
}
}
I get the following error message:
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules ejml.ddense and ejml.experimental export package org.ejml.dense.row.decomposition.lu to module EjmlTest
Thanks!
The text was updated successfully, but these errors were encountered: