How to Install and Use Alibaba’s Java Code Guidelines Plugin for IDEA and Eclipse

This guide explains how to download, install, and configure Alibaba's Java development guidelines plugin for IntelliJ IDEA and Eclipse, covering repository and manual installations, real‑time detection, Quick‑Fix features, scanning methods, result interpretation, and common troubleshooting steps.

Alibaba Cloud Developer
Alibaba Cloud Developer
Alibaba Cloud Developer
How to Install and Use Alibaba’s Java Code Guidelines Plugin for IDEA and Eclipse

Plugin Download

Download the plugin from the official GitHub repository: https://github.com/alibaba/p3c or search for "p3c" on GitHub.

Alibaba Java Development Handbook IDEA Plugin – Installation Guide

Install via JetBrains Marketplace

1. Open Settings >> Plugins >> Browse repositories...

2. Search for "Alibaba" and locate the Alibaba Java Code Guidelines plugin, click Install and restart the IDE.

Note: The plugin zip is hosted on JetBrains CDN, which may cause download timeouts.

Install via Local Zip Package

1. Open the plugin page in IDEA.

2. Choose Settings >> Plugins >> Install plugin from disk... , select the downloaded zip file, and restart the IDE.

Minimum supported IDEA version: 14.1 (build 141.0). Users of IDEA 14 should upgrade to 14.1.7.

JDK requirement: The plugin is packaged with JDK 1.7; running IDEA with JDK 1.6 will cause an Unsupported major.minor version 51.0 error.

Chinese Font Fix

Set UI font to Microsoft Yahei Light via Appearance & Behavior >> Appearance >> UI Options .

Switch language to English and restart to avoid garbled characters.

Plugin Usage

The plugin implements 41 rules from the Alibaba coding standards, mainly based on PMD, with 4 IDEA‑specific rules providing real‑time inspection and Quick‑Fix support.

Detection Modes: Real‑time detection (default, highlights violations as you code) and manual trigger.

Real‑time detection highlights violations, supports Quick‑Fix, and can be disabled via Inspection settings.

Hovering over highlighted code shows a tooltip with details.

Quick‑Fix

Press Alt+Enter to open the Intention menu and apply rule‑specific Quick‑Fix actions.

Scanning

Trigger scans manually via:

Right‑click menu on a file, directory, or project.

Toolbar button (scope depends on current focus).

Shortcut Ctrl+Shift+Alt+J (customizable).

Scan Results

Results appear in IDEA’s Run Inspection By Name view, grouped by severity: Blocker, Critical, Major.

Enable Autoscroll To Source to open source files directly from the result panel.

Quick‑Fix can be applied directly from the result panel (IDEA 14/15 also support the light‑bulb shortcut).

Alibaba Java Development Handbook Eclipse Plugin – Installation Guide

Prerequisites: JDK 1.8, Eclipse 4+.

Install via Help >> Install New Software... and provide the update site URL: https://p3c.alibaba.com/plugin/eclipse/update. Select Ali‑CodeAnalysis and follow the prompts, then restart Eclipse.

Note: Some users experienced missing menu items; upgrading JDK from 1.6 to 1.8 resolved the issue.

Note: The plugin may trigger background threads of the JPA plugin; uninstall JPA if not needed.

Plugin Usage

The Eclipse plugin implements 53 rules, mostly based on PMD, with 4 Eclipse‑specific rules offering Quick‑Fix.

Key rule examples:

All overridden methods must be annotated with @Override.

Keywords such as if, for, while, switch, do must be followed by a space before the opening parenthesis.

Use uppercase L for long literals.

Call equals on a constant or a non‑null object to avoid NullPointerException.

Scanning can be triggered via right‑click menu or toolbar button, similar to the IDEA workflow.

Scan Results

Results are displayed in a concise panel grouped by severity, with quick navigation to rule details and support for Quick‑Fix on the four Eclipse‑specific rules.

Internationalization

The plugin supports English UI; switch language in settings if needed.

IDEA plugin download
IDEA plugin download
IDEA installation steps
IDEA installation steps
Disabling real‑time detection
Disabling real‑time detection
Triggering scan from file
Triggering scan from file
Result panel
Result panel
Quick‑Fix example
Quick‑Fix example
Eclipse plugin installation
Eclipse plugin installation
Eclipse scan results
Eclipse scan results
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AlibabaJavaplugincode analysisIDEAp3cEclipse
Alibaba Cloud Developer
Written by

Alibaba Cloud Developer

Alibaba's official tech channel, featuring all of its technology innovations.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.