Skip to content
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

Fix library managment for Java 9 #652

Merged
merged 2 commits into from Dec 30, 2017
Merged

Fix library managment for Java 9 #652

merged 2 commits into from Dec 30, 2017

Conversation

@hibo98
Copy link
Member

@hibo98 hibo98 commented Dec 29, 2017

The ClassPathAgent starts before the GlowServer and saves the Instrumentation for future use. (This Works only as of Java 9) The LibraryManager uses as of Java 9 the ClassPathAgent to add jars to the classpath.

Test with Oracle and OpenJDK 8+9

} catch (ReflectiveOperationException | MalformedURLException e) {
String[] javaVersion = System.getProperty("java.version").split("\\.");
if (Integer.parseInt(javaVersion[0]) >= 9) {
ClassPathAgent.addJarFile(new JarFile(file));

This comment has been minimized.

@smartboyathome

smartboyathome Dec 29, 2017
Contributor

Looks like the specific instrumentation method that ClassPathAgent uses can be used with Java 8 and below. Why not just use that there?

This comment has been minimized.

@hibo98

hibo98 Dec 29, 2017
Author Member

But I have the problem that Laucher-Agents don't work with Java 8

This comment has been minimized.

@smartboyathome

smartboyathome Dec 29, 2017
Contributor

You're right, its not explicitly called out anywhere that I can see, but I can see Launcher-Agent-Class included in the doc page for Java 9 but not for Java 8.

@hibo98 hibo98 changed the title [WIP] Fix library managment for Java 9 Fix library managment for Java 9 Dec 29, 2017
@Pr0methean
Copy link
Contributor

@Pr0methean Pr0methean commented Dec 30, 2017

I've tested this in combined staging with my own pending PRs, and it seems to work fine.

@Pr0methean Pr0methean merged commit 536305c into GlowstoneMC:dev Dec 30, 2017
2 checks passed
2 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.