How does JDK 7's support termination affect Android development - java

Oracle has announced that they stop the official updates for JRE 7 and JDK 7.
As much as I know, Google doesn't say anything about JDK 8, I guess the recommended version is JDK 7 for Android development.
Is JDK 8 officially supported for Android development?

The Google Android development page and, from there, the pre-requisites page list JDK7 as a requirement.
This has nothing to do with Oracle's JRE since the code made during Android development is never meant to run on that JRE - it's supposed to be turned into Dalvik bytecode and run under Android.
So the security concerns of Oracle's JRE are not really at issue here. Google supports JDK7 (insomuch as it pertains to Android development) so that's what you should be using, pending a clear statement of intent from Google.

It looks like Google doesn't officially support the JDK 8 for Android development. See paxdiablo's answer.
But let me add some thoughts.
I wanted to try using the JDK 8 anyway. So I downloaded and installed it, and used it (and Apache Ant) to build a simple Android app.
The app doesn't use any features which are new to Java 8, such as lambdas. In addition, Ant passed a parameter to javac asking it to emit bytecode compatible with older JREs.
The app compiled fine.
The app requires that I root my phone before running it. I haven't done so yet, and haven't tested the app yet either.
Please ping me with a comment in a few weeks. Ask me to update this answer and to let you know whether or not the app worked.

Related

Can I run a java program built using Java 8 (.192) using JRE 17, or does everything (JRE, JVM, JDK) have to be on the correct Java 8 version first?

I have a program for work that I'm told will only use Java version 8 update 192 to run correctly. When I downloaded eclipse, it's suggesting that I use JRE 17.0.2 but I recalled my coworker saying I need Java 8 update 192 otherwise it won't work. Does the JRE version matter? Is it irrelevant?
Perhaps I need to download JRE 8.192? I'm not sure. Any help would be appreciated.
I have a program for work that I'm told will only use Java version 8 update 192 to run correctly.
I would doubt the accuracy of that statement. I would say that someone is making a statement without evidence ... if that is what they actually said.
Maybe a more accurate statement is that the program is only known to run on that particular version ...
Anyway, it will probably run on a later version of Java 8, or Java 11. Java 17 is less certain because of the issue of package sealing / blocking of access to internal packages that occurred in Java 16. (Some of the sealing / blocking started in Java 9 ... but there are easy workarounds ...)
Q: Do you need a JRE?
A: No. A JDK will work just as well. (A JDK distro includes a JRE.) But unless there are strong counter-indications, you need the latest version of Java 8, 11 or 17. Java 8 u192 is years out of date.
The only way to be sure that the application will work on a particular version of Java is to try it. In general, there are no shortcuts.
Java 8 is still available, as the first Long-Term Support (LTS) version. The current release is Update 331. I would suggest starting with the latest update of Java 8.
Be aware that Java 8 is not receiving regular updates for the public except for critical security patches. You may want to consider paying for a support contract from any number of vendors such as Azul Systems or Oracle to get support including possible additional updates releases through the rest of this decade.
Generally Java apps will run on later versions of Java without any modifications needed. The Java team at Oracle and the OpenJDK community place a very high priority on preserving that compatibility.
However, there are exceptions to the compatibility policy. In particular: Java 9 introduced the Java Platform Module System which caused some problems in some apps. And in later versions of Java some libraries that were previously bundled are now removed. Some of those removed libraries were transferred to the Jakarta EE project at the Eclipse Foundation. Some were abandoned for lack of interest such as CORBA.
Some few parts of Java that were for years marked as “deprecated for eventual removal” have now been removed.
If you consider moving beyond Java 8, I suggest your first step be sitting down to read through the Release Notes for every release of Java. They are quite well-written. They should alert you to any issues that may affect your app.
FYI, Java 17 is the latest LTS version. Java 18 is current.
As in the other answers, an application built for Java 8 will probably work fine in Java 17, with some caveats, but if you absolutely need the final product to run under Java 8, go get a real Java 8 runtime and set it up in your IDE. Building a Java application for any specific Java version is best done by having an actual copy of that runtime present, preferably a JDK. By having an exact version of its standard library to compile against, you can avoid accidentally referring to packages, classes, and methods added to, or removed from, later versions. You can get an OpenJDK build of Java 8 from https://adoptium.net/?variant=openjdk8 . Be sure to ask your co-worker why they're mentioning an outdated patch version.
Additionally, keep in mind that Eclipse is itself a large Java application. Running it requires Java, and a growing number of downloads include a Java runtime for that simple reason, even the ones that do not include Java development tools. You don't have to compile your code against that version of Java, though--you probably don't even want to since JDK downloads will include JavaDoc for the standard library, among other useful extras.

