You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no bytecode version warning when compiling with a dependency that is higher than the target. e.g. compiling with scala compiler 2.10.0-M4 with JDK6 with a dependency jar of java 7 doesn't raise warnings (maybe it shouldn't be allowed at all, because it only leads to confusion). So the client code is silently compiled to bytecode 49. When running on jre5 or jre6 this results in an error:
C:\java-gearman-service-0.6.1>java -cp .;java-gearman-service-0.6.1.jar;slf4j-api-1.6.4.jar;slf4j-simple-1.6.4.jar;c:\scala-2.10.0-M4\lib\* echo.EchoWorkerServer
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/gearman/GearmanFunction : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at echo.EchoWorkerServer$.<init>(EchoWorkerServer.scala:10)
at echo.EchoWorkerServer$.<clinit>(EchoWorkerServer.scala)
at echo.EchoWorkerServer.main(EchoWorkerServer.scala)
The java compiler does raise warnings. It is probably recommendable to compile to a target of the highest bytecode version of the dependencies to avoid versioning problems in the depedency chain in runtime.
C:\java-gearman-service-0.6.1\examples>javac -cp .;..\java-gearman-service-0.6.1.jar -d . *java
warning: org\gearman\Gearman.class(org\gearman:Gearman.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
And by default it would compile to bytecode 51.
The text was updated successfully, but these errors were encountered:
There is no bytecode version warning when compiling with a dependency that is higher than the target. e.g. compiling with scala compiler 2.10.0-M4 with JDK6 with a dependency jar of java 7 doesn't raise warnings (maybe it shouldn't be allowed at all, because it only leads to confusion). So the client code is silently compiled to bytecode 49. When running on jre5 or jre6 this results in an error:
The java compiler does raise warnings. It is probably recommendable to compile to a target of the highest bytecode version of the dependencies to avoid versioning problems in the depedency chain in runtime.
And by default it would compile to bytecode 51.
The text was updated successfully, but these errors were encountered: