question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Thinking about a post Java 8 world

See original GitHub issue

Thinking about a post Java 8 world

It seems quite likely that minecraft will recieve an update of Java in the near future. The latest version of the launcher has support for alternate Java versions, and the latest snapshot dropped support for the old GPUs that were forcing the use of an ancient version of Java 8.

My guess is Java 16 will be the target, mainly due to having some neat features that I can see Mojang wanting to make use of, most notably records.

This issue is just a place to gather thoughts / be a todo list of what would would need to required to get the whole fabric toolchain updated to support this. In someways most of the work has already been done over time. Moving our CI/CD setup to github actions means we already test, build and release from Java 15. (While targeting Java 8)

A lot of the following items in the “todo list” assumes that records are being used as this is where most of the work left is. The following list is somewhat in order of what would need to be done, however some of the tasks can be done independently of each other, or even at a later date.

Items with a 🔍 emoji might already be done/need investigating.

Record mapping

  • Record fields and methods should be mapped as usual. Record components can just be based off the field names and reuse the field javadoc. This removes the need to update the mapping format and removes the pain with V1.

  • Tiny remapper and friends will need updating to support this.

Yarn/Intermediary

This section contains what would need to be done to get Yarn/Intermediary working.

  • Matcher
    • Support the above record changes.
    • Support matching records 🔍
  • Stitch
    • Jar Merging - Used by Loom and Yarn
    • Remove/dont update: Intermediary gen/updating as matcher can do this.
  • Engima
    • Add support for records in the mapping format
    • 🔍 Check record remapping, I did brefily check this a while back and it seemed ok on the surface. I imagine the saving/loading will be missing.
  • Intermediary
    • Should generate the same field and method names for record components, comp_x?
  • Yarn
    • Should be quite easy once all the tools/libs are in place, just update them in the build.gradle
      • Should be able to build and remap a namedJar before releasing intermediary or yarn!

Fabric Loader

  • Should just work in theory?
  • Might have issues with a mismatching guava version assuming that gets updated at the time time
  • Java 8 support should be kept here for the foreseeable future for older minecraft versions and other games.

Loom

  • New branch
  • Bump to build against J16 and Gradle 7 (Required for J16)

Fabric API

  • Should be quite simple in theory, Just update loom / Target J16
  • Modules? - Should not be forced onto modders.

Access Widener

  • Sealed Classes support? Easy to do, still in preview so prob unlikely its being used.

There are going to be quite a few unforseen issues ontop of this, but I dont believe I have missed anything major. This clearly will take some time to handle, but it doesnt need to be perfect on the first go, we target snapshots so we have time to break things.

Feel free to point out stuff I’ve missed/provide ideas on things this is just what I have in my head.

PRs working to support this:

fabric-loom : Javadoc support for records intellij-fernflower : pulls in upstream changes containg a number of useful fixes.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:26 (23 by maintainers)

github_iconTop GitHub Comments

2reactions
modmuss50commented, May 19, 2021

Preview features wont be enabled, there is little to gain in j16 with them.

1reaction
sfPlayer1commented, Jun 24, 2021

More precisely MC doesn’t appear to use any Java 16 feature yet, it looks like Java 8 code built with Javac 16. So the breakage is yet to come 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Life After Java 8 - YouTube
Adopt the right emerging trends to solve your complex engineering challenges at QCon London March 27-29, 2023. Get practical inspiration and ...
Read more >
Life After Java 8 - InfoQ
Gil Tene looks at the realities of Life after 8. He discusses the rate of change, the current Java ecosystem, and the implications...
Read more >
Jabel brings post-Java 8 features to Java 8 users - InfoWorld
Basically, Jabel tricks the compiler into thinking that certain features were developed for Java 8 by removing the checks that report them as ......
Read more >
Java 8 Features with Examples - DigitalOcean
Let's look at all the exciting and major features of Java 8 with example ... You can think of it like @Override annotation...
Read more >
Think Functional With Java 8 - Oracle Blogs
Want to master parallel programming in Java 8? The syntax of Lambda Expressions is fairly simple. How Lambdas and the Streams work together ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found