New to Java? Some Resources

In this tweet, I was asked if I had a list of resources for developers who are new to Java. I didn’t at the time, but I’ve spent some time researching and here is that list.

I’ve listed content that is both free and paid. It’s not that one type is superior; it’s just to give you plenty of choices. These are the resources that I’ve used and do still use to re-learn Java. So, if you’re new to Java or looking to pick it up again after a break, this blog is for you.

The other super important point is that everyone learns differently; some like reading, some like doing, some like watching, most of us like a bit of a mix of everything. I tend to switch between them depending on what I want to learn about and how I feel. You’re probably similar, so pick an approach that works for you.

Learning Platforms

Let’s start with learning platforms. There are plenty of them to choose from, so you can pick one that works for your learning and budget style.

JetBrains Academy is a reasonably new learning platform that I’ve been using to skill back up on Java. I’ve used it in conjunction with other learning materials. I like the mix of theory with practice tasks. Of course, the slick integration with IntelliJ IDEA is a bonus too.

I’ve also used Udemy in my Java learning travels. There is a wealth of content available here, and you can sample most of it before you buy.

Finally, I’ve played around with codewars. This is a nice gentle introduction to katas (more on them soon), irrespective of where you are on your coding journey. It’s less structured than either JetBrains Academy or Udemy and can provide some light coding respite when the mood takes you.

Communities

The Java community is a rich, vibrant and welcoming place. This is played out in the communities that have sprung up around it.

The Virtual JUG is what it sounds like; a virtual Java User Group that hosts talks and shares knowledge. They have a Slack and Meetup space, so you can hear great speakers, speak yourself and learn from your peers.

Since I’m based in the UK I also want to give a shout out to the London Java Community and the Manchester Java Community. They are both great resources of information and supportive communities. I fully expect that this is mirrored in other Java User Groups worldwide, so I recommend you find your nearest one (or set one up(!)) and get involved. Talking of getting involved, creating content is an excellent way to do that.

The Java Specialists is another active group run by @heinzkabutz. Heinz also has a newsletter that I recommend you take a look at.

The Code Ranch is a very friendly place for newcomers to Java where you can post questions, learn from others and try out coding questions. The forum is also really active (oh, and did I mention that everyone here is super lovely?).

Code Katas

I am a relative newcomer to code katas, but I really like them as a way of learning. They are self-contained mini-puzzles that you can solve at your leisure.

@TheDonRaab does a great job of keeping these updated for Eclipse Collections: https://github.com/eclipse/eclipse-collections-kata

@CGuntur has also created these Java Katas for you with really nice instructions and updates: https://github.com/c-guntur/java-katas

I’ve not started these yet, but I like the look of them because the tests are right there to look at.

Specific Java Resources (including Frameworks)

This is a bit of a catch-all section, but there are a few resources that I’ve come across that are amazingly useful; they are listed here.

This course from @techgirl1908 was one of the very first resources I used on my journey to familiarise myself with the last 20 years of Java. I found it to be well-paced, gentle and incredibly useful.

@marcobehler has created a lot of content around Java, and specifically, Spring. This blog, and this Spring course, it is a bit like an onion. It starts with life before Spring and builds up the complexities so that you feel like a wizard when using Spring (and subsequently Spring Boot) and understand how the magic is being done and why. I feel like there’s a spring onion pun there, but I’ll move swiftly on.

There is a wealth of Java information on the Baeldung site. I don’t have one specific blog to point to, but invariably when I’ve Googled Java something there is a blog on this site that explains how to do it. It always amazes me just how rich this content is in terms of quantity and quality (many authors contribute to it).

One more thing I do want to mention is the official Oracle documentation for Java. I say this because you don’t have to store the Java language in your head. There is no shame in looking stuff up (another reason why technical interviews are so broken). Spend your time on the artistic side of learning to code, not remembering stuff that is one Google search away. Sure, you’ll learn more in time, but it doesn’t need to be your priority when you are starting your Java journey.

Of course, there are plenty of dedicated Java blogs out there, which you can find with a quick Google, but I want to keep this list of resources specifically targeted at content that newcomers might find helpful and that I’ve used.

Books

I like books; arguably, I like them more than videos. As with all other resources I’ve listed here, there is no shortage of them. These are the ones that I specifically have found helpful.

