Class SelfAttach

java.lang.Object
net.neoforged.fml.startup.SelfAttach

public class SelfAttach extends Object
Used out-of-process to attach our agent to the current VM. Please red JEP to understand that this will likely be disabled in a future LTS of Java, but at the time this Javadoc is written, it still works on Java 21 and 25. https://openjdk.org/jeps/451

We expect the ecosystem to allow for easier attachment of agents via the intended way (command-line) by then.

  • Constructor Details

    • SelfAttach

      public SelfAttach()
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception
    • getClassPathItem

      public static String getClassPathItem()
      Gets a Java class-path item that allows the JVM to load this class.