File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121** 第 1 步:安装` GenerateSerialVersionUID ` 插件**
2222
23- ![ 1 ] ( http ://img.blog.csdn.net/20170829200523647 )
23+ ![ preferences ] ( https ://github.com/guobinhit/intellij-idea-tutorial/blob/master/images/serialVersionUID/preferences.png )
2424
2525如上图所示,点击` Preferences ` ,进入如下界面:
2626
27- ![ 2 ] ( http ://img.blog.csdn.net/20170829200539634 )
27+ ![ plugins ] ( https ://github.com/guobinhit/intellij-idea-tutorial/blob/master/images/serialVersionUID/plugins.png )
2828
2929在这里,选择` Plugins ` ,并搜索` GenerateSerialVersionUID ` ,如果没有发现此插件,则可以点击` Search in repositories ` 进行搜索:
3030
31- ![ 3 ] ( http ://img.blog.csdn.net/20170829200554430 )
31+ ![ browse-repositories ] ( https ://github.com/guobinhit/intellij-idea-tutorial/blob/master/images/serialVersionUID/browse-repositories.png )
3232
3333如上图所示,点击` install ` ,即可安装此插件。
3434
3535** 第 2 步:设置` Inspections ` 功能**
3636
37- ![ 4 ] ( http ://img.blog.csdn.net/20170829201102148 )
37+ ![ inspections ] ( https ://github.com/guobinhit/intellij-idea-tutorial/blob/master/images/serialVersionUID/inspections.png )
3838
3939如上图所示,进入` Default Settings ` ,在` Inspections ` 设置页面中,勾选` Serializable class without 'serialVersionUID' ` ,并且还可以在` Severity ` 中设置提示级别,如` Warning ` 、` Error ` 等,默认为` Warning ` ,也建议选择` Warning ` 级别的提示。
4040
41- ![ 5 ] ( http ://img.blog.csdn.net/20170829201203932 )
41+ ![ generate-uid ] ( https ://github.com/guobinhit/intellij-idea-tutorial/blob/master/images/serialVersionUID/generate-uid.png )
4242
4343如上图所示,创建一个类并实现` Serializable ` 接口,然后按` alt ` +` Enter ` 键,即可收到提示,然后选择` SerialVersionUID ` :
4444
45- ![ 6 ] ( http ://img.blog.csdn.net/20170829201122093 )
45+ ![ test-generate-uid ] ( https ://github.com/guobinhit/intellij-idea-tutorial/blob/master/images/serialVersionUID/test-generate-uid.png )
4646
4747如上图所示,显然我们已经利用 IntelliJ IDEA 中自动生成` serialVersionUID ` 啦!
4848
You can’t perform that action at this time.
0 commit comments