Skip to content

private -> public #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

private -> public #19

wants to merge 1 commit into from

Conversation

pisaiah
Copy link

@pisaiah pisaiah commented Mar 31, 2017

I need to call the launch(String[] args) method in Launch.class (What I'm doing fails when using main()) but I can't because its set to private.

I would just package the jar with a modified launchwrapper, but I don't what to because of #1

@liach
Copy link

liach commented Mar 31, 2017

How did you get the instance of Launch?

@LexManos
Copy link
Contributor

Why? What are you doing?

@pisaiah
Copy link
Author

pisaiah commented Mar 31, 2017

I'm trying to do https://pastebin.com/PAmCYByq witch needs Launch#launch(String[] args) to load.

I've tryed doing what everyone says to do and use refection and use Method#setAccessible(true);
but I get java.lang.IllegalAccessException: class JavaNineLaunch cannot access a member of class net.minecraft.launchwrapper.Launch with modifiers "private"

@LexManos
Copy link
Contributor

This doesn't answer my questions. What beyond "i'm trying to call this method because i wan't to call this method" are you trying to do?

@liach
Copy link

liach commented Mar 31, 2017

@IsaiahPatton Use Launch.main(String[] args) instead. :trollface:

@pisaiah
Copy link
Author

pisaiah commented Mar 31, 2017

I'm trying to add Java 9 support (#11) to what I'm making, I can't use Launch.main(String[] args) because that calls code I'm trying to override.

@LexManos
Copy link
Contributor

There is a reason why the simple hack fix was not accepted. It will explode in various other systems.
A proper replacement is in the works, but it won't be what you see here right now.
If you want to hack around internally with J9 you can, reflection would be the way to go.
Haven't looked into it so im not sure why yours isn't working. But it should work fine as long as you have proper security access.

@pisaiah pisaiah closed this Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants