如何使用 Websphere 7 将环境限制为 JDK 1.5 来启动 WAR?

发布于 2024-11-25 20:30:06 字数 61 浏览 3 评论 0原文

我想知道是否可以在Webpshere 7下发起一场必须使用JDK 1.5(不兼容JDK 1.6)运行的战争。

I would like to know if it is possible to launch a war which have to run with the JDK 1.5 (not compliant with JDK 1.6) under Webpshere 7.

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

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

发布评论

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

评论(2

撩起发的微风 2024-12-02 20:30:06

除了与产品捆绑在一起的 JDK 之外,不可能/不支持使用任何其他 JDK 来运行 WebSphere Application Server 7.0 进程。

It is not possible/supported to run WebSphere Application Server 7.0 process with any other JDK than the one that is bundled with the product.

明媚如初 2024-12-02 20:30:06

我想我对你的问题感到困惑。 JRE 是向后兼容的。因此,IBM WebSphere Application Server V 7.xxx 中的 1.6 JRE 将运行早至 Java EE 1 的 Java EE 代码(我认为它可能兼容 Java 1.2),并且应该支持早至 1.1 的 Java SE 代码。 (为什么你想回到那么远的地方,我不确定......)。

确实没有什么麻烦。只需使用 1.5 JDK 编译您的代码(这就是我们所做的),或者如果您愿意,您可以使用 1.6 编译器编译它,并将编译器标记为使用 1.5。

您的代码不必兼容 1.6。它只需要兼容 1.5 就可以正常运行。这就是 JDK 和 JRE 抽象和向后兼容的全部意义。

作为您的示例,我们有一个企业应用程序,我们使用 Sun/Oracle 的 1.5 JDK 通过 Maven 2 进行编译。我们打包了几个开源项目 jar,其中一些甚至与 1.3 兼容和/或已编译。

我们使用 Maven 2 将所有这些打包为 EAR,并将其部署到 IBM 的 WebSphere Application Server(我们运行 7.0.0.9)。我们的代码运行得很好。我们甚至有一些模块是使用 JDK 1.6 编译的,以利用 6 中的某些功能,但大多数代码都是编译为 1.5 的。并且运行良好。

所以我想我很困惑你在问什么。您能否提供一个更具体的例子来说明您正在尝试做什么?因为根据您告诉我的情况,您应该能够在 WAS 7 中正常运行,而无需在 JDK 6 中进行编译。

I guess I'm confused by your question. JRE's are to be backwards compatible. So the 1.6 JRE within IBM WebSphere Application Server V 7.x.x.x will run Java EE code as far back as Java EE 1 (which I think might be Java 1.2 compliant) and should support Java SE code as far back as 1.1. (Why you'd want to go that far back, I'm not sure....).

There really is no trouble to it. Just compile your code with a 1.5 JDK (that's what we do), or if you want you could compile it with a 1.6 compiler and flag the compiler to use 1.5.

Your code doesn't have to be 1.6 compliant. It just has to be 1.5 compliant and it will run fine. That is the whole point of abstracting and backwards compatibility with the JDK and JRE.

As an example for you, we have an enterprise application that we compile with Maven 2 using Sun/Oracle's 1.5 JDK. We package in several open source project jars, some of which are even as old as 1.3 compliant and/or compiled.

We package all of this up as an EAR using Maven 2 and we deploy it to IBM's WebSphere Application Server (and we run 7.0.0.9). Our code runs just fine. We even have some modules that we do compile with JDK 1.6 to leverage certain functions in 6, but most of the code is compiled as 1.5. And it runs fine.

So I guess I'm confused what you are asking. Could you provide a more concrete example of what you are trying to do? Because from what you have told me, you should be able to run just fine in WAS 7 without compiling at JDK 6.

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