#1520 ✓resolved
Oleg Šelajev

Play 1.2.5rc3 doesn't work with java5

Reported by Oleg Šelajev | May 11th, 2012 @ 08:58 AM | in 1.2.5 (closed)

Framework version: 1.2.5rc3

Platform you're using: Linux Mint 12 (64 bit)

Reproduction steps: ensure that you've java 5 in path.

shelajev@elephant ~/repo/java5 » java -version 1 ↵
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Server VM (build 1.5.0_22-b03, mixed mode)

Create new project:
shelajev@elephant ~/repo » play new java5
~ _ _ ~ _ | | _ _ | | ~ | ' \| |/ ' | || || ~ | /||_|_ () ~ |_| |__/
~ ~ play! 1.2.5rc3, http://www.playframework.org ~ ~ The new application will be created in /home/shelajev/repo/java5 ~ What is the application name? [java5] ~ ~ OK, the application is created. ~ Start it with : play run java5 ~ Have fun! ~

shelajev@elephant ~/repo » cd java5
shelajev@elephant ~/repo/java5 » play precompile
~ _ _ ~ _ | | _ _ | | ~ | ' \| |/ ' | || || ~ | /||_|_ () ~ |_| |__/
~ ~ play! 1.2.5rc3, http://www.playframework.org ~ Listening for transport dt_socket at address: 8000
11:49:29,808 INFO ~ Starting /home/shelajev/repo/java5
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at play.plugins.PluginCollection.loadPlugins(PluginCollection.java:168)
at play.Play.init(Play.java:294)
at play.server.Server.main(Server.java:159)

Details:
When I try to build play with java5 ()
shelajev@elephant ~/applications/play-1.2.5rc3/framework » ant
Buildfile: /home/shelajev/applications/play-1.2.5rc3/framework/build.xml

clean:
[delete] Deleting: /home/shelajev/applications/play-1.2.5rc3/framework/src/play/version

clean-unittest:

version:

 [exec] Result: 128
 [echo] Version 1.2.x-localbuild

compile:

[mkdir] Created dir: /home/shelajev/applications/play-1.2.5rc3/framework/classes
[javac] /home/shelajev/applications/play-1.2.5rc3/framework/build.xml:67: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 271 source files to /home/shelajev/applications/play-1.2.5rc3/framework/classes
[javac] /home/shelajev/applications/play-1.2.5rc3/framework/src/play/db/DB.java:9: cannot access org.hibernate.internal.SessionImpl
[javac] bad class file: /home/shelajev/applications/play-1.2.5rc3/framework/lib/hibernate-core-4.1.3.Final.jar(org/hibernate/internal/SessionImpl.class)
[javac] class file has wrong version 50.0, should be 49.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] import org.hibernate.internal.SessionImpl;
[javac]                               ^
[javac] 1 error

BUILD FAILED
/home/shelajev/applications/play-1.2.5rc3/framework/build.xml:67: Compile failed; see the compiler error output for details.

Total time: 2 seconds

