Is it possible to upgrade 2.4x to 2.6x directly?

Hey, I am new to play framework and development, current play version of my project is 2.4.11. I want to upgrade it to 2.6. While reading the docs related to migration I found that first I have to update it to 2.5x then only I will be able to update it to 2.6 later as a next step.
Just wanted to know that is it possible to update it directly to 2.6x from 2.4x? and how to do it?

Sure you can upgrade directly. You’ll still need to follow all the steps in both the 2.5 and 2.6 migration guides because you need to account for all the changes made in both versions. If you have a very simple app there might not be much you need to change apart from changing versions in plugins.sbt.

1 Like

Update from 2.4 to 2.6 will not be a problem if you does not have problems upgrading to 2.5.
Where it will be problematic, is if you used plugins that does not have support with Play 2.6 (like the play2-war-plugin, or this redis plugin). In this case, this implies to find/write an alternative or help to patch them.

thanks.
while migrating the project I am getting this error in my routes file
" Could not write class router/Routes because it exceeds JVM code size limits. Method documentation’s code too large!"
This file was working fine before. I have shifted ~50 routes from it to another file routes2. Still compilation fails due to this error. Any idea?

Hi @shreya,

Well, there is a limit for the method size in the JVM. It is 65535 bytes. From the JVM Specification:

code_length

The value of the code_length item gives the number of bytes in the code array for this method.

The value of code_length must be greater than zero (as the code array must not be empty) and less than 65536.

What is happening then, is that you have so many routes that when generating the documentation, exceeds the limit described above.

I can see that the routes template used to generate the Routes.scala file changed slightly from 2.4:

To 2.6:

The workaround here is to split your routes into smaller files and include them in the main routes file. Moving only 50 routes were not enough. How many do you have?

Best.