Java installation for VSCode

 Java in VS Code

Download Java extension in VS code as package it will install all dependencies as well like Maven and Gragle for Java.

You can create a Java project and can select for Maven project quickguide and then fillt he information and select the destination folder and it will make the think ready for you.

Maven will work like charm and will install all dependencies as per expectation.

To add any new dependencies into your java project you need to edit POM file and need to add new dependies under dependencies tag if it is not present in your POM and create one.

Once dependencies tag is added to POM file VS code will ask for sync your config file press yes for it.

It will help to build java project and test it by using VS code test icon.
Junit will help you to write test classes and you can call your code method to test for desired result and can modify the code to check edge cases.

For debugger you can work with your class code which has main function and then you can debug it step by step.

If you have build java project by using VS code extensions then you will receive option for run and debug in your main function and it will be very helpful as it will provide you all powerful features on your finger tip to debug the program like a pro as code become very tedious debug. You have to define breakpoint and then can click on debug option and debug window will pop-up and will assist you.

Debug mode will show you watch window and stack window to show right stack position of your methods along with it's heirarchy. It will show the list of breakpoint as well. On every click of step over you will see the local variable entry for validation. You can highlight over the code for variable information and then right click to evaluate it to show result on terminal for verification.

VS code also provide hot code replacing option for code replacement with right one. It will allow you to check your new code without restarting you debugger as debugger can adapt to new change just you need to select hot code replace option present in debug window option.

In your run and debug option you can go for creating json config for debug and run configuration where VS code will create the config file for you with absalute path for your Java project and allow you to run the test form option itself and you can navigate option window for different files for debugging. Debugger will open the code file for you at the time of debug run.

VS code will even help to create quick boiler code and will help to fix issues and can help to complete code as early and easily as possible. Just make a right click and then can to source action and then you can generate getter and setters for your work. As it will open list of methods and tasks which you can do with it. You can refactor any java file and VS code will refactor all codes which are using it automatically.

Jut press cntrl + P and then search for format and then go for java open foramtting setting and VS code will take care of formatting.





Comments

Popular posts from this blog

Inheritance and Polymorphism

OOPS concept 1