Migrating java application from Java 8 to Java 11
Asked Answered
B

1

6

Advance thanks, who are be going to help me.

Story: till date my application is using JDK8, but right now I am migrating my application to Open JDK11 and using IVY as dependency manager and Ant as a build tool.

Problem: I was facing compile-time issues in eclipse for javax, but then I change JRE lib in the build path, from classpath to Modulepath. Now everything is working fine. But now the main problem is, while running antbuild.xml using Ant, this still giving me the same compile-time errors. I think I know what to do now, but how to do I don't know. I have to add Open JDK11 as module path somewhere in antbuild.xml.

Main Question: How to set Open JDK11 as module path in antbuild.xml (BASICALLY ANT BUILD FILE).

if the question is still not understandable, please let me know.

Bili answered 2/5, 2019 at 6:9 Comment(0)
B
2

After 11 months I am able to post the answer because I understand the actual problem and now I have a solution that I implement in my project and its working flawlessly, all the compile-time errors are fixed.

What solution I implement.

  • Open project in eclipse, Eclipse latest version mine is 2019-06 build
  • Right-click on project > properties > Java build path
  • From classpath remove Java 8 and above it, you will find Modulepath
  • Click on Modulepath then Add Library from right button pane
  • Now a dialog will open select JRE System Library press Next Button
  • Now you can select Installed JREs.. button to add the new version of java
  • Press Add button from Installed JREs dialog
  • Select Standard VM > press Next button.
  • Now Select JRE Home from your filesystem make sure you select path up to bin, not bin
  • Finish and apply all Changes
  • Now Let eclipse build the project, of course, you will have errors.

Reason for this problem

See Java changes its file structure, so a lot of packages moved here and there. Some new packages are used, some got replaced and renamed.

So the basic problem is just this.


Solution That We can implement to resolve compile-time errors

  • Open file which has errors, and sees which import is creating error, copies the file name which is not available, or not have error
  • press Ctrl + shift + t, paste file name and see which possible options now we have, actually now we have more than one lib which is providing the same class implementation. so now we have to choose one and remove another dependency from the dependency manager.
  • Now we have to add some more dependencies to support our code.
  • Clean the redundant dependency.
  • Now we just have to resolve the compile-time errors. that the solution we can do.

This solution helped me. If you are facing the same issue, please connected me, I might help you with this.

Bili answered 8/4, 2020 at 5:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.