0

I'm working on javafx project and converted it to maven. I'm implementing progaurd in it and generate encrypted (with Obfuscation) jar. But when i try to run jar using

java -jar test.jar

give me following error->

Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 47
Exception Details:
  Location:
smartSearch/SmartSearch.setFontStyle(Ljava/lang/String;)V @3: ifnull
  Reason:
Expected stackmap frame at this location.
  Bytecode:
0x0000000: b200 2bc6 002c b200 2b12 03b6 004a 4c2b
0x0000010: c600 1f2b bb00 1259 b700 3912 02b6 003a
0x0000020: 2ab6 003a 1201 b600 3ab6 003b b600 47b1
0x0000030:                                        

at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$413(LauncherImpl.java:352)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$399(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$397(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$398(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

I'm using JDK 1.8 and i have searched lots of solution, some of them are as follows :-

https://support.cloudbees.com/hc/en-us/articles/225066288-Expecting-a-stackmap-frame-at-branch-target

Getting "Expecting a stackmap frame at branch target" when running Maven integration testing

Many more..

I found that -XX:-UseSplitVerifier not supported by JDK1.8 and alternative is -noverify . But when searched to set -noverify i'm confused where to set this and how.

I found on oracle doc that option -XX:-UseSplitVerifier was deprecated in JDK 8, and verification is now split by default without a way to disable it.

please help me.

Holger
  • 285,553
  • 42
  • 434
  • 765
Nitin Upadhyay
  • 113
  • 1
  • 15
  • 2
    Never use [`-noverify`](https://stackoverflow.com/a/43566062/3448419) to "fix" VerifyError. It does not fix the problem, but rather hides it. Apparently there is a bug in proguard, and the generated class file is invalid. If you disable bytecode verification, *the best* thing you may get is a JVM crash. In the worst case the application may *silently* corrupt data, return wrong results etc., and you'll never know the problem is caused by a third party obfuscation tool. – apangin Aug 07 '19 at 08:06
  • 2
    Addition to @apangin, **noverify** was deprecated in [JDK 13](https://bugs.openjdk.java.net/browse/JDK-8218003) and will likely be removed in a future release. If you hide this issue with noverify, When update the java version, you will see this issue again in the future. – Turac Aug 07 '19 at 09:21
  • Thank you @apangin for your suggestion. – Nitin Upadhyay Aug 07 '19 at 12:37
  • 2
    Perhaps [this issue](https://stackoverflow.com/a/57051336/2711488)? – Holger Aug 07 '19 at 15:19

0 Answers0