Head First Java by Kathy Sierra and Bert Bates. Yes, this book is old on the scale of Java, but it’s still very, very good and will probably appeal to your brain’s way of learning. I started with this book, and I didn’t regret it.

97 Things Every Java Programmer Should Know. Am I including this because I work with @trisha_gee, no, I am including this because I got a lot of value from it. I liked the vast range of topics that I could dip in and out of it very quickly because all the content is standalone. Many very experienced Java professionals contributed to this, so in my mind, they are worth listening to!

Effective Java by Joshua Bloch this isn’t the book that you start with, but it’s a book with a relatively low barrier to entry, and a book that I got a lot of value from (and probably need to re-read now I have more knowledge).

Head First Design Patterns 2nd Edition. This book is so fresh off the printing line that the ink is likely still wet. I’m going to come clean and say that I don’t own this yet, but I plan to own it very soon. I do own the first edition, and it was excellent. I fully expect the second edition to be just as good, if not better. Design pattern knowledge and understanding will serve you well, no matter what your coding goals are.

Java Certification

A note about Java Oracle Certification: this tends to be one of those subjects that can polarise opinion. I think certification is very valuable for a deep understanding of the Java language, and it will serve you well if you want to study and obtain it. I don’t think you need to be certified as such, and I suspect that on the job knowledge of Java will provide you with an equally rich and diverse experience of the language, albeit from a different angle. It’s entirely up to you, but here are my recommendations for resources if you want to pursue Java certification.

There are excellent books available from Jeanne Boyarsky and Scott Selikoff. I haven’t taken the exam, but I have found the books very useful and the examples informative.

My colleague Mala Gupta is also a passionate advocate of Java Certifications and her book for Java SE 11 is in preview so that you can get your eyes on it already!

Goals, Learning Styles and Time

Irrespective of if you’re new to coding, new to Java specifically, or took a break from Java, this is a list of resources that will help you get up and running quickly. I suggest you find the ones that work for you and build your list. Invariably what works for one person might not work for the next, so feel free to explore the wealth of content out there. Your learning style will also play a part, as will the amount of time you have available.

Whatever you do, enjoy the journey and remember what your goals are. Never lose sight of the why; that’s what will get you to where you want to be.

New to IntelliJ IDEA? Me Too.

Until recently, I last wrote Java in anger in 2002. IntelliJ IDEA had just been released; it wasn’t remotely on my radar. I honestly can’t remember what IDE we were using back then, but it certainly was a very long way to the fully featured IDE that JetBrains produce today. Here’s my experience of using IntelliJ IDEA for the first time.

Downloading IntelliJ IDEA

There’s a lot going on when you first load IntelliJ IDEA, but I learned pretty quickly that there are also some good first steps you can take to make your experience a little more comfortable. The first thing I would say is that it’s an enterprise tool so there is a learning curve. There’s no getting around that – it’s the same with any new piece of enterprise software; you do need to give it some time and be willing to go on a learning journey. Fortunately for us, JetBrains have, in my opinion, done a very good job at supporting developers on that learning curve. So, if you’re sitting comfortably, here are my recommendations.

  1. Figure out which version of IntelliJ IDEA you need. I once offended my now-colleague Trisha Gee by asking her which IDE to use because I didn’t know that IntelliJ IDEA Community was free. Foolishly, I assumed that because it was an insanely powerful IDE that it couldn’t possibly be free. I was appropriately schooled by a rather irritated Trisha and told in no uncertain terms that I could use IntelliJ IDEA for FREE. Honestly? Mind blown. I then decided that there must be a catch, so I assumed (see a pattern here?) that it would only be free for me to muck about and not free for commercial development. Wrong again, Helen, wrong again.

  2. Next up, download JetBrains Toolbox, even if you’re only using IntelliJ IDEA. I promise you it’s worth it. This cute little box will sit on your toolbar, chill out and manage all the installs and updates to IntelliJ IDEA with minimal input from yourself. Use your new JetBrains toolbox to download the version of IntelliJ IDEA you require and manage your licensing requirements.

Okay, great! You’ve got a shiny version of IntelliJ IDEA downloaded. Let’s get started!

