Tuesday, July 14, 2015

Eclipse

- Most easy one and effective one compared with other IDE's(Netbeans, BlueJ, JCreator)

- To get rid of command prompt we can use Eclipse

- Eclipse is Java's IDE(Integrated Development Environment)

- Eclipse - > select workspace(location where you wanted to save your programs) -> create java project (File-> new-> others->java project) ->Name the project and set the class path -> set JRE(if not seen the configure explicitly)

- Configuring JRE in eclipse : Follow above path, while creating a new project make sure JRE is configured.

Click configure -> select the folder where JRE is stored or you can also give your JDK folder.

Add JRE -> select Standard VM -> selct next -> give JRE folder name in directory -> Finish


- JRE should be configured before you run the java program

- Java settings will have:

Source -> where to save java program and compiled fileds(.class) files to be stored. You can even change the default folder names

- Folders under the java project in eclipse are:
.settings
.bin
src  ----- has .java files
.classpath ---- its where jar files are called, path is mentioned. When import statement is used in the code, it implicitly calls the import class file from the jar file
.project -----

- Java Build path: Has following sections

Source
Projects
Libraries
Order and Export

- SDE Plugins

Code Analyzer   --- Scans java code and identifies potential problems like performance, coding standard voilations(opened the DB but not closed) Ex: PMP, CPD and Checkstyle Ex: VSS, SVN
Configuration Management --- Used for organizing and maintain the versions of the software program.
Testing --- Automated scripts for Unit testing of the application, generate and publish reports Ex: JUnit
Build Tool -- Tool for building package application and automating the build/deploy process Ex: ANT and MAVEN


- Preferences ---- Will increase the font size

- Use Ctrl+space to get the methods, variables and syntaxes of methods.
Ex: main+ ctrl+space ---- will give you the syntax of the main method

- Outline --- will give you list of methods and variables used

- Debugger --- helps you to identify the values of the variables in java class and you can change those values in run time. Helps you test the code.

Stop the eclipse run at one point of line of code -> Debugger(bug icon) in the menu bar->Debug as -> java application


- Select Project -> Build Automatically --- means the code gets compiled automatically we need not do it manually

- In the console you have red button, when you are running the code and wanted to stop it, you can do it by clicking the red button. And also console will show results.

- Windows -> Preferences -> helps in changing the font, colors, adding line numbers to each line of code, change control keys(commands) like ctrl+shift f9 etc...




- Perspective ( C/C++....debug mode all these are perspectives)--change the settings and save the perspectives. This is generally a display that you see when you open eclipse.


- Project Explorer: 

Classes and Packages are shown in different folders.

- Navigator:

Navigator is like actual folder structure in Windows.

- Eclipse could also be used for C and C++ along with Java program.

- Build Project/Build configuaration in Eclipse??


- Syntax checker:

- Tasks:

- Search: Search in menu bar helps in searching particular string in a code, and when you click on one of the results in displayed in the bar below, it will take you to the line of code.

Select text ... Go to Search -> Occurance in File -> Identfier--- this will give the instances of the text in the code.


- Disconnect vs Terminate:


Debugger: Use Run As Debug mode instead of just run as Java application.
Step into(F5), Step over(F6), Step Return(F7) -- are common debugging tools.

in - into that function

over - execute entire function

return - we skip rest of the method


- Console: is where results are displayed. Floating console, will be created by dragging console outside eclipse window.

Run -> External Tools: Configure tools option, will help you create windows console and run commands on the console for the same.

- Bookmarks

- Marker bar (left side bar in editor)

- Breakpoint ---point where you wanted to stop your execution. You could create breakpoint select marker bar and double click. In debug mode you could see that code has stopped.

- Expanding Eclipse: We could add approx 9 million add ons to the eclipse.

http://marketplace.eclipse.org

or
help -> Eclipse Marketplace


Addons include:

a. WindowBuilder -- for graphical related activities

- Outline tab in Eclipse will help you to view list of functions in your application.

- Commit code to Bit bucket. Push code to master in Bit bucket 

Right click on project-> Team-> Commit
Same as above , instead of Commit  select Push to branch





5 comments:

  1. Once we download Eclipse do we still need to download Java software?

    ReplyDelete
    Replies
    1. To write programs in Eclipse we will definetly need Java(JDK). If you just download JRE, you will be still be good but only can run java programs but cannot write java programs until we have JDK installed on your machine.

      Delete
  2. Why do we need just JRE to run programs on Eclipse?

    ReplyDelete
  3. Eclipse itself is designed by Java, and as JAva is platform independent language as we just need class file to execute on any platform using JRE.

    So java programs on Eclipse need JRE to run on it. .....But need more clarity on like how class files are generated in java without JDK or eclipse does have JDK?

    ReplyDelete