我有一些奇怪的问题。 通过基本IO教程(来自Oracle java SE教程)我遇到了一些问题:我的Intellij编辑器在Path变量上显示红色标记。 默认情况下,设置了6版本的java,但我在8上更改了它并没有得到任何结果。 问题出在哪儿? (使用我的设置或其他东西的路径声明?)
Path path1 = Paths.get("D:\\folder1");
这里是重建日志:
Information:javac 1.8.0_73 was used to compile java sources
Information:21.06.2017 14:48 - Compilation completed successfully with 3 warnings in 3s 704ms
Warning:java: source value 1.5 is obsolete and will be removed in a future release
Warning:java: target value 1.5 is obsolete and will be removed in a future release
Warning:java: To suppress warnings about obsolete options, use -Xlint:-options.
这是ide的错误消息:
usage of API documented as @since 1.6+
我已经用手重写了它,因为突然无法复制它。
班级代码:
import java.nio.file.*;
public class Main {
public static void main(String[] args) {
Path path1 = Paths.get("D:\\folder1");
}
}
项目设置窗口:
我已经知道了:项目结构 - >模块 - >来源 - >语言水平对我有帮助