Monday, 8 May 2017

Installing Groovy - which version to go for?

Since we released the Groovy course, there have been some changes to the hosting of the Groovy distribution files. The newer versions of Groovy are completely compatible with the course, so you're fine to use any, but you'll need to download them from:

http://groovy-lang.org/download.html

Please note that for Windows users, the latest version may not have a windows installer available. To get started quickly you may wish to check a prior version with a Windows installer. At the time of creating this blog post, 2.4.11 is the latest stable version of Groovy, but if you want the Windows installer you'll need to get 2.4.10.

We also mention in this course that at the time of recording we were planning a course on Grails. We held off for the release of Grails 3, we knew that each version of Grails tends to break something in earlier versions / is not always backwards compatible. Unfortunately the Grails project has lost popularity in recent years (mainly due to political reasons I believe) and so a course on Grails has not been a viable option.

However for fans of the Groovy language, it's perfectly possible to create Spring Boot applications in Groovy - and indeed this is effectively where Grails was heading anyway. So Combining Groovy and our Spring MVC / Spring Boot courses will allow you to build production quality web applications in Groovy... and that's our recommended way forward!

Sunday, 7 May 2017

Errata for Hadoop course - Installing Java with Ubuntu

In chapter 4 of the Hadoop course we set up a new Virtual Machine, running Linux. This step is not needed if you're already using Linux or a Mac to run the course, but is needed for Windows users.

In the course we install the Java JDK version 7. However this is no longer available from the repositories, and you'll now need to use Java version 8. We've tested the course with this version of Java and are not aware of any issues.

To install Java version 8 issue the following command:

sudo apt-get install openjdk-8-jre-headless

instead of

sudo apt-get install openjdk-7-jre

Thursday, 27 April 2017

Errata - Java EE Module 1, Chapter 6

We've recently been made aware of a small issue which affects chapter 6 (the CDI chapter) of Java EE with Wildfly, Module 1. You might experience this issue if you're using some versions of Java 8 to create your project - we're aware it is a problem in Java 8.60 and above.

In the video we talk about the different ways to tell JavaEE which implementation of a particular interface should be injected at runtime, when multiple implementations exist in your project. We first demonstrate the @Default and @Alternative annotations, then we look at specifying the required implementation in beans.xml, and finally we discuss qualifiers, which allow us to specify a different implementation in one specific area of our code.

In the video, we end up with all 3 methods in our project in use at the same time, and this worked fine at the time of recording. However we have found that when you then add in your own custom annotations (such as @ProductionDao - the example we use in the video) the deployment might fail. It appears that there is a bug in Java 8 which means that you can't use custom annotations together with beans.xml.

So you are fine to use @Default and custom annotations together, but not beans.xml and custom annotations. As most users will agree that using @Default and @Alternative are much easier than editing the xml file, this probably won't cause much difficulty in practice, but if you are getting a message that the build has failed, this will be why. If you're following along with the chapter, simply remove beans.xml from your project, and you will be able to continue with no further issues.

Sunday, 5 March 2017

Why I have never attempted to teach JavaScript...

It must be time for the "which is the best programming language" debate again... Here's an interesting article that claims "Jobs-wise, you’d be hard-pressed to find a better language than Java as your primary programming language" - that does seem to reflect the reality we see... actually the comments are even more fascinating than the article! 

http://www.theregister.co.uk/…/03/03/pizza_roaches_and_java/

Monday, 17 October 2016

Unsatisfied Dependencies in Spring Boot 1.4?

My colleague, Richard Chesterwood has just posted on his blog about a problem with Spring Boot 1.4... if you're getting an issue with unsatisfied dependencies, check it out:

https://richardchesterwood.blogspot.co.uk/2016/10/spring-boot-crashing-due-to-unsatisfied.html

Tuesday, 23 August 2016

Tomcat problems with Java 8

If you're doing any of our courses that use Tomcat, be aware that the latest update to Java 8 (1.8.0_91) seems to have broken JSP compilations for all versions of Tomcat up to and including 8. We're not sure why this is happening, but as a quick fix either use Java 1.8.0_77 or earlier, OR use Tomcat 9 which is confirmed to fully support Java 8.
(Note that Tomcat 9 is still in Alpha, so doing this carries some risk - the safest choice is to use an earlier Java).
Thanks to all those who have reported this, and you can also follow a Stackoverflow post at http://stackoverflow.com/…/spring-mvc-unable-to-compile-cla…

Thursday, 26 March 2015

Java Advanced Course now live!

Today's an exciting day - we've just put the Java : Advanced Topics course live on the Virtual Pair Programmers' website.

I'm really pleased with this course - I think it is going to be really helpful to lots of Java developers - it covers topics which  you don't tend to learn about in most Java courses as they are that bit more advanced, but are vital for really good Java developers to know about

For example, we go into depth on how the LinkedHashMap actually works, what can go wrong when you're writing multi-threaded apps, and how to avoid it, and even how to load-test your application so that you can be sure it won't run out of memory when you put it onto the production server!

I hope you enjoy it!