如何设置JVM选项解决Spring Boot 2.0.0.RC1非法反射访问错误
Hey there, let's get that annoying org.springframework.cglib.core.ReflectUtils$1 illegal reflection access error sorted out. Here's exactly what you need to do in IntelliJ IDEA:
Edit the VM Options File
You've already openedHelp > Edit Custom VM Options—great start! This will open eitheridea.vmoptionsoridea64.vmoptionsdepending on your system architecture.Add the Required JVM Flag
Scroll to the end of the file and add this line (make sure to use two hyphens, not one):--illegal-access=denyThis overrides Java 9's default
permitsetting for illegal reflection access, which aligns with the Spring team's recommendation to resolve the known issue in Spring Boot 2.0.0.RC1 (and Spring Framework 5.0.3.RELEASE).Restart IDEA
Save the file, then close and reopen IntelliJ IDEA. The new VM option will take effect on restart.
A quick note: Once you upgrade to a stable release of Spring Boot (like 2.0.0.RELEASE or later), this issue should be fully resolved, so you can remove this flag if you want.
内容的提问来源于stack exchange,提问作者Fiyaz Hasan

