Git Product home page Git Product logo

bootstraplauncher's People

Contributors

cpw avatar lexmanos avatar marchermans avatar matyrobbrt avatar sciwhiz12 avatar shartte avatar sizableshrimp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstraplauncher's Issues

Usernames and folder names that match the ignore list break loading

The folder name C:\Users\rasmussen\AppData\Roaming\.minecraft contains the string "asm" in it, and so all libraries in the minecraft library repository are ignored. As a result, forge can't load.

username

The error:
error

A workaround is creating a new account without "asm" in the name, but this is highly inconvenient for most people.

NoClassDefFoundError when bootstrap silently ignores packages with the same name in different jars

Description

When bootstrap loads a jar on the legacy classpath into its associated module layer, it pulls only packages that were not previously present in other, already loaded jars. If there are class files in both packages under the same name in separate modules, then the later package will be removed from the classpath, barring any usage from the removed class.

module A
    - package X
        - class I
        - class J
module B
    - package X // This package will not be loaded, preventing usage of R, S, T
        - class R
        - class S
        - class T

This typically does not cause any issues as most organizations tend to properly subdivide their libraries into separate groups such that packages are never duplicated. However, there are a few which take extra care to avoid conflicts, but still use the same packaging across different jars, forcing this issue to occur.

Example

Scala 3's library artifact is implemented in an uncommon way. Scala 3 requires the Scala 2 library as a dependency to use the common classes implemented, as a method of interoperability between major versions, while anything new is added in the Scala 3 library. The standard libraries within these artifacts are located in the scala package. As such, most of the Scala 2 standard library is unable to be accessed, throwing a NoClassDefFoundError.

Scala 3 library: org.scala-lang:scala3-library_3:3.2.0
Scala 2 library: org.scala-lang:scala-library:2.13.8

There are a number of other classes within the scala libraries that share the same packages, but for the purposes of this explanation, we will only mention one.

You can view an implementation of the issue here. This will throw a NoClassDefFoundError for scala.Option as it was removed by bootstrap due to the scala 3 library module being loaded first.

Further Work

If bootstraplauncher chooses to not fix the issue, then there needs to be some reporting when a package is removed which contained associated classes, or simply crash if two classes contain the same package with class files within them. I only discovered the issue due to some help from @SizableShrimp who knew some inner workings of ForgeGradle and the mod launcher.

IllegalArgumentException: Invalid module name

When I run BootstrapLauncher.main(...);, this error gets printed to the console:

Exception in thread "main" java.lang.IllegalArgumentException: : Invalid module name: '' is not a Java identifier
	at java.base/jdk.internal.module.Checks.requireModuleName(Checks.java:59)
	at java.base/java.lang.module.ModuleDescriptor$Builder.<init>(ModuleDescriptor.java:1515)
	at java.base/java.lang.module.ModuleDescriptor.newAutomaticModule(ModuleDescriptor.java:2395)
	at cpw.mods.jarhandling.impl.SimpleJarMetadata.descriptor(SimpleJarMetadata.java:13)
	at cpw.mods.jarhandling.impl.Jar.computeDescriptor(Jar.java:47)
	at cpw.mods.cl.JarModuleFinder$JarModuleReference.<init>(JarModuleFinder.java:50)
	at cpw.mods.cl.JarModuleFinder.lambda$new$0(JarModuleFinder.java:28)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at cpw.mods.cl.JarModuleFinder.<init>(JarModuleFinder.java:29)
	at cpw.mods.cl.JarModuleFinder.of(JarModuleFinder.java:43)
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:81)
	at com.blockypenguin.barrelmc.launch.Launch.main(Launch.java:9)

I assumed that it was on about my code not being in a module, and when I tried fixing that, I was unable to access BootstrapLauncher due to its module-info.java not exporting anything, so I'm probably wrong there. What should I do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.