快速上手Intellij idea

来源:互联网 发布:搞笑的网络用语 编辑:程序博客网 时间:2024/05/19 19:57

记得第一次写java代码的时候用的txt,在cmd窗口用java命令编译执行。之后接触到了ultraedit、notepad++、sublime text比较智能的文本编辑器。在第一次做企业级项目时,使用到了java神器eclipse。最近同学们一直推荐使用Intellij idea,说是比eclipse更智能。
工欲善其事必先利其器,作为开发人员,一款顺手的IDE可以大大提高开发效率。因此,我用了2天时间把eclipse的项目迁移到idea,感受下两者的不同,同时把自己迁移过程中的收获和大家分享一下。
idea的下载地址网上有很多,我把自己的安装包和大家分享一下:idea download,安装步骤比较简单,可以参考链接中的doc文档。

  1. 导入svn/git项目
    VCS–>Checkout from Version Control–>Subversion,选中+号添加SVN仓库,选中项目后checkout到本地。
    如果报错Can’t use Subversion command line client,则需要我们打开tortoisesvn安装包,安装下command line client tools。
    command line client tools
  2. 配置maven
    把svn/git项目checkout到本地后,我们需要配置idea的maven。
    File–>Settings–>搜索maven,配置如下:
    这里写图片描述
  3. 配置tomcat
    Edit Configurations–>+号–>Tomcat Server–>local。
    Edit Configurations
    配置Server tab页:
    Server
    配置Deployment tab页:
    +号–>Artifact–>选择exploded结尾的–>Application context添加项目前缀
    Artifact exploded
    idea部署项目到tomcat的方式与eclipse不同。eclipse是直接把项目部署到tomcat/webapps目录,运行tomcat即可访问;idea是把代码生成在项目的target目录,在C:\Users\quwenzhe.IntelliJIdea2017.1\system\tomcat\Unnamed_opman\conf\Catalina\localhost生成*.xml文件,通过docBase标签指定代码路径,启动tomcat便可以访问项目。
    *.xml
  4. 配置idea和eclipse快捷键相同
    idea的快捷键和eclipse有些不同,为我们的使用带来了一些不便,但可以通过File–>Settings–>Keymap–>Keymaps–>eclipse设置与eclipse快捷键相同。
    启动tomcat过程中,如果报错:The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path,只需下载tcnative-1.dll,然后copy到tomcat的bin目录,我的tcnative-1.dll也分享到tcnative-1.dll。
    完成上述配置后,运行tomcat便可以成功访问我们部署的项目了。
原创粉丝点击