简体   繁体   English

无法在 intellij 中解析符号“println”

[英]Cannot resolve symbol 'println' in intellij

I cannot seem to get rid of "cannot resolve println symbol in intellij", what i have tried:-我似乎无法摆脱“无法解析 intellij 中的 println 符号”,我尝试过:-

  1. check the appropriate sdk(14.0.1 jdk) under project structure.检查项目结构下的相应 sdk(14.0.1 jdk)。 2)include the same jdk under modules too and added it to home path 3)included java version 14.0.1 in pom.xml file also. 2) 在模块下也包含相同的 jdk 并将其添加到主路径 3) 在 pom.xml 文件中包含 java 版本 14.0.1。

Below are the screenshots:-以下是截图:-

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

Edit:- I got worked up only to find myself being caught in an error caused due to a closing brace.编辑:-我很生气,只是发现自己因右括号而陷入错误。 Also thanks whoever tried to help!也感谢任何试图帮助的人!

You have the method call directly inside the class body, not inside the main method as your main method body is already closed with } .您可以直接在 class 主体内部进行方法调用,而不是在主要方法内部,因为您的主要方法主体已经用}关闭。

You may want to disable IDE code folding to avoid such problems in the future:您可能希望禁用 IDE 代码折叠以避免将来出现此类问题:

Settings (Preferences on macOS) |设置(macOS 上的首选项)| Editor |编辑 | General |一般 | Code Folding |代码折叠 | One-line methods.一条线的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM