neoforged / MDK

The Mod Developer Kit - this is where you start if you want to develop a new mod
https://github.com/NeoForgeMDKs
193 stars 59 forks source link

Restrict toolchain vendor to `ADOPTIUM` #16

Open teddyxlandlee opened 1 year ago

teddyxlandlee commented 1 year ago

I am an IBM Semeru user and when I tried to ./gradlew build the MDK I stuck at neoFormRecompile, where the compiler failed to find the jdk.jfr package.

Since all Neo projects need to do the recompile process, the toolchain vendor should be restricted, at least out of the J9 implementation, to prevent beginners stuck at the same point as me.

What I tried to do is to remove all the caches and then add a line in build.gradle:

java.toolchain.vendor = JvmVendorSpec.ADOPTIUM

and it worked.

Many Thanks.

UpcraftLP commented 9 months ago

If a specific vendor is to be enforced, it should be microsoft, since this is what Mojang ships with the game by default.

UpcraftLP commented 9 months ago

~~However, it is possible to only specify the implementation, not the vendor. I will make a PR with that.~~

EDIT: seems like gradle only allows switching between "any" and "openJ9" :/

lukebemish commented 8 months ago

EDIT: seems like gradle only allows switching between "any" and "openJ9" :/

You're thinking JvmImplementation, which can be J9 or VENDOR_SPECIFIC. Specifying the vendor uses the line in the initial issue, and can be set to any number of different things - and will get correctly resolved so long as the foojay settings plugin is applied. To set it to microsoft, you'd use:

java.toolchain.vendor = JvmVendorSpec.MICROSOFT

That said - the real solution here is to avoid needing a full decomp/recomp cycle to set up the local environment!

UpcraftLP commented 8 months ago

You're thinking JvmImplementation, which can be J9 or VENDOR_SPECIFIC

Yes, exactly what I said. Gradle does not currently allow specifying HOTSPOT or not OpenJ9 as JvmImplementation.



the real solution here is to avoid needing a full decomp/recomp cycle to set up the local environment!

that is true, but in absence of someone making that PR, the quickest 'fix' is to at least provide a better error message.

lukebemish commented 8 months ago

It allows specifying "openj9" or "whatever" for implementation, yes, but it also allows specifying vendor - so just specify Microsoft as the vendor and you'll get their openjdk - the "vendor specific" implementation for Microsoft is hotspot