Can the Android SDK work with JDK 1.7?
You just need 1.6 present on your PC. I had the same problem. Install 1.6 JDK, and add it as known JDK, but don't actually select it for your project.
Using Android Studio with Java 1.7
I went to Java SE Downloads and downloaded Java 7 again. The method mentioned above worked for Eclipse.
Running the installer from this manual download placed the JDK in /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home
, which was accepted by Android Studio.
androidstudio set java version 1.7
No... there is no settings to change. Android SDK don't support full java 7 syntax, so you can't use it.
Note that java.nio.* (new in java 7 API) is supported by latest android version.
Android SDK Tools Wizard: Detects JDK 1.7 instead of JDK 1.6
also some of the tutorials it was said that ADT doesn't support JDK 1.7 yet
ADT supports Java 1.7 (a.k.a., Java 7).
I tested by typing java -version and it shows me pointed to Java 1.6
Note that this is testing the runtime environment, not the development environment. Use javac -version
to test what version of the Java compiler you are using.
I am not sure if continuing with JDK 1.7 would lead to future problems during development
That should be fine. I have been using Java 7 for the past 5-6 months without issue, albeit on Linux rather than Windows.
Facebook android sdk needs java 1.7 to work?
This has nothing to do with facebook, this has to do with the diamond operator introduced in Java 1.7
Simply change that line to this:
ArrayList<String> permissionsList = new ArrayList<String>();
More information on the diamond operator can be found here.
Use class from the JDK instead of the android SDK (ADK)
You cannot do that. Not by simply switching the import statements anyway.
Your code running on Android as its destination platform will not have access to Java SDK classes, therefore the code will fail to load the classes or it will load the Android version of the class with the exact same fully qualified name (which is your case).
If you want to use that specific implementation from Java SDK, you will have to make it available at the destination platform.
You have 2 options, but neither is good:
Use Java SDK as library
By bringingrt.jar
(~50MB) into your project. However that would create many potential problems, as Android SDK and Java SDK mirror some packages and classes and you could end up loading the wrong versions. or
Bring the source in
Second option - only slightly better - is to bring the source of that class into your project, only if all its dependencies can be met by Android SDK, or could be brought in as source too. This would be painful...The correct solution however is to
Embrace the ecosystem
I don't know what are your specific requirements, but I would wager that Android's implementation of this class is quite close to Java one. If you cannot achieve something by using Android SDK, try asking about that specific problem here, or search for 3rd party libraries which could achieve, what you need. Perhaps the solution is easier than you think.
Is JDK 1.8 fully supported by Android Studio?
You should just use JDK 1.7. There are some features in JDK 8 that are not yet supported.
Related Topics
How to Update a Textview of an Activity from Another Class
How to Use Vectordrawable in Buttons and Textviews Using Android:Drawableright
Why Does the Jvm Consume Less Memory Than -Xms Specified
What Is the Purpose of Java's Unary Plus Operator
How to Terminate Scanner When Input Is Complete
How to Run Certain Task Every Day at a Particular Time Using Scheduledexecutorservice
Load Chrome Profile Using Selenium Webdriver Using Java
Pkix Path Building Failed: Unable to Find Valid Certification Path to Requested Target
How to Get the Current Screen Orientation
Compile Code Using Javafx 2.0 (Using Command Line)
Java.Io.Console Support in Eclipse Ide
How to Add an Actionlistener Onto a Jbutton in Java