java 包 org.joda.time 不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7857252/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 21:42:55  来源:igfitidea点击:

Package org.joda.time does not exist

javanetbeansimportjodatime

提问by Bob

This is the very first time I try to import a third party *.jar into my project. I'm using Netbeans 7.0.1

这是我第一次尝试将第三方 *.jar 导入到我的项目中。我正在使用 Netbeans 7.0.1

Besides the usual project structure the following are inside the Source Packagesfolder:

除了通常的项目结构外,Source Packages文件夹内还有以下内容:

Appointments 
|
 - MyDate.java
 - Run.java
 - joda-time-2.0.jar
    - org
      |
       - ...

Attempt at importing the Joda Time gives me: package org.joda.time does not exist

尝试导入 Joda 时间给了我:包 org.joda.time 不存在

import org.joda.time.*;

What am I missing?

我错过了什么?

回答by adatapost

You have to add joda-time-2.0.jarvia project library. (Project + Libraries (Right mouse click) + Add Jar/Folder)

您必须joda-time-2.0.jar通过项目库添加。(项目 + 库(鼠标右键单击)+ 添加 Jar/文件夹)

回答by xappymah

You need to check that "joda-time-2.0.jar" is added to your classpath. If it is then check that it really contains the package mentioned.

您需要检查“joda-time-2.0.jar”是否已添加到您的类路径中。如果是,则检查它是否确实包含提到的包。