JRE fatal error after shrinking with Proguard












0















I'm bundling the JRE with my JavaFX application on Mac using gradle-macappbundle. I'm trying to reduce the size of the JRE so I don't have to include the full ~200 MB. I have followed the instructions in the Java8 README to remove some optional components.



After the macappbundle plugin creates the .app, I want to run Proguard on the JRE(I'm using the gradle plugin for it) to remove even more unused classes.



My current proguard rules:



task shrinkJRE(type: ProGuardTask, dependsOn: 'createApp') {
injars "build/macApp/"
outjars "build/libs/pro/"

keep "class java.** { *; }"

ignorewarnings()
dontobfuscate()
dontoptimize()
}


This produces a JRE about 45 MB.



But after doing chmod +x on the JavaAppLauncher executable and running it, it shows this error:



#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000010c6025e4, pid=86901, tid=0x0000000000002303
#
# JRE version: (8.0_181-b13) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x5825e4] universe_post_init()+0x6a9
#
# Core dump written. Default location: /cores/core or core.86901
#
# An error report file with more information is saved as:
# /Users/rishiraja/hs_err_pid86901.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Abort trap: 6 (core dumped)


Could anyone help me find the cause of this error?



My guess is that I'm missing some required classes for the JRE, so what are some classes I might also need to "keep"?










share|improve this question























  • First of all, the license disallows to remove or change anything in JRE except Optional Files. Furthermore, JRE requires much more than just java.* classes, e.g. sun.*, com.sun.*, jdk.* etc.

    – apangin
    Nov 25 '18 at 12:18











  • As apangin said, you are not allowed to redistribute such a modified JRE. If it is only for your own environment, you’re wasting your time. The JVM loads most of the classes from the optimized archive classes.jsa (rt.jar could be replaced with an empty file), unless the jar files have a newer timestamp. See Class Data Sharing. Compare also with the documentation for newer versions which is more exhaustive about controlling the contained classes

    – Holger
    Nov 26 '18 at 11:57
















0















I'm bundling the JRE with my JavaFX application on Mac using gradle-macappbundle. I'm trying to reduce the size of the JRE so I don't have to include the full ~200 MB. I have followed the instructions in the Java8 README to remove some optional components.



After the macappbundle plugin creates the .app, I want to run Proguard on the JRE(I'm using the gradle plugin for it) to remove even more unused classes.



My current proguard rules:



task shrinkJRE(type: ProGuardTask, dependsOn: 'createApp') {
injars "build/macApp/"
outjars "build/libs/pro/"

keep "class java.** { *; }"

ignorewarnings()
dontobfuscate()
dontoptimize()
}


This produces a JRE about 45 MB.



But after doing chmod +x on the JavaAppLauncher executable and running it, it shows this error:



#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000010c6025e4, pid=86901, tid=0x0000000000002303
#
# JRE version: (8.0_181-b13) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x5825e4] universe_post_init()+0x6a9
#
# Core dump written. Default location: /cores/core or core.86901
#
# An error report file with more information is saved as:
# /Users/rishiraja/hs_err_pid86901.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Abort trap: 6 (core dumped)


Could anyone help me find the cause of this error?



My guess is that I'm missing some required classes for the JRE, so what are some classes I might also need to "keep"?










share|improve this question























  • First of all, the license disallows to remove or change anything in JRE except Optional Files. Furthermore, JRE requires much more than just java.* classes, e.g. sun.*, com.sun.*, jdk.* etc.

    – apangin
    Nov 25 '18 at 12:18











  • As apangin said, you are not allowed to redistribute such a modified JRE. If it is only for your own environment, you’re wasting your time. The JVM loads most of the classes from the optimized archive classes.jsa (rt.jar could be replaced with an empty file), unless the jar files have a newer timestamp. See Class Data Sharing. Compare also with the documentation for newer versions which is more exhaustive about controlling the contained classes

    – Holger
    Nov 26 '18 at 11:57














0












0








0








I'm bundling the JRE with my JavaFX application on Mac using gradle-macappbundle. I'm trying to reduce the size of the JRE so I don't have to include the full ~200 MB. I have followed the instructions in the Java8 README to remove some optional components.



After the macappbundle plugin creates the .app, I want to run Proguard on the JRE(I'm using the gradle plugin for it) to remove even more unused classes.



My current proguard rules:



task shrinkJRE(type: ProGuardTask, dependsOn: 'createApp') {
injars "build/macApp/"
outjars "build/libs/pro/"

keep "class java.** { *; }"

ignorewarnings()
dontobfuscate()
dontoptimize()
}


This produces a JRE about 45 MB.



But after doing chmod +x on the JavaAppLauncher executable and running it, it shows this error:



#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000010c6025e4, pid=86901, tid=0x0000000000002303
#
# JRE version: (8.0_181-b13) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x5825e4] universe_post_init()+0x6a9
#
# Core dump written. Default location: /cores/core or core.86901
#
# An error report file with more information is saved as:
# /Users/rishiraja/hs_err_pid86901.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Abort trap: 6 (core dumped)


Could anyone help me find the cause of this error?



My guess is that I'm missing some required classes for the JRE, so what are some classes I might also need to "keep"?










share|improve this question














I'm bundling the JRE with my JavaFX application on Mac using gradle-macappbundle. I'm trying to reduce the size of the JRE so I don't have to include the full ~200 MB. I have followed the instructions in the Java8 README to remove some optional components.



After the macappbundle plugin creates the .app, I want to run Proguard on the JRE(I'm using the gradle plugin for it) to remove even more unused classes.



My current proguard rules:



task shrinkJRE(type: ProGuardTask, dependsOn: 'createApp') {
injars "build/macApp/"
outjars "build/libs/pro/"

keep "class java.** { *; }"

ignorewarnings()
dontobfuscate()
dontoptimize()
}


This produces a JRE about 45 MB.



But after doing chmod +x on the JavaAppLauncher executable and running it, it shows this error:



#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000010c6025e4, pid=86901, tid=0x0000000000002303
#
# JRE version: (8.0_181-b13) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x5825e4] universe_post_init()+0x6a9
#
# Core dump written. Default location: /cores/core or core.86901
#
# An error report file with more information is saved as:
# /Users/rishiraja/hs_err_pid86901.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Abort trap: 6 (core dumped)


Could anyone help me find the cause of this error?



My guess is that I'm missing some required classes for the JRE, so what are some classes I might also need to "keep"?







java jvm proguard






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 24 '18 at 23:35









abcabc

171111




171111













  • First of all, the license disallows to remove or change anything in JRE except Optional Files. Furthermore, JRE requires much more than just java.* classes, e.g. sun.*, com.sun.*, jdk.* etc.

    – apangin
    Nov 25 '18 at 12:18











  • As apangin said, you are not allowed to redistribute such a modified JRE. If it is only for your own environment, you’re wasting your time. The JVM loads most of the classes from the optimized archive classes.jsa (rt.jar could be replaced with an empty file), unless the jar files have a newer timestamp. See Class Data Sharing. Compare also with the documentation for newer versions which is more exhaustive about controlling the contained classes

    – Holger
    Nov 26 '18 at 11:57



















  • First of all, the license disallows to remove or change anything in JRE except Optional Files. Furthermore, JRE requires much more than just java.* classes, e.g. sun.*, com.sun.*, jdk.* etc.

    – apangin
    Nov 25 '18 at 12:18











  • As apangin said, you are not allowed to redistribute such a modified JRE. If it is only for your own environment, you’re wasting your time. The JVM loads most of the classes from the optimized archive classes.jsa (rt.jar could be replaced with an empty file), unless the jar files have a newer timestamp. See Class Data Sharing. Compare also with the documentation for newer versions which is more exhaustive about controlling the contained classes

    – Holger
    Nov 26 '18 at 11:57

















First of all, the license disallows to remove or change anything in JRE except Optional Files. Furthermore, JRE requires much more than just java.* classes, e.g. sun.*, com.sun.*, jdk.* etc.

– apangin
Nov 25 '18 at 12:18





First of all, the license disallows to remove or change anything in JRE except Optional Files. Furthermore, JRE requires much more than just java.* classes, e.g. sun.*, com.sun.*, jdk.* etc.

– apangin
Nov 25 '18 at 12:18













As apangin said, you are not allowed to redistribute such a modified JRE. If it is only for your own environment, you’re wasting your time. The JVM loads most of the classes from the optimized archive classes.jsa (rt.jar could be replaced with an empty file), unless the jar files have a newer timestamp. See Class Data Sharing. Compare also with the documentation for newer versions which is more exhaustive about controlling the contained classes

– Holger
Nov 26 '18 at 11:57





As apangin said, you are not allowed to redistribute such a modified JRE. If it is only for your own environment, you’re wasting your time. The JVM loads most of the classes from the optimized archive classes.jsa (rt.jar could be replaced with an empty file), unless the jar files have a newer timestamp. See Class Data Sharing. Compare also with the documentation for newer versions which is more exhaustive about controlling the contained classes

– Holger
Nov 26 '18 at 11:57












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463350%2fjre-fatal-error-after-shrinking-with-proguard%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463350%2fjre-fatal-error-after-shrinking-with-proguard%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'