关于java版本1.3到1.4

发布于 2024-08-25 19:23:51 字数 359 浏览 9 评论 0原文

我正在使用这个Java版本:

java 版本“1.3.1_01”Java(TM) 2 运行时环境,标准版(版本 1.3.1_01)Java HotSpot(TM) 客户端 VM(版本 1.3.1_01,混合模式)`

但是我已经编写了一个应用程序,我得到了运行时错误

Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/CharSequence

CharSequence 仅自 1.4 起存在。

我怎样才能克服这个问题?

I am using this Java version:

java version "1.3.1_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01) Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)`

But I have written an application and I am getting run time error

Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/CharSequence

CharSequence only exists since 1.4.

How can I overcome this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

笔芯 2024-09-01 19:23:51

听起来您有一些 1.4 代码试图在 1.3 上运行。

你犯了一个典型的错误,即假设你的假设是正确的。检查你的假设。

这两个 JVM 的支持寿命都已结束。也许你应该考虑升级。 JDK 6 是当前标准。

Sounds like you have some 1.4 code that you're trying to run on 1.3.

You're making the classic mistake of assuming that your assumptions are correct. Check your assumptions.

Both JVMs are well past the end of their support lives. Perhaps you should consider upgrading. JDK 6 is the current standard.

栖迟 2024-09-01 19:23:51

您必须编写代码(并编译)针对比您尝试运行代码更高版本的 JDK/JRE。如果您必须坚持在 1.3 上运行,请确保您也针对 1.3 进行构建。

另一种选择是您使用针对更高版本的 JDK 构建的第 3 方 JAR。在这种情况下,请找出导致问题的库并停止使用它。

或者,如果可能的话,将您的整个环境升级到 1.6(或 1.5,如果这对您来说太现代)

You must have either written your code (and compiled it) against a later version of the JDK/JRE than you are trying to run it on. If you must stick with running on 1.3, make sure you are building against 1.3 as well.

The other option is that you are using a 3rd-party JAR which was built against a later version of the JDK. In which case, figure out which library is causing the problem and stop using it.

Or, if possible upgrade your whole environment to 1.6 (or 1.5, if this is too modern for you)

无法回应 2024-09-01 19:23:51

根据JavaDocs,CharSequence接口是由CharBuffer、String和StringBuffer实现的。鉴于这些类如此深入地嵌入到一切事物中,我无法想象如何解决这个问题。所以有两个解决方案:

  • 重写一个CharSequence类
  • 使用java 1.4

According to the JavaDocs, the CharSequence interface is implemented by CharBuffer, String and StringBuffer. Given that these classes are so deeply embedded in everything, I can't imagine how you can get around the problem. So two solutions:

  • rewrite a CharSequence class
  • use java 1.4
梦里寻她 2024-09-01 19:23:51

如果适合您的需要,请尝试使用 String 而不是 CharSequence。否则 char[] 可能会有用。这取决于。显示您的代码以进行更具建设性的对话

Just try to use String instead of CharSequence if it suites you needs. Otherwise may be char[] will be useful. It depends. Show your code to have more constructive conversation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文