包 Java 1.7+ 只有 类 带有 JAR 1.6
Package Java 1.7+ Only Classes with JAR 1.6
我有一个问题,我想将文件从一个目录复制到另一个目录。
Path source = Paths.get(files[i].getPath());
Path target = Paths.get(dir.getName() + "/" + files[i].getName());
try {
Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING);
files[i] = target.toFile();
} catch (IOException e) {
throw new IOException("\t\tUnable to move " + files[i].getName(), e);
}
这段代码 可以工作 ,但是我 运行 正在使用 JRE 1.8,而我想要 运行 的系统是 运行宁 JRE 1.6。 Path 和 Files 仅在 JRE 1.7 之后可用。
有没有一种方法可以使用 eclipse 或 java 编译器将这些 类 与我的 jar 文件.
打包在一起
我有一个问题,我想将文件从一个目录复制到另一个目录。
Path source = Paths.get(files[i].getPath());
Path target = Paths.get(dir.getName() + "/" + files[i].getName());
try {
Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING);
files[i] = target.toFile();
} catch (IOException e) {
throw new IOException("\t\tUnable to move " + files[i].getName(), e);
}
这段代码 可以工作 ,但是我 运行 正在使用 JRE 1.8,而我想要 运行 的系统是 运行宁 JRE 1.6。 Path 和 Files 仅在 JRE 1.7 之后可用。
有没有一种方法可以使用 eclipse 或 java 编译器将这些 类 与我的 jar 文件.
打包在一起