Comments and changes to this ticket

  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 09:00 AM

    • State changed from “new” to “inprogress”
    • Assigned user set to “Nicolas Leroux”
    • Milestone set to 1.2.5
    • Milestone order changed from “1115” to “0”

    Thanks, will fixed that ASAP

  • Play Duck
  • Play Duck
  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 10:15 AM

    • State changed from “inprogress” to “resolved”

    Could you test with the current 1.2.x branch now? I have no jdk1.5 handy. Thanks

  • Neeme Praks

    Neeme Praks May 11th, 2012 @ 10:19 AM

    You are on OS X Lion? http://www.s-seven.net/java_15_lion
    If Play! is serious about supporting Java 1.5, you should also be able to test it with Java 1.5. It is not that difficult to install.

  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 10:21 AM

    The java 1.5 support is about hibernate 4.1. I don't have the time right now to do that. Apparently you have it installed, so how about you are helping me and you are telling me if it is ok?

  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 10:39 AM

    • State changed from “resolved” to “wontfix”

    Ok hibernate 4.1 requires JDK 1.6, sorry guys...

  • Oleg Šelajev

    Oleg Šelajev May 11th, 2012 @ 10:47 AM

    It's not even that:

    shelajev@elephant ~/repo/play/framework ±master » ant
    Buildfile: /home/shelajev/repo/play/framework/build.xml

    clean:
    [delete] Deleting directory /home/shelajev/repo/play/framework/classes [delete] Deleting: /home/shelajev/repo/play/framework/src/play/version

    clean-unittest:

    version:

     [echo] Version master-cfbbce3
    

    compile:

    [mkdir] Created dir: /home/shelajev/repo/play/framework/classes
    [javac] /home/shelajev/repo/play/framework/build.xml:67: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 278 source files to /home/shelajev/repo/play/framework/classes
    [javac] /home/shelajev/repo/play/framework/src/play/classloading/enhancers/LVEnhancer.java:16: cannot access bytecodeparser.analysis.decoders.DecodedMethodInvocationOp
    [javac] bad class file: /home/shelajev/repo/play/framework/lib/bytecodeparser-0.3.jar(bytecodeparser/analysis/decoders/DecodedMethodInvocationOp.class)
    [javac] class file has wrong version 50.0, should be 49.0
    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
    [javac] import bytecodeparser.analysis.decoders.DecodedMethodInvocationOp;
    [javac]                                         ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:151: cannot find symbol
    [javac] symbol  : class Validation
    [javac] location: class play.mvc.Controller
    [javac]     protected static Validation validation = null;
    [javac]                      ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:208: cannot find symbol
    [javac] symbol  : class XStream
    [javac] location: class play.mvc.Controller
    [javac]     protected static void renderXml(Object o, XStream xstream) {
    [javac]                                               ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:336: cannot find symbol
    [javac] symbol  : class Type
    [javac] location: class play.mvc.Controller
    [javac]     protected static void renderJSON(Object o, Type type) {
    [javac]                                                ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:345: cannot find symbol
    [javac] symbol  : class JsonSerializer
    [javac] location: class play.mvc.Controller
    [javac]     protected static void renderJSON(Object o, JsonSerializer<?>... adapters) {
    [javac]                                                ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:894: package F does not exist
    [javac]     protected static void await(String timeout, F.Action0 callback) {
    [javac]                                                  ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:978: package F does not exist
    [javac]     protected static void await(int millis, F.Action0 callback) {
    [javac]                                              ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:1059: package F does not exist
    [javac]     protected static <T> void await(Future<T> future, F.Action<T> callback) {
    [javac]                                                        ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:1070: cannot find symbol
    [javac] symbol  : class ActionDefinition
    [javac] location: class play.mvc.Controller
    [javac]     public static ThreadLocal<ActionDefinition> _currentReverse = new ThreadLocal<ActionDefinition>();
    [javac]                               ^
    [javac] /home/shelajev/repo/play/framework/src/play/mvc/Controller.java:1084: cannot find symbol
    [javac] symbol  : class ActionDefinition
    [javac] location: class play.mvc.Controller
    [javac]     protected static ActionDefinition reverse() {
    [javac]                      ^
    [javac] /home/shelajev/repo/play/framework/src/play/classloading/enhancers/LVEnhancer.java:32: cannot find symbol
    [javac] symbol  : class ApplicationClass
    [javac] location: class play.classloading.enhancers.LVEnhancer
    [javac]     public void enhanceThisClass(ApplicationClass applicationClass)
    [javac]                                  ^
    [javac] /home/shelajev/repo/play/framework/src/play/classloading/enhancers/LVEnhancer.java:163: cannot find symbol
    [javac] symbol  : class FrameIterator
    [javac] location: class play.classloading.enhancers.LVEnhancer
    [javac]     private static void insert(Bytecode b, CtClass ctClass, CtBehavior behavior, CodeAttribute codeAttribute, FrameIterator iterator, Frame frame, boolean after) throws CompileError, BadBytecode, NotFoundException {
    [javac]                                                                                                               ^
    [javac] /home/shelajev/repo/play/framework/src/play/classloading/enhancers/LVEnhancer.java:163: cannot find symbol
    [javac] symbol  : class Frame
    [javac] location: class play.classloading.enhancers.LVEnhancer
    [javac]     private static void insert(Bytecode b, CtClass ctClass, CtBehavior behavior, CodeAttribute codeAttribute, FrameIterator iterator, Frame frame, boolean after) throws CompileError, BadBytecode, NotFoundException {
    [javac]                                                                                                                                       ^
    [javac] 13 errors
    

    BUILD FAILED
    /home/shelajev/repo/play/framework/build.xml:67: Compile failed; see the compiler error output for details.

    Total time: 2 seconds

    It's not even hibernate 4.1, bunch of things don't compile, so it still doesn't work with java5.

    Please update then the:
    "Prerequisites To run the Play framework, you need Java 5 or later. "

    from the 1.2.5 version of this: http://www.playframework.org/documentation/1.2.4/install

    Thanks

  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 10:50 AM

    Yes you are right, I am updating the doc. You should test with the 1.2.x branch btw.

  • Neeme Praks

    Neeme Praks May 11th, 2012 @ 10:56 AM

    Do you mean that starting from 1.2.5, Play will require Java 6 or newer? That doesn't sound like a minor release anymore.

    And, I'm unable to find the information where it is stated that Hibernate 4.1 requires Java 6.
    Front page of Hibernate (http://www.hibernate.org/) says "Java SE 5.0" (on the PNG).
    http://www.hibernate.org/quick-start.html page says also "JDK 1.5" (although the Hibernate version seems to be out-of-date there).

  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 10:59 AM

    A core dev from hibernate just told me that jdk6 was required.

  • Neeme Praks

    Neeme Praks May 11th, 2012 @ 11:12 AM

    So your message is:
    In Play 1.2.4 Hibernate 3.x was included with Play. Now, in Play 1.2.5 Hibernate 4.x will be included with Play. BTW, this will bump the required Java version to 6.

    If you are serious about your users, then you have two options:
    1. keep on using Hibernate 3.x for Play 1.2.x. You could release also Play 1.3.x that would bump Hibernate version to 4.x.
    2. release two different flavors of Play 1.2.5, one with Hibernate 3.x and other with Hibernate 4.x

  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 11:21 AM

    Or we could release 1.2.5 with jdk6 support which I really don't think is a big deal. User that cannot use jdk6 could stay on the 1.2.4. I think this is a really simple and natural way. JDK1.5 is no more supported by Oracle after all. How many users are still required to use the jdk 1.5?

  • Nicolas Leroux
  • Neeme Praks

    Neeme Praks May 11th, 2012 @ 11:55 AM

    Oh well.

    User that cannot use jdk6 could stay on the 1.2.4

    Are you suggesting that upgrade to Hibernate 4.x is THE ONLY change in Play 1.2.5? Or are there perhaps also some other bugfixes that people might find useful? Furthermore, 1.2.5 will most probably not be the last version of Play on the 1.2.x branch, right?

    Any responsible framework author knows that you cannot introduce a MAJOR change in a minor/bugfix release. Man, people depend on you!

    Most elegant way out of this would be to release 1.2.5 (with Hibernate 3.x) and 1.3.x (with Hibernate 4.x). Yes, it is a hassle.
    Or, you can just rename 1.2.5 to 1.3.0 - this is also acceptable.
    If you do not want to maintain 1.2.x branch, I know several people who are willing to do that. Otherwise we will just fork and do it anyway.

    JDK1.5 is no more supported by Oracle after all.

    This is not too relevant for this discussion.

    How many users are still required to use the jdk 1.5?

    You tell me.
    We have a requirement to use JDK 1.5 (or newer) - it is a product and unless there is some VERY GOOD REASON, we just cannot tell our users that we stopped supporting Java 1.5. And Hibernate 4.x is not good enough reason for us.

    If you will release 1.2.5 with requirement to use Java 6, then we have no other choice than to fork.

  • Nicolas Leroux

    Nicolas Leroux May 11th, 2012 @ 12:02 PM

    Can you please stay calm? I am looking for solution that will work for everyone. Some users are also looking for hibernate 4 and you are not the only one here. That is why I am asking the user community as well.

  • Neeme Praks

    Neeme Praks May 11th, 2012 @ 12:13 PM

    I hear you, that is the reason why I suggested to release Hibernate 4.x support as Play! 1.3.x. ;-)

  • Nicolas Leroux

    Nicolas Leroux May 15th, 2012 @ 06:56 PM

    • State changed from “wontfix” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2>Play framework</h2>

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the <a href="http://www.playframework.org">http://www.playframework.org</a> website.<br><br>

<h2>Source code is hosted on github</h2>Check out our repository at <a href="http://github.com/playframework/play">http://github.com/playframework/play</a><br><br>

<h2>Contributing, creating a patch</h2> Please read the <a href="http://play.lighthouseapp.com/projects/57987/contributor-guide">contributor guide</a><br><br>

<h2>Reporting Security Vulnerabilities</h2> Since all bug reports are public, please report any security vulnerability directly to <em>guillaume dot bort at gmail dot com</em>.<br><br>

<h2>Creating a bug report</h2> Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.<br><br>

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.<br><br>

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.

Pages