Wednesday, 20 September 2017

Learning IntelliJ IDE (Notes)

This blog regarding IntelliJ IDE setup.
Note :- If you find preference  then please consider setting on Microsoft window 


Installation 
1) Download & Install Java 8
2) Add java and javac to path 
3) Download IntelliJ IDE and install it ( Accept Default) do not install plugin any.

How to update ?
On Welcome window 
Configuration -> Check for update

How to set Default Project Settings ?
Go to 
Configure -> Project Default -> Project Structure

SDK Setup (In Configure -> Project Default -> Project Structure)
Click on New , add JDK folder (Not bin) 

Language Level (In Configure -> Project Default -> Project Structure)
Select drop down value 

How to add common Library to all project ?
Got to
Configure -> Project Default -> Project Structure -> Select Library

How to show line number in Editor Window ?
Configure -> Preference -> Editor -> Appearance -> check box Show line number


How to change font ?
Configure -> Preference -> Editor -> Font 

How to create project ?
On Welcome window 
Create New Project -> select option depends on plugin 
Short Cut ( Open Project Window  Alt + 1 /  cmd +1 )

How to find file in project ?
Open Project Window -> Then click Scroll from Window on Project window 
Project window has different scope

How to spread out empty package ?
Select gear icon on project window -> Hide Empty Middle Package 

Project Structure 
About .idea folder 
  • Has project related configuration.
  • All file need to be check in except following 
    • workspace.xml , belongs to current user 
    • tasks.xml if present , belongs to current user 
About ProjectName.iml 
  • This is projects main configuration file, should be checked in.
  • It determines nature of project and location of project source control file.
About out dir
  • It contains compiled file. Not need to check in.
External Library 
  • Contains jar , Not need to check in.
How to get online help regarding window? 
press F1 window , it will open url in browser 

How to add javaDoc ?
File -> Other Settings -> Default Project Structure -> SDK -> Documentation Path -> +
(Shift + F1  to go online Doc Direct)

How to add jar explicitly ?
Two ways 
File -> Project Structure -> Libraries

2]  Add new dir in project , add jar in it.
Right click on jar then select add Library

How generate JavaDoc ?
Tools -> Generate JavaDoc

How package classes in jar ?
File -> Project Structure -> Artefact -> + 
   Then
Build -> Build Artifact

How to run Jar ?
java -jar JarName.jar

How to Integrate GIT ?
1] Download GIT
Then 
VCS -> Enable Version Control  -> Select Git

How to open Different tool window ?
View -> Tool Window 

What is Gist ?
Awesome way to share code to public on GitHub.

How to create java method in scala ?
Just copy and paste, Intellij convert it automatically.