JDK 1.6与JDK 1.5兼容吗? [英] JDK 1.6 compatible with JDK 1.5?

查看:139
本文介绍了JDK 1.6与JDK 1.5兼容吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个兼容的问题,我的项目是在JDK 1.6中开发的,但是当我需要将它发布到主机域时,存在主机域使用JDK 1.5的问题,我如何让我的项目与JDK兼容1.5?提前谢谢

解决方案

您基本上需要设置 -target 属性。另见 javac /?

  javac -target 1.5 [.. 。] 

另见的JDK 1.5。


Im having a compatible issue, my project is develop in JDK 1.6, but when i need to post it to a host domain, there is a issue where the host domain used JDK 1.5, how do i make my project compatible with JDK 1.5? thanks in advance

解决方案

You basically need to set the -target attribute. Also see javac /?.

javac -target 1.5 [...]

Also see this example in javac's documentation.


Update: as per the comments you're using Eclipse, you can just change the compiler compliance level on a per-project basis. Rightclick project > Properties > Java Compiler > Compiler compliance level > 1.5. See screenshot.

You can download JDK 1.5 from the Sun Archive.

这篇关于JDK 1.6与JDK 1.5兼容吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