How can i install Java 8 to Google Compute Engine (Debian 10)

First of all, I would like to say that I'm not a programmer and I am not experienced in the field. I was trying to set up a Minecraft server in the Google Compute Engine and I set it up successfuly. However, when I tried to switch it to a different version I could not open it because the server was running java 11. I removed it and tried a bunch of things to install Java 8 but I couldn't do it. Is there a way that i can reliably use to install java 8 to my server?
As you just pointed out, Debian 10's default and only officially supported java runtime is openjdk-11-jre.
Oracle provides their guide to download java on their website (https://java.com/en/download/help/linux_x64_install.html#download), which you can download, extract, and run.
I also found a nvidia-openjdk-8-jre package in the non-free repository of debian buster / bullseye. It exists for compatibility reasons and it's not recommendeded, but it might work.

Which Java Development Kit for Android development in IntelliJ Ultimate

I want to develop an Android application using IntelliJ Idea Ultimate and not Android Studio (since the Android development functionalities are the same, and Idea Ultimate offers me more flexibility for other tasks).
I installed the latest Android SDK but when configuring it on ItelliJ Idea it seems to not support the last JDK (v11).
I have read that Android studio ships with its own JDK (an OpenJDK distribution).
Which is the latest Oracle JDK I can use with Android SDK? Or, how do I get and which version should i get of OpenJDK, which can work with intelliJ Idea?
Thanks!
I very highly recommend using AndroidStudio, first and foremost.
I'm unsure of many reasons not to use AndroidStudio for Android Development.
The only reasons I could think of would be if you need to use Xamarin or Unity or something like that.
Do you mind me asking, out of curiosity, what specific features you would be missing vs iJ?
Anyhow, to answer your question:
JDK7-JDK8.. Pretty sure JDK8 is what would currently be supported, if not mistaken.
Does this help?

Error while importing the Java-1.7 project libraries into Android

I've asked a lot of questions the last days, because I couldn't include a .jar-File in my android-project (working with ant).
Today, I switched the Java-Version of this Common-Project to 1.6 and created a new .jar-File.
And noooow, it works!!
Can someone tell me, why Android (2.2) doesn't support Java 1.7?
Thank you!
Because when Android 2.2 was created, there was no Java 1.7.
Compare http://en.wikipedia.org/wiki/Android_version_history against http://en.wikipedia.org/wiki/Java_version_history
In addition to the timeline issue, there is also the issue that Android is not based on the Oracle Java codebase, and hence supporting Java 7 on Android is not simply a matter of porting existing code.
Does Android plan to support Java7?
Java 7 language features with Android
Indeed Java 7 adds a new bytecode, so that would entail a change to the Davlik VM to support it.

Eclipse 4.2 and Java 8

I found this page stating that Java 8 support for Juno is deffered, but I can't find more information how soon people can exspect to be able to write first closures in Eclipse and get productive with that stuff.
Has someone got insight how long we still have to wait? The Java7 features were in 3.7 really quickly, that's why it's kind of odd that this task is deferred.
Any comments, ideas? Or maybe even a good workaround?
One of the key reasons that Java 8 support was deferred is that Java 8 will be available after Eclipse Juno is released. A major release of Eclipse couldn't be shipped with functionality reliant on an unfinished Java release.
Java 7 support went through a similar issue with Eclipse Indigo. Tooling for Java 7 proceeded in a branch that was merged into main indigo stream after Java 7 shipped, so you saw tooling support in Indigo SR1.
I would expect a similar situation for Java 8. There may be a branch open for this work already. The best place to check in on the status is in the bug that is referenced from the document that you found.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=380190
Java 8 will be released at some point after mid 2013, so there is still quite some time to go :-) Full support in Eclipse for Java 8 should not be expected before Java 8's release date, it was the same for Java 7 support.
Currently, there is no branch open for this work. However, whenever that does happen you can expect to see a few blog posts about it :-)
You may give IntelliJ Idea a try which has preliminary suport for it, see http://confluence.jetbrains.com/display/IDEADEV/IDEA+12+EAP

Categories