To be honest, I’m not sure my feature image is Java, but I thought it looked cool, lol. However, due to the nature of a certain pandemic, I have had some free time to re-learn things of interest to me. This has lead me to start a new series called What I Learned Today, or WILT, to keep track of what I have done. One of the items on top of my list to learn is Java. I have used Java in the past, but never enough to say I had any expertise in it. Rather than trying to pick up from when I last touched Java, I decided to begin from scratch.
The first thing I had to do was install the latest Java version on my MacBook. Previously, I would have batch installations that would install everything I needed. However, this time I decided to take a closer look at the inner workings. Such a shame, but I honestly had no idea about the differences between Java Standard Edition (SE) and Enterprise Edition (EE) until this point. I learned that both editions have the core API functionality such as security, networking, and database access. However, EE is built on top of SE, but has functionality for developing large-scale applications. That was interesting to learn – so good thing I started from ground zero.
After doing some research, I ended up installing the standard edition. Now with that done, I decide to write a hello world program and use Terminal to compile my java code and execute it.
I first created a Hello.java file in Terminal:
$ touch Hello.java
Adding code to the java file:
Now, I need to compile the java class into bytecode and class files using the javac tool and then run the code. Here is the entire process:
You can see I had some syntax errors as well. Fun stuff. Can’t wait to dig into more Java.
Happy coding!