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

Parse jar index when using SCC #740

Merged
merged 1 commit into from
Mar 22, 2024
Merged

Conversation

hangshao0
Copy link
Contributor

@hangshao0 hangshao0 commented Mar 20, 2024

If a jarIndex exists, the JDK by default (i.e. SCC is off) uses the URLs in the JarIndex to search for resources, the class path in manifest is ignored.

However, when SCC is on, the jarIndex is always ignored and the class path in manifest is used, which differs from the default JDK behavior.

Change SCC code in URLClassPath to always use URLs in jarIndex if it exists.

Add a property "com.ibm.oti.shared.disableJarIndex" that can be used to control the behavior.

JarIndex is removed in Java 21, no need to port to Java 21+.

port of ibmruntimes/openj9-openjdk-jdk17#331

Internal issue semeru-runtimes/issues/1

@pshipton
Copy link
Member

jenkins test sanity,extended alinux jdk8

@pshipton
Copy link
Member

17:18:17  /home/jenkins/workspace/Build_JDK8_aarch64_linux_Personal/jdk/src/share/classes/sun/misc/URLClassPath.java:109: error: cannot find symbol
17:18:17          DISABLE_JAR_INDEX = p != null ? p.equals("true") || p.isEmpty() : false;    //OpenJ9-shared_classes_misc
17:18:17          ^
17:18:17    symbol:   variable DISABLE_JAR_INDEX
17:18:17    location: class URLClassPath
17:18:17  /home/jenkins/workspace/Build_JDK8_aarch64_linux_Personal/jdk/src/share/classes/sun/misc/URLClassPath.java:1330: error: cannot find symbol
17:18:17              if (usingSharedClasses && !DISABLE_JAR_INDEX) {                                               //OpenJ9-shared_classes_misc
17:18:17                                         ^
17:18:17    symbol:   variable DISABLE_JAR_INDEX
17:18:17    location: class JarLoader

If a jarIndex exists, the JDK by default (i.e. SCC is off) uses the URLs
in the JarIndex to search for resources, the class path in manifest is
ignored.

However, when SCC is on, the jarIndex is always ignored and the class
path in manifest is used, which differs from the default JDK behavior.

Change SCC code in URLClassPath to always use URLs in jarIndex if it
exists.

Add a property "com.ibm.oti.shared.disableJarIndex" that can be used to
control the behavior.

JarIndex is removed in Java 21, no need to port to Java 21+.

Internal issue semeru-runtimes/issues/1

Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
@hangshao0
Copy link
Contributor Author

jenkins test sanity,extended alinux jdk8

@hangshao0
Copy link
Contributor Author

PR builds passed.

@pshipton pshipton merged commit a92e628 into ibmruntimes:openj9 Mar 22, 2024
6 checks passed
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.

2 participants