Running IntelliJ IDEA for the First Time

  1. You’ll be asked to choose between Darcula and Light for your UI theme. I am not getting into this argument. I like light, deal with it. Click Next: Default Plugins to move on (unless you’re in a rush in which case click Skip Remaining and Set Defaults). IntelliJ IDEA does a great job of selecting the plugins that you’re most likely to need – these are the Default plugins. You can disable some of them if you want to but if you’re not entirely sure just leave them because you can tinker with them later.

  2. Click Next: Featured plugins, this is a list of plugins that are the most common ones. Feel free to go rummaging around for plugins, but keep it real – the more plugins IntelliJ IDEA has, the more it has to deal with as well as being your awesome IDE. I recommend you build the plugins up so you get used to IntelliJ IDEA out-of-the-box-almost to start with. With that in mind, you should definitely go ahead and grab Key Promoter X and IDE Features Trainer if you’re new to IntelliJ IDEA (which you probably are given you’re reading this)! Now click Start Using IntelliJ.

Little note here, if you screw up your settings and want to unwrap IntelliJ IDEA all over again, go to File > Manage IDE Settings > Restore Default Settings. This is relatively new and can be a very useful learning experience. 

Starting a New Project in IntelliJ IDEA

  1. I’m going to go ahead and start a new project. Here’s where we need to sort our Java version out. IntelliJ IDEA is pretty smart about this. It will go and look for the Java versions you’ve already got installed, if there are any. If it finds them, it will populate the Project SDK with them. If it doesn’t find any it gives you an option to download them. You can select your Vendor and your Version and click Download. I recommend you leave the default Location because again, IntelliJ IDEA is smart and knows exactly where to look to find what it needs.

  2. You can select additional libraries here if you want to and you know what you want. I am going to leave them blank and click Next.

  3. Next up, we have Templates. You can create templates from existing projects to recreate later, however on new installations the only template available will be Command Line App. This is a boilerplate Java application with a class and a method. If you’re new to IntelliJ IDEA, it’s worth selecting this option just to get a feel for the file structure and inner workings.

  4. Go ahead and enter a Project name. The Project location will be constructed from the name although you can change it if required. If you want to change the Base package you can do but for now, I recommend you go ahead and click Finish.

And there you have it! One shiny new IntelliJ IDEA project!

A Note on the ‘Release Version’

If you’re anything like me, the first thing you do is throw caution to the wind and go change a bunch of settings in the IDE because you ‘know what you’re doing’. Well, turns out, I didn’t! So, word of warning – if you see this error, it means your ‘Project bytecode version’ is set to something higher than your ‘Project SDK’ (and thus Project language level)’:

Java release version not supported

Check your SDK setting by using ⌘; on macOS, or Ctrl+Alt+Shift+S on Windows/Linux and looking at your Project Settings > Project, specifically your Project SDK and Project Language Level values and make a note of them.

Project Structure

Next, check your Project Bytecode version by using ⌘, on macOS or Ctrl+Alt+S and search for Build, Execution, Deployment > Compiler > Java Compiler. Your Project bytecode setting needs to either be the same as your Project language level, or something lower than it, such as Java 11. Then you can rebuild the project.

Java Compiler Setting

Being new to IntelliJ IDEA, something else that I wondered was what’s the difference between the Project SDK and the Project language level. As it turns out, the Project SDK are the tools you need to develop Java (seems fair), whereas the Project Language Level refers to the assistance that IntelliJ IDEA will give you in the editor. The two settings can be different as well. Your Project language level will restrict what inspections IntelliJ IDEA applies to your code and determine which compiler is used to turn your Java code into bytecode. You can override the compiler settings as I showed above if you don’t want to compile your code with the Project Language Level.

Summary

I can remember hating getting my environment set up at university – and I screwed it up regularly too. There is absolutely no doubt that IntelliJ IDEA makes the whole process of running ‘HelloWorld.java’ a whole lot easier. It does a great job of obfuscating the settings until you need them and will hold your hand throughout the process of setting up your environment without you breaking into a sweat about your classpath setting. Yes, you can break it, but you can also fix it very easily.

The discussion of whether to use an IDE, or not, is one that polarises people. As someone returning to Java after a long period of absence, working with an IDE of this calibre is like having a really knowledgeable friend help you achieve your goal (to run HelloWorld.java) and just that, as quickly and as efficiently possible. I know I’m still scratching the surface of what IntelliJ IDEA can do, but I’m a huge fan of the right information at the right time (which is when I need it) and IntelliJ IDEA does this very well. I’m looking forward to finding out more!