简体   繁体   English

SonarLint可以在JDK 5,6或7上运行吗?

[英]Can SonarLint be run on JDK 5,6, or 7?

I am trying to install SonarLint for Eclipse Ganymede (3.4.2) - and our project is very old, so we're using JDK 1.5 here. 我正在尝试为Eclipse Ganymede(3.4.2)安装SonarLint-我们的项目很旧,因此我们在这里使用JDK 1.5。 So is it possible to run SonarLint for JDK 5? 那么可以为JDK 5运行SonarLint吗?

First of all, JDK 5 is so old, I can't really be certain of anything... 首先,JDK 5太老了,我真的不能确定任何事情...

But here are some key factors that are important to understand: 但是,这里有一些重要的因素需要理解:

  • Java code is analyzed by the Java analyzer (known today as "SonarJava" ). Java 分析器 (今天称为“ SonarJava” )分析Java代码。 SonarLint is a plugin in Eclipse (and other IDEs) that executes the SonarJava, and uses the results from it to annotate the code you are editing. SonarLint是Eclipse(和其他IDE)中的一个插件,该插件执行SonarJava,并使用其结果注释正在编辑的代码。

  • The JDK version that the SonarJava itself requires to run, is not the same thing as the JDK version of the source code it is able to analyze (= the subject of the analysis). SonarJava本身需要运行的JDK版本与它能够分析的源代码的JDK版本(=分析的主题)不同。 For example, SonarJava may not run at all on JDK 7, but able to analyze code that is written in JDK 6. 例如,SonarJava可能根本无法在JDK 7上运行,但是能够分析用JDK 6编写的代码。

  • If you use SonarLint in standalone mode, it uses its embedded version of the SonarJava, you cannot use another version. 如果在独立模式下使用SonarLint,则它使用SonarJava的嵌入式版本,因此不能使用其他版本。 If you use SonarLint in connected mode, it uses SonarJava installed in the SonarQube to which you are connected. 如果您在连接模式下使用SonarLint,它将使用您所连接的SonarQube中安装的SonarJava。 Here you have some freedom of choice in the version of the SonarJava, but not unlimited, because SonarLint may not be compatible with all versions of SonarJava, for example recent versions require a certain minimum version. 在这里,您可以在SonarJava的版本中自由选择,但不是无限的,因为SonarLint可能与SonarJava的所有版本都不兼容,例如,最新版本需要一定的最低版本。

As per the product news , the current version of SonarLint requires Java 8 and more recent Eclipse than Juno. 根据产品新闻 ,SonarLint的当前版本需要Java 8和比Juno更新的Eclipse。 But you may be able to find an older version of SonarLint that can run in an older Eclipse, and support a version of SonarJava that is able to run on your JDK, and analyze code written for your target JDK version. 但是,您也许可以找到可以在较旧的Eclipse中运行的SonarLint的较旧版本,并支持可以在您的JDK上运行的SonarJava版本,并分析为目标JDK版本编写的代码。

Based on the above points, you can dig into the older releases of SonarLint and find something suitable. 基于以上几点,您可以深入研究SonarLint的较早版本,并找到合适的内容。 These links should be useful in your search: 这些链接在搜索中应该很有用:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM