Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Clarification on --patch-module and --limit-modules(Trying to replace a a JDK module with my own, and rely on that in other projects.)
Clarification on --patch-module and --limit-modules [message #1782147] Mon, 19 February 2018 13:42 Go to next message
Nir Lisker is currently offline Nir LiskerFriend
Messages: 9
Registered: November 2012
Junior Member
Suppose I'm working on the JDK module javafx.base. I have a JDK 9+ installed. I copied the source of javafx.base and added a class MyClass.java to it. The project of javafx.base compiles and builds correctly and MyClass.class is present in the bin directory.

I want to replace the JDK javafx.base with my javafx.base and use MyClass in a different project "test" with module name "com.test" that "requires javafx.base". Here's what I did and the results:

* I added my javafx.base project to the modulepath above the JDK. The result was a compilation error for not being able to resolve MyClass. Makes sense because of conflicting modules.

* I went to the JDK entry in the modulepath and excluded all javafx modules. That resolved the compilation error. During runtime, I got a NoClassDefFoundError for MyClass. If --limit-modules is a compile-time only option then this makes sense.

* I went to my javafx.base and under the JDK entry I patched javafx.base. I hoped that this will replace the JDK module with my module. Same runtime error.

* I went back to my test project and tried to remove the limit modules from the JDK in case it was limiting my javafx.base which now patches the JDK one. The result was again compilation error of not being able to resolve MyClass. I find it weird because --patch-module should work at compile time.

My runtime classpath under Run Configuration includes my javafx.base under User Entries. I can add or remove a JDK entry there but there's no difference.

To summarize:
How do I make my javafx.base available at runtime instead of the one in the JDK?
How do --patch and --limit interact? Isn't patching a module enough to resolve conflicts without limiting? Does limiting a patched module limit the patching module as well?
Re: Clarification on --patch-module and --limit-modules [message #1782173 is a reply to message #1782147] Tue, 20 February 2018 04:43 Go to previous messageGo to next message
Sarika Sinha is currently offline Sarika SinhaFriend
Messages: 65
Registered: February 2010
Location: Bangalore, India
Member
Which Eclipse version are you using?
Eclipse Photon M5 onwards (https://bugs.eclipse.org/bugs/show_bug.cgi?id=525253), the properties like --patch-module, --limit-module etc set in Build path propagates to launching.
You can use the newer Eclipse version or you need to set these properties while launching under VM Arguments.


Sarika Sinha
JDT Programmer
Re: Clarification on --patch-module and --limit-modules [message #1782180 is a reply to message #1782173] Tue, 20 February 2018 09:17 Go to previous messageGo to next message
Nir Lisker is currently offline Nir LiskerFriend
Messages: 9
Registered: November 2012
Junior Member
I'm using Photon M5.
Re: Clarification on --patch-module and --limit-modules [message #1782256 is a reply to message #1782173] Wed, 21 February 2018 01:04 Go to previous messageGo to next message
Nir Lisker is currently offline Nir LiskerFriend
Messages: 9
Registered: November 2012
Junior Member
I don't see where the option discussed in Bug 522554 is located. I also don't understand if the behavior I described is intended or not.
Re: Clarification on --patch-module and --limit-modules [message #1782263 is a reply to message #1782256] Wed, 21 February 2018 05:47 Go to previous message
Sarika Sinha is currently offline Sarika SinhaFriend
Messages: 65
Registered: February 2010
Location: Bangalore, India
Member
You can see the options described in N&N https://www.eclipse.org/eclipse/news/4.8/M5/#JDT

You can verify if your options being set in the build path is taken during launch or not. If you are still facing an issue. Please create a new bug.


Sarika Sinha
JDT Programmer
Previous Topic:Can't start Eclipse
Next Topic:I Can't Launch "Eclipse IDE for Java Developers" Normaly
Goto Forum:
  


Current Time: Sun Jun 24 09:32:06 GMT 2018

Powered by FUDForum. Page generated in 0.02063 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top