本文介绍了如何导入java.nio.file包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图听一个目录进行更改,然后发现java.nio。*被开发用来有效地处理这些任务等等。然后从oracle下载了jdk1.7.0_02并用它启动了eclipse。然后创建了新的java项目,尝试从java.nio.file实现一些类,哦,我的眼睛! 导入java.nio.file无法解析。
我是否必须在包含此类软件包的整个jdk1.7.0_02目录中找到一些.jar?或者我的类路径出了什么问题?
提前谢谢!!

Im trying to listen to a directory for changes, then discovered java.nio.* was developed to handle efficiently such tasks and more. Then downloaded jdk1.7.0_02 from oracle and started eclipse with it. Then created new java project, tryed to implement some class from java.nio.file and Oh my eyes! "The import java.nio.file cannot be resolved".Do i have to find some .jar in the whole jdk1.7.0_02 directory that contains such package? or is something wrong with my classpath? Thank you in advance!!

推荐答案

你有不同版本的。您只需要设置 JDK7 / JRE7 版本的eclipse项目。您也可以在创建新项目时为JavaSE 7选择执行环境JRE

You've different version of JDKs. You just need to set JDK7/JRE7 version eclipse project. You may also select the Execution environment JRE to JavaSE 7 while creating a new project.

您的项目使用的JDK编译时,生成的类文件的版本,它们用来执行的JRE和运行的JDK eclipse是广泛独立的设置。

The JDK your projects use to compile, the version of the resulting class files, the JRE they used to execute and the JDK eclipse runs with are widely independent settings.

这篇关于如何导入java.nio.file包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 10:57