【发布时间】:2014-11-28 11:41:40
【问题描述】:
我需要帮助在 Mac jEdit 上安装 Apache.Commons.Lang
采取的步骤:
- 我需要帮助在 Mac jEdit 上安装 Apache.Commons.Lang。
- 我已经从 Apache 下载了文件。
- 我尝试在许多位置复制“commons-lang3-3.3.2.jar”,但无济于事。
我尝试使用这个简单的文件测试我的安装:
import org.apache.commons.lang3.StringUtils;
public class TestOne {
public static void main(String[] args) {
String text = "Hello World";
System.out.println(StringUtils.reverse(text));
}
}
我收到以下错误:
TestOne.java:1: error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.StringUtils;
^
TestOne.java:6: error: cannot find symbol
System.out.println(StringUtils.reverse(text));
^
symbol: variable StringUtils
location: class TestOne
2 个错误
感谢您的帮助/指导!
(我的第一篇文章)
【问题讨论】:
-
你把jar添加到classpath了吗?
-
你如何编译你的代码?您使用 ant 或 JCompiler(JEdit 插件)还是在 JEdit 之外编译?
-
谢谢大家,抱歉回复晚了。我在我的 MAC 上使用终端进行编译。
-
我还没有将 jar 添加到类路径中。我不知道该怎么做。你能指出我正确的方向吗?再次感谢
标签: java macos installation jedit apache-commons-lang