Does Android API 18 supports jdk1.7.0_80? - java

I use jdk1.7.0_80 for my project but there is a .jar file which apparently compiled with jdk1.6. I'm getting some exception related to that library and tells some files are not defined but I didn't modify anything related to that since six months ago. I want to know the conflict between used JDKs break something?

if you open old projects usually version conflicts will happen. gradle, android tools even android studio had an issue after upgrade. but in your case you say jar file compiled with 1.6 and java 7 had a problem. with java 8, my old jar file didnt created a problem in my project so you might want to delete jdk 7 and install jdk8update74, which is the latest version.

Related

Upgrading Project from JDK 6 to JDK 8

My current project is built on Java 6. I'm thinking of upgrading it to Java 8.
Here is the details of the build.properties
xdoclet.home=D:/**/xdoclet-1.2.3
jboss.deploy.dir=D:/**/jboss-6.1.0.Final
application.dir=D:/**/**/cal
middlegen.home=D:/**/middlegen-2.0-b1
compiler.home=C:/Program Files/Java/jdk1.6.0_24/bin/javac .
I've tried building the project on JDK 8 and it is building successfully.
I know that I have to upgrade every libraries so that it can work with JDK 8.
How can I make sure about the dependencies to be correct as there are so many jars? And also Do I have to change my Jboss Application Server to Wildfly Application Server as Jboss AS 7 doesn't support JDK 8?
Please suggest how to approach. Any help appreciated.
And also let me know if it's better to build the project from Scratch in JDK 8 than upgrading it to JDK 8.
1) If you need to use jdk8 than you have to switch too the newer jboss.
2) It is not required to updated all jar's since jdk8 can run older jars
it there is no compatibility problem.
3) If you already have an large probject it is faster to keep it.
4) You can review your code and use the new java 8 features like "<>" and "try()"
For more qualified answer your question is to unspecific.
I would like to suggest you to update JBOSS 6 to wildfly 8 if there is a change required for the updation of JDK 6 to JDK 8.
But there is some other way!!! you can run your JBOSS 6 externally and add the the project.war file in JBOSS>>standalone>>deployment.
For Upgrade of JDK 8,i would suggest to go through JDK 8 feature and see where you can implement the new feature of java in your source code and have a mock testing class for the same.Make sure you have a mock project as it is the good practice for the enhancement of the project.

Bad class file magic or version NOT related with versions of JDK

This is definitely not a duplicate of other similar questions, since in my case no Java lower that 8 in used anywhere.
In fact, I am trying to built my Android app and a new version of jar libraries cause this problem.
The thing is that these libraries run only on Java 8 and I have only Java 8 installed in my system.
Any ideas on where I should look? I am stuck here for days.
Thanks!

Getting a java.lang.NoClassDefFoundError for every jar file

I have recently reinstalled my computer, installed latest version of Android SDK and Eclipse.
And now every project that I have, I'm getting a "java.lang.NoClassDefFoundError" for every jar file included in every project.
I am a Java beginner, I have spend the last week on forums, but cannot get to fix it.
Could someone please help me ?
Thank you
You were probably using an out-of-date version of ADT prior to reformatting. Post ADT 17, libraries either need to be copied to the libs folder of your project, or they need to be marked as exported on the build path. Otherwise, the libraries will not be packaged with the APK binary, thus you will get NoClassDefFoundError when using those libraries.

Attach Android SDK sources in Eclipse

I want to see Android SDK source code in order to understand how it works.
How can I attach Android SDK sources in eclipse?
For newer releases
This is the only way to do it for the newer releases of the SDK:
http://source.android.com/source/downloading.html
It can take a little bit, but once you get it set up, it is easy to repeat for later releases. You will notice too that it helps solve the problem of the autocomplete lagging in Eclipse as well! Well worth it in and of itself...
For older releases
You need to download some source files specific to which Android API version you are working with.
The URL is
https://android.googlesource.com/platform/frameworks/base/+archive/<API version>.tar.gz
And you have to replace with one of these:
gingerbread-release for API 9 – Android 2.3
froyo-release for API 8 – Android 2.2
eclair-release for API 7 – Android 2.1
donut-release for API 6 – Android 1.6
so the URL becomes for example:
https://android.googlesource.com/platform/frameworks/base/+archive/froyo-release.tar.gz
for froyo, or:
https://android.googlesource.com/platform/frameworks/base/+archive/gingerbread-release.tar.gz
How to fix the autocomplete lagging problem once and for all
After you have downloaded the file, (which comes as .tar.gz by the way), you have to open the archive, and copy the contents of the base directory, into your
<android-SDK>\platforms\android-<API version>\sources
directory. (Create the sources directory if it does not exist)
When you now start Eclipse, you should have autocompletion working fine again!
There is even an Eclipse plugin for that - Android Sources.
However I just downloaded the plugin jar (~200 MB) and extracted sources from it. Then in Eclipse I attached the sources by going to my Android project, selecting android.jar > Properties > Java Source Attachment > External Folder.
In case somebody still needs that crusty old Gingerbread framework code, it can still be found in the depths of the Android source tree:
https://android.googlesource.com/platform/frameworks/base/+archive/gingerbread/core/java.tar.gz

How to fix bad version in eclipse plugin?

I am getting this bad version error as shown below. How to fix this. Do I need to have a separate jar file for each version of java?
(source: sourceforge.net)
How to fix this.
Is this a plugin that you created, or did you download it from somewhere?
I've never seen this myself, but I suspect that you are running Eclipse using an older version of Java (e.g. 1.5) and trying to use a plugin that was compiled for Java 1.6. Assuming that is the case you can:
upgrade the JDK used to run Eclipse to 1.6,
try to find a version of the plugin that was compiled for the Java 1.5 platform, or
download the plugin sources and build it for Java 1.5 yourself.
Do I need to have a separate jar file for each version of java?
No. A JAR file built for a Java 1.5 target platform should also work on a Java 1.6 platform. (Just not the other way around ...)
I got similar kind of error once and I was not able to fix it. And I ended up removing the plugin (EMF Plugin) and installing it on a new setup of Eclipse.
Now, I use Yoxos On-demand where you can create/add/remove Eclipse plugins with no effort. This is the best Eclipse customizer I have seen.
You are running on an older version of Java than the code was compiled for.

Categories

Resources