第一次安装Spring Tool Suite,刚构建完毕,就报此错误。不知道怎么回事,请帮忙看看吧。
报错内容:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
String cannot be resolved to a type
很显然因为你的jre没有引用对!
可能出现三种原因
1.jdk没有安装?或者路径不对
2.检查安装包是32位系统适用还是64位系统适用
3.试试换一下目录,可能是空格啊之类的,不是很确定
你说的非常对,因为第一次使用这个,以为它会自动查询呢。现在重新配置了jre,问题解决了。谢谢。
不过现在有个warnning。
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/gege/.m2/repository/org/springframework/spring-core/4.3.14.RELEASE/spring-core-4.3.14.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
找到原因了,JDK版本的问题,JDK9第一次运行会这样,其它版本没有,不过也可以运行,我把警告忽略了。