Android AOSP modification errors out - java

I am trying to understand the flow of code in the native android. For the same, I downloaded the Android source code and built images for my android device.
I have the following java and javac versions in my system.
javac 1.7.0_79
java version "1.7.0_79"
When I make, every thing works as expected. i am able to create images and my device boots with those as well. Now I added some simple Logs on some the files like: Android/frameworks/base/core/java/android/app/ContextImpl.java and performed a make again. I get the error : java.lang.UnsupportedClassVersionError: com/google/doclava/Doclava : Unsupported major.minor version 51.0. I am not able to understand why I get this error when I just add a few Logs in one of the files. It should have occurred right at the first make as well, or not? I read a lot about this error and found it is because of the mismatch between run time and compile time versions. But I have Java 1.7 and javac 1.7. Anyone faced this before?

Related

Launch4j-FakeMain compiled by more recent version Java Runtime(class file version 55 0)this Java Runtime only recognizes class file version up to 52 0

This is my first application that i try to execute exe.
I'm using launch4j to do this. After executing and trying to run, I get this error:
Blockquote
Launch4j - Exception in thread "main" java.lang.UnsupportedClassVersionError: FakeMain has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I searched something about versions of java, so I checked my versions of java and they are the same.
That's my versions of java:
My versions of java in cmd
Maybe I did something wrong there?
Screen of Launch4j
I don't know what I can do. I spend all this day about fix this and nothing.
Error after try to run exe file
You have compiled the code with Java 11 as target. But your PC want's to execute the Java Code with Version 8, which is not possible.
Make sure you have installed the correct Versions and also make sure that the executable uses Java 11.
Here you can find the Java Versions mapped to the Runtime Versions: Java Version Numbers
The Article gives you also some information about how to compile and execute for the correct versions.

Does Japser Reports work with Java9

Im having trouble using Japser Reports with Java 9.
My JasperVersions:
<dependency.version.jasper>6.5.1</dependency.version.jasper>
When trying to build my Report i get the following error Message:
An internal error occurred during: "Building report".
java.lang.UnsupportedClassVersionError: my/path/to/my/class/User has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
the Error occurrs probbably because Jasper does not Support java 9 Classes. I cant find any information on this topic, does anyone have a Idea how to write a workaround or did i do some other mistake?
EDIT:
After searching some more i realised that the problem only happens when im in the Designer in Eclipse, so it is most likely that eclipse itselve is not running in a JVM 9. I checked for the current version of java installed and it is java9, when i change the eclipse.ini file from:
-Dosgi.requiredJavaVersion=1.8
to
-Dosgi.requiredJavaVersion=1.9
i get a incompatible jvm error which says that im trying to start it with 1.8.0_161. How do i change my settings that my eclipse is acutally using my current JDK?
RESOLVED:
The error was that my Eclipse itselve only run in Java8. So my Application was building everything in Java9, like i wanted it to, but when i was inside the jasperReports Designer, the designer itselve run in java8. Thats why it crashed. The solution was to change the systemvariables and put my JavaPath over the Oracle JavaPath that for some reason had a higher priority.
Code was compiled in Java version 9 but executed in Java 8 JVM, which not necessarily works. Try compiling it in Java 8, or executing it in Java 9 JVM.

Peculiar Eclipse java.lang.UnsupportedClassVersionError, Unsupported major.minor version 52.0

First of all, I'd like to point out that I am aware that this question has been asked countless times and I am aware of the usual solution. However, it doesn't seem to work for me.
When the error Exception in thread "main" java.lang.UnsupportedClassVersionError: org/telegram/mtproto/state/ConnectionInfo : Unsupported major.minor version 52.0 occurs, it is generally caused by compiling with an incompatible JDK-JRE combination. However, as shown by the images below, my setup seems to be in order:
Fig. 1. JDK Compliance
Fig. 2. JRE Setting
Fig. 3. Java Home
What seems to be the problem? What am I missing? I'm using Eclipse Luna, trying to run some Telegram API Layer 11 code (the code works I reckon, as it was used by others).
The JAVA_HOME environment variable is irrelevant to how Eclipse will run code, as far as I'm aware. Likewise the compiler settings you've shown for a project don't affect how code is run.
Instead, you need to look at the Run Configuration you're using when you run it, and check the environment there. Make sure you're using Java 8, and all should be well. Click on the triangle next to the Run button, and select "Run Configurations..." to open the dialog with all the settings. Then look at the JRE tab, and ensure you're using the right JRE.
i see that you have a 32bits JDK version for the JDK 1.8 and a 64bits version for the JDK 1.7
i you running your project on a 64bits machine try to use the 64bits version of JDK 1.8
Note: you must have a 64bits version for eclipse too

How to use the Play Framework with Google App Engine with locally installed Java 7?

I've just downloaded the latest version of the Play Framework (1.2.3) and am using it with the latest Scala plugin (0.9.1) and the Google App Engine module (1.4).
The default application works fine locally (at localhost:9000, the default port). I've also successfully published the default application to GAE using play gae:deploy.
However, when I go to the GAE remote URL, I get the standard error message:
Error: Server Error.
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
Here is the full stacktrace in the GAE logs: https://gist.github.com/1181257
I'm guessing the first error, the NPE, is due to something that can be easily fixed, so ignore that for now; however, note the second - critical - error, which says:
java.lang.UnsupportedClassVersionError: helpers/CheatSheetHelper$1 : Unsupported major.minor version 51.0
51.0 is (I think) the class version that the Java 7 compiler generates. Now, my question is simple:
How to force the Play Framework and its Scala plugin to compile the classes for GAE publishing using the -target 1.6 and -source 1.6 options, so that the output classes are 1.6 compatible, instead of the defaults, which make the local Java 7 installation generate 1.7 output classes?
Thanks.
[edit] As for the NPE, it seems that it's not thrown on Play 1.2.1 and the 0.9 version of the Scala plugin: Play framework with scala and GAE - again, this is just a side issue, the primary issue (getting Java 7 working) still stands. I've created a ticket for this: http://play.lighthouseapp.com/projects/74274-play-scala/tickets/45-nullpointerexception-on-google-app-engine
To get java 7 to work currently, you have to use the following configuration in your application.confirm file
java.source=1.6
See here for more details - VerifyError; Expecting a stack map frame in method controllers.Secure$Security.authentify
Java 7 is fully supported for Play 1.2.4 RC3 - give it a try and see if it solves your issues.
I just ran into the same issue. I'm running Java 7 and don't want to have all my other Java stuff run on 6 again. So, what I did was dump a copy of JDK 6 in a directory and then made a simple bash script to set the proper environment vars and call play. I then symlinked that script as "play" on my path. Now when play gets called it has a JDK 6 environment to run under without having to change everything else on the machine.
...less than ideal, but it works well enough and keeps everything clean.

Java Unsupported major.minor version 49.0 - where is it coming from?

I have downloaded the zxing Google QR code from SVN and used eclipse to edit one of the class files.
I've compiled the changes using ANT and it runs fine locally. When I run it on alive server I get an error:
500 com/google/zxing/client/j2se/MatrixToImageWriter (Unsupported major.minor version 49.0)
com/google/zxing/client/j2se/MatrixToImageWriter (Unsupported major.minor version 49.0)
I have tried compiling it in JDK 1.6 and 1.5 and I get the same error message. Is this something to do with editing the class file in eclipse, and eclipse saving it using a different JVM?
Live server is running 6.0.150
49.0 is Java 1.5, so it sounds like your server is expecting Java 1.4.

Categories