Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Sunday, June 28, 2020

IntelliJ Keymap


I started using IntelliJ recently. Here is the key map that can be useful:




References:
https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf

Sunday, June 7, 2020

JShell Overview


JShell helps developers to quickly test java code snippets in an interactive shell. Many other languages (Python, ..) also have such interactive shells. Java introduced JShell in as part of JDK 9.

Here is a sample JShell session I tried:




I haven't read and tried everything thats possible in JShell, gave a cursory read of https://docs.oracle.com/javase/9/jshell/toc.htm. I felt this resource was quite useful and covers JShell capabilities reasonably.


References:
https://docs.oracle.com/javase/9/jshell/toc.htm
https://developers.redhat.com/blog/2017/10/03/use-jshell-command-line-tool-introduced-jdk-9/

Getting Started with Java in IntelliJ IDE


I have been using 
VSCode IDE a bit. However, my team at Salesforce uses IntelliJ IDE (Ultimate Edition). So, I decided to give it a try. Here are the steps to get started with a sample project (say, the usual "Hello World !!") in Java.


1) Install Java JDK for Mac: I think it was already installed earlier. So, didn't have to do this step in my case.


2) Install IntelliJ Community Edition: https://www.jetbrains.com/idea/download/#section=mac. I am using MAC. But, if your OS is different, choose the platform appropriately.


3) Install. Move IntelliJ to Applications folder. This created an icon like this in Mac's Launchpad:

                                                           










4) Create a new project in IntelliJ: 








I created and named my Project "HelloWorld". I think the project name should start with an upper case letter?




5) I then created a new class named "HelloWorld" and filled in a few lines of code (some of it getting auto-filled). 
When I clicked "Run", the program output "Hello World !!" on the console pane.







Hope this helps.

Wednesday, April 29, 2020

Getting Started with Java in VSCode IDE


I started picking up Java recently. Here are the steps to get started with a sample project (say, the usual "Hello World !!") in Java.



1) Install Java JDK for Mac: I think it was already installed earlier. So, didn't have to do this step in my case.


2) Install VSCode: https://code.visualstudio.com/download. A friend of mine suggested to use VSCode, so I'm going to give it a try.


3) Install. Move VSCode to Applications folder. This created an icon like this in Mac's Launchpad:


                                                              









4) Create a new workspace in VSCode by choosing "Add Workspace Folder". 





I created and named my workspace folder "HelloWorld". 





5) I then created a file named "HelloWorld.java" and filled in a few lines of code (some of it getting auto-filled). After I completed typing public static void main method's prototype, I got "Run | Debug" appear on top of it automatically.


When I clicked "Run", the program output "Hello World !!" on the console pane.






Hope this helps.



UA-48797665-1