Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set JVM option for avoid error Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 [duplicate]

I use Spring Boot 2.0.0.RC1, JDK 9.0.4, IntelliJ IDEA 2017.3.4 Ultimate, Gradle 4.5.1 . Spring Boot RC1 version (strictly, Spring Framework 5.0.3.RELEASE) has a known issue: https://jira.spring.io/browse/SPR-15859 , I also see it at here https://github.com/dsyer/spring-boot-java-9#create-a-spring-boot-application

Spring developer suggest that

You can switch this off by adding -illegal-access=deny to the command line (the default in Java 9 is permit).

I choose menu Help \ Edit Custom VM Options..., then add new options at the last line of file.

enter image description here

Then I catch error

> Unrecognized option: -illegal-access=deny 
>
> Error: Could not create the Java Virtual Machine. 
>
> Error: A fatal exception has occurred. Program will exit.

Full console log

/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/java -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=50382 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=50383:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Users/donhuvy/Documents/source_code/gitlab.com/Donhu/accounting_vy/source_code/out/production/classes:/Users/donhuvy/Documents/source_code/gitlab.com/Donhu/accounting_vy/source_code/out/production/resources:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/2.0.0.RC1/spring-boot-starter-actuator-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/2.0.0.RC1/spring-boot-starter-data-jpa-2.0.0.RC1.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-jersey/2.0.0.RC1/84315afdba22f18e8473dabe39507c2f7329bbf/spring-boot-starter-jersey-2.0.0.RC1.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-mail/2.0.0.RC1/5cd08bbbfaa424ab2e250e51dd9d13bd38a1d42d/spring-boot-starter-mail-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.0.RC1/spring-boot-starter-thymeleaf-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.0.0.RC1/spring-boot-starter-web-2.0.0.RC1.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-entitymanager/5.2.13.Final/cdef4ec0e1c9739942fbd16bb6b355d5fb804fba/hibernate-entitymanager-5.2.13.Final.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-core/5.2.13.Final/830492a74b3013ef75135ea4120b2ac23fa7ad9f/hibernate-core-5.2.13.Final.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/javax.xml.bind/jaxb-api/2.3.0/99f802e0cb3e953ba3d6e698795c4aeb98d37c48/jaxb-api-2.3.0.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-core/2.3.0/d044c784e41d026778693fb44a8026c1fd9a7506/jaxb-core-2.3.0.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-impl/2.3.0/3a3c6a62719d967175b76b63925f1fb495f11437/jaxb-impl-2.3.0.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.2.Final/52afb5762c704a6b586e27742470c08f91877fc1/hibernate-jpa-2.1-api-1.0.2.Final.jar:/Users/donhuvy/.m2/repository/org/springframework/data/spring-data-jpa/2.0.3.RELEASE/spring-data-jpa-2.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-orm/5.0.3.RELEASE/spring-orm-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.0.0.RC1/spring-boot-starter-aop-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/2.0.0.RC1/spring-boot-starter-jdbc-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.0.0.RC1/spring-boot-starter-json-2.0.0.RC1.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-validation/2.0.0.RC1/63ff3ff19491dc47d0b9b47e7770ddd1dbeeacb0/spring-boot-starter-validation-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-devtools/2.0.0.RC1/spring-boot-devtools-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter/2.0.0.RC1/spring-boot-starter-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-actuator-autoconfigure/2.0.0.RC1/spring-boot-actuator-autoconfigure-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/io/micrometer/micrometer-core/1.0.0-rc.8/micrometer-core-1.0.0-rc.8.jar:/Users/donhuvy/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-aspects/5.0.3.RELEASE/spring-aspects-5.0.3.RELEASE.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-spring4/2.26/e5f2654b343c31078d9b5c8a4f43b838b320099f/jersey-spring4-2.26.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-webmvc/5.0.3.RELEASE/spring-webmvc-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-web/5.0.3.RELEASE/spring-web-5.0.3.RELEASE.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.containers/jersey-container-servlet/2.26/8723d05d1fe2fdda54d0921836ea5daa5abe5f00/jersey-container-servlet-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.containers/jersey-container-servlet-core/2.26/66a0d51facf1e49e2353ff0d2a2d4a9e2fa3f836/jersey-container-servlet-core-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-bean-validation/2.26/33747b4e8a07c53550ee1cbe7fc4321600842c5a/jersey-bean-validation-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.core/jersey-server/2.26/aa8eff3d591641dadd7c9880bb73b59bf46d4c82/jersey-server-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.media/jersey-media-json-jackson/2.26/ce3109479991527107921ca5e7943a6e7e20db80/jersey-media-json-jackson-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context-support/5.0.3.RELEASE/853800b9fe479931f8ec5aaf7c19e285d5de1402/spring-context-support-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.0.0.RC1/spring-boot-autoconfigure-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-actuator/2.0.0.RC1/spring-boot-actuator-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot/2.0.0.RC1/spring-boot-2.0.0.RC1.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/spring-bridge/2.5.0-b42/7cedc63a9079e87b5a2685c054e61cfce8c44837/spring-bridge-2.5.0-b42.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-context/5.0.3.RELEASE/spring-context-5.0.3.RELEASE.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.sun.mail/javax.mail/1.6.0/a055c648842c4954c1f7db7254f45d9ad565e278/javax.mail-1.6.0.jar:/Users/donhuvy/.m2/repository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar:/Users/donhuvy/.m2/repository/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE.jar:/Users/donhuvy/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.7.Final/hibernate-validator-6.0.7.Final.jar:/Users/donhuvy/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.0.1.Final/hibernate-commons-annotations-5.0.1.Final.jar:/Users/donhuvy/.m2/repository/org/jboss/logging/jboss-logging/3.3.1.Final/jboss-logging-3.3.1.Final.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.inject/jersey-hk2/2.26/df27f7d7577acf4b532684448021632098924dab/jersey-hk2-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-2.5.0-b42.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/config-types/2.5.0-b42/3e927a0624955d10bec3eb5424a1e6ca3d5f92ae/config-types-2.5.0-b42.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-config/2.5.0-b42/de522871d987e2bf502753c807461f9ee805f6bd/hk2-config-2.5.0-b42.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-core/2.5.0-b42/7a4954663f1b65b1938fd275b34bbf1e23965381/hk2-core-2.5.0-b42.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-runlevel/2.5.0-b42/6502d8997ac961f0d2d16d90e838d25626c1a37b/hk2-runlevel-2.5.0-b42.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-locator/2.5.0-b42/9d6edc0cb226401a8316e67d81bfc37cb626ef91/hk2-locator-2.5.0-b42.jar:/Users/donhuvy/.m2/repository/org/javassist/javassist/3.22.0-CR2/javassist-3.22.0-CR2.jar:/Users/donhuvy/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/Users/donhuvy/.m2/repository/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.0.1.Final/jboss-transaction-api_1.2_spec-1.0.1.Final.jar:/Users/donhuvy/.m2/repository/org/jboss/jandex/2.0.3.Final/jandex-2.0.3.Final.jar:/Users/donhuvy/.m2/repository/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar:/Users/donhuvy/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/donhuvy/.m2/repository/net/bytebuddy/byte-buddy/1.7.9/byte-buddy-1.7.9.jar:/Users/donhuvy/.m2/repository/org/springframework/data/spring-data-commons/2.0.3.RELEASE/spring-data-commons-2.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-aop/5.0.3.RELEASE/spring-aop-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-jdbc/5.0.3.RELEASE/spring-jdbc-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-tx/5.0.3.RELEASE/spring-tx-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-beans/5.0.3.RELEASE/spring-beans-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-expression/5.0.3.RELEASE/spring-expression-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-core/5.0.3.RELEASE/spring-core-5.0.3.RELEASE.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjrt/1.8.13/bfc5a877fd80648e5467239d370735654aaf7a92/aspectjrt-1.8.13.jar:/Users/donhuvy/.m2/repository/com/zaxxer/HikariCP/2.7.6/HikariCP-2.7.6.jar:/Users/donhuvy/.m2/repository/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE.jar:/Users/donhuvy/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.0.0.RC1/spring-boot-starter-logging-2.0.0.RC1.jar:/Users/donhuvy/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/donhuvy/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.10.0/log4j-to-slf4j-2.10.0.jar:/Users/donhuvy/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:/Users/donhuvy/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.core/jersey-client/2.26/125b8d1040d121a5dc4ce6858e21a6160bed7afa/jersey-client-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.media/jersey-media-jaxb/2.26/791397ceb5d1c8f389664b1de3e4208c2ac1015b/jersey-media-jaxb-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.core/jersey-common/2.26/d96475745c5e72cafcbc4dc9e2e725f4d9683f21/jersey-common-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-api/2.5.0-b42/7fd4e3d0f2cb37c80ad0dedee3f5ee69503eaf52/hk2-api-2.5.0-b42.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-utils/2.5.0-b42/102a344e1728825e865a8986d7605602aba3c3b6/hk2-utils-2.5.0-b42.jar:/Users/donhuvy/.m2/repository/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar:/Users/donhuvy/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.2/jackson-datatype-jsr310-2.9.2.jar:/Users/donhuvy/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.2/jackson-datatype-jdk8-2.9.2.jar:/Users/donhuvy/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.2/jackson-module-parameter-names-2.9.2.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.9.2/8abd01f740ef04d05811bbca5612371bf034b05e/jackson-module-jaxb-annotations-2.9.2.jar:/Users/donhuvy/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.2/jackson-databind-2.9.2.jar:/Users/donhuvy/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.10/HdrHistogram-2.1.10.jar:/Users/donhuvy/.m2/repository/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar:/Users/donhuvy/.m2/repository/org/aspectj/aspectjweaver/1.8.13/aspectjweaver-1.8.13.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-entity-filtering/2.26/a8ea15c9cd0bd8b090dbbf0f0e43aa39604f3433/jersey-entity-filtering-2.26.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/javax.ws.rs/javax.ws.rs-api/2.1/426a0862406536e690c7caa8bb6ed32191986fac/javax.ws.rs-api-2.1.jar:/Users/donhuvy/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar:/Users/donhuvy/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar:/Users/donhuvy/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/Users/donhuvy/.m2/repository/org/springframework/spring-jcl/5.0.3.RELEASE/spring-jcl-5.0.3.RELEASE.jar:/Users/donhuvy/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.2/jackson-core-2.9.2.jar:/Users/donhuvy/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/class-model/2.5.0-b42/a9824e8ed9748f3622394d6d32098cc1bb2a0ea1/class-model-2.5.0-b42.jar:/Users/donhuvy/.m2/repository/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE.jar:/Users/donhuvy/.m2/repository/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE.jar:/Users/donhuvy/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/donhuvy/.m2/repository/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2.external/aopalliance-repackaged/2.5.0-b42/e74beab6ca12e9e745eb47ca61729d9452b96f0c/aopalliance-repackaged-2.5.0-b42.jar:/Users/donhuvy/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2.external/asm-all-repackaged/2.5.0-b42/3afd5d4f63116e8c00b430f32092282e5e475ce8/asm-all-repackaged-2.5.0-b42.jar com.donhuvy.AccountingVyApplication
The Class-Path manifest attribute in /Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-core/2.3.0/d044c784e41d026778693fb44a8026c1fd9a7506/jaxb-core-2.3.0.jar referenced one or more files that do not exist: file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-core/2.3.0/d044c784e41d026778693fb44a8026c1fd9a7506/jaxb-api.jar
The Class-Path manifest attribute in /Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-impl/2.3.0/3a3c6a62719d967175b76b63925f1fb495f11437/jaxb-impl-2.3.0.jar referenced one or more files that do not exist: file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-impl/2.3.0/3a3c6a62719d967175b76b63925f1fb495f11437/jaxb-core.jar
The Class-Path manifest attribute in /Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-2.5.0-b42.jar referenced one or more files that do not exist: file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-utils.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/javax.annotation-api.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/javax.inject.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-api.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/aopalliance-repackaged.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/config-types.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-core.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-config.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/tiger-types.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hibernate-validator.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/validation-api.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/jboss-logging.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/classmate.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-locator.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/javax.inject.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/javassist.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/hk2-runlevel.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/class-model.jar,file:/Users/donhuvy/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2/2.5.0-b42/adc396d57e9cada50f57d32cdabaf31a20a758d/asm-all-repackaged.jar
08:34:57.775 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
08:34:57.778 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-starter/target/classes/, /spring-boot-devtools/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-autoconfigure/target/classes/]
08:34:57.778 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/donhuvy/Documents/source_code/gitlab.com/Donhu/accounting_vy/source_code/out/production/classes/, file:/Users/donhuvy/Documents/source_code/gitlab.com/Donhu/accounting_vy/source_code/out/production/resources/]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/Users/donhuvy/.m2/repository/org/springframework/spring-core/5.0.3.RELEASE/spring-core-5.0.3.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

