0

I currently use the Play framework using Java (actually the 1.x series) and by far the best part of using Play, what makes it hugely productive is it's inherent, transparent, comprehensive, quick, seamless 'hot reload' capability. I simply could not return to doing Java development where I don't have this.

I do however have issues with Play in general including, but not limited to, the general lack of emphasis on Java as opposed to Scala development on the platform.

So doing a bit of research on current alternatives (I previously used to do Spring J2EE development) I stumbled across JHipster which on the surface looks promising.

So can people tell me the options of using JHipster with an 'easy' hot reload setup. Are we talking about using JRebel (which is expensive) or are there other alternatives? Is it straightforward to setup and does it work consistency? Anyone who has experience of this, I would be grateful for their comments.

Dan MacBean
  • 1,915
  • 3
  • 15
  • 21
  • 1
    I believe part of the JHipster stack is Spring Boot. Spring Boot has some dev tools in this area (although the docs note likely to be slower than JRebel). https://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3 – Alan Hay Feb 03 '16 at 11:50
  • 2
    You can also get a free JRebel licence from the following "for personal, non-commercial use only. All you need to do is allow sharing your usage statistics on a social network." https://my.jrebel.com – Alan Hay Feb 03 '16 at 12:05
  • Thanks, I actually don't have a Facebook or Twitter account but my enquiry is for a personal (non-commercial project). Is it as simple as creating a Twitter account, and signing up through that, or are there further requirements? – Dan MacBean Feb 03 '16 at 17:56
  • 1
    Yes, it's as simple as that. – Henri Viik Feb 04 '16 at 11:48

2 Answers2

1

JHipster gives you 2 types of "hot reload" features. They are both free and Open Source, and work consistently. I know lots of people (including me) using them daily.

  • The Spring Boot devtools allow you to have hot reload of your Java code. This is quite close to what Play! or JRebel provide. It has also been improved by JHipster to include database updates using Liquibase, something that JRebel or Play do not provide.
  • BrowserSync, which gives you hot reload of your front end (AngularJS) code. This is a very different focus: this means your Web browser gets automatically refreshed when code is changed.

It is the consistent usage of both those "hot reload" features that makes JHipster powerful. I often generate big parts of my application, and I have the database, Java code, and browser all refreshed automatically on-the-fly.

Julien Dubois
  • 3,678
  • 1
  • 20
  • 22
1

I'm in the same corner than you, looking for something better than play one in the java space, it has not been an easy task, we continue using play 1.4.1.

But going to your question, like you, we finally get to Spring Boot and to JHipster; Mat Raible presentation in Devoxx is very convincing.

For hot reload of Thymeleaf Templates, it's neccesary to add next two lines in application.properties:

spring.thymeleaf.cache=false
spring.thymeleaf.mode=LEGACYHTML5

Hot Reload Java

To have hot reloading in spring boot it's necessary to use the spring loaded project, download it and and let it somewhere in your disk.

To activate spring loaded, at least in Spring Tool Suite (eclipse) you need to add the jar as an agent in section VM Arguments of run configuration:

-Djava.security.egd=file:/dev/./urandom -javaagent:/home/hans/Descargas/springloaded-1.2.5.RELEASE.jar -noverify

It's not as cool as play one, it's necessary to restart the server from time to time, but it works.

Hans Poo
  • 804
  • 1
  • 8
  • 17