【发布时间】:2013-11-17 09:42:49
【问题描述】:
我的 java 编译器找不到 java.nio.file 包。考虑:
import java.nio.file.*;
public class Test {
public static void main(String[] args) {
Path currentRelativePath = Paths.get("");
}
}
编译
bash$ javac Test.java
给予
Test.java:1: package java.nio.file does not exist
import java.nio.file.*;
^
Test.java:5: cannot find symbol
symbol : class Path
location: class Test
Path currentRelativePath = Paths.get("");
^
Test.java:5: cannot find symbol
symbol : variable Paths
location: class Test
Path currentRelativePath = Paths.get("");
^
3 errors
我使用的是 Ubuntu 12.04,我想我已经安装了 JDK 7(参见:package java.nio.file does not exist)
bash$ java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
【问题讨论】:
-
输入
javac -version会看到什么?