enter image description here

How to add option -illegal-access=deny to IntelliJ IDEA correctly?

update: Solution

enter image description here

like image 634
Do Nhu Vy Avatar asked Feb 15 '18 16:02

Do Nhu Vy


People also ask

How do you solve an illegal reflective access operation has occurred?

You can specify the reflective access explicitly using java's --add-opens parameter. The migration guide for JDK 11 provides more information. Use a compatible and certified version of your software.

What does an illegal reflective access operation has occurred mean?

WARNING: An illegal reflective access operation has occurred. When Java code uses reflection to access JDK-internal API, the runtime will issue an illegal reflective access warning.

How do I set an illegal access permit in IntelliJ?

You can switch this off by adding -illegal-access=deny to the command line (the default in Java 9 is permit). I choose menu Help \ Edit Custom VM Options..., then add new options at the last line of file. How to add option -illegal-access=deny to IntelliJ IDEA correctly?

What is -- illegal access permit?

The default mode, --illegal-access=permit , is intended to make you aware of code on the class path that reflectively accesses any JDK-internal APIs at least once. To learn about all such accesses, you can use the warn or the debug modes.


1 Answers

TL;DR:

To run your code you will need to add the option

--add-opens java.base/java.lang=ALL-UNNAMED

to the JVM running your code as I noted here. When running your application in IntelliJ, the application VM options are set in the Run/Debug Configuration VM options tab, something like:

--add-opens java.base/java.lang=ALL-UNNAMED    
-server

I don't use IntelliJ so this isn't tested.


I think you're combining your question with a partial and incorrect answer. I think you mean to ask the following question:

When I run my JDK 9.0.4 Spring Boot 2.0.0.RC1 application in IntelliJ IDEA 2017.3.4 Ultimate on my Mac using Gradle 4.5.1 as my build tool, my application prints the following in the console:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1() to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1

How can I get rid of this warning from the IntelliJ console?

Is this what you're asking? If so, replace your question with this text. And avoid using images when text can convey the content.

like image 75
Jan Nielsen Avatar answered Sep 22 '22 00:09

Jan Nielsen