Where is installed JDK 1.7 on mac - java

I'm getting a problem with Android Studio "Gradle project sync failed" it also says compileSdkVersion android-21 requires compiling with JDK 7. I have installed jdk-7u71 then running in the terminal usr/libexec/java_home -v 1.7 tells me the JDK is in /Libary/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Content/Home unlike v 1.6 which is in System/Library/Java/JavaVirtualMachine, however when I go on finder I can't find the Java folder in Library. Also when I add the path to JDK location in the Android Studio I get an error saying Please choose a valid JDK directory. Where is this jdk1.7.0_71.jdk then?

According to my mac, my JDK folder is:
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/
You may find it there. If you cannot, try to reinstall it.

Related

What is the latest Java SDK that can be used for Android app development?

I recently bought a new MacBook. I installed the Android SDK and Studio and then I imported my project. AS suggested to use the bundled Open JDK for my project. I accepted and I am able to build and run my project via AS.
The problem is, my command line doesn't work :(
==> ./gradlew clean
No Java runtime present, requesting install.
After running the above code the following alert displays. This web page will be open when I click on the More Info button.
After I searched I realized that I have to have JDK installed on my laptop. I remember -from thousand years ago- that I have to have JDK 8 on my laptop. I also heard that android projects work with JDK 11.
It looks like the latest JDK is 15. So, what should I do? What is the latest JDK that can be used for Android app development?
Anything Java 8 or above is fine.
Find path to JDK in File > Project Structure, Tab SDK Location > JDK Location.
In MacOS, installed Virtual Machines are normally placed in /Library/Java/JavaVirtualMachines/*

Android Studio: "Gradle sync failed: Could not run JVM from the selected JDK."

Ever since installing Android Studio 3.2, I haven't been able to run Java, I have tried jdk-8u181-windows-x64, jdk-10.0.2_windows-x64_bin, jdk-11_windows-x64_bin, setting PATH and reinstalling everything umpteen times, the result is the same - no "java" appears and the error message is: -
Gradle sync failed: Could not run JVM from the selected JDK.
Please ensure JDK installation is valid and compatible with the current OS (Windows 8.1 6.3, amd64).
If you are using embedded JDK, please make sure to download Android Studio bundle compatible
with the current OS. For example, for x86 systems please choose a 32 bits download option. (369 ms)
Notes: I used to be able to open the java folder but after playing with it too much, something went wrong, so, I decided to start afresh... and I am dead ever since.
Is Studio 3.2 flawed? Not compatible with Java at all? Or am I missing something? is there a older Android Studio I can test? Thanks for any help you may provide.
In my case, the following solved it:
File->Other settings->Default Project Structure...
In "JDK Location", I previously had the oracle jdk selected. To fix this issue, I instead checked "Use embedded JDK (recommended)"
Solved YES
Other Settings ---> Default Project Structure ---> Uncheck Embedded jdk ( Write Your Own jdk Location )
In my case, the following solved it:
File->Other settings->Default Project Structure...
setting the JAVA_HOME environment variable to C:\Program Files\Java\jdk1.8.0_181
my JDK Source File
Try setting your SDK location. I had the same problem with Android Studio 3.2 (but I also switched to openjdk, so that could be the source of my problem). Anyway, after pointing SDK location to the root of my JDK it worked like a charm.
To change SDK location click on the Android project Window and then press F4. In the new Window choose SDK location and set it to point to the root of your JDK.
i got mine working by setting the JAVA_HOME environment variable to C:\Program Files\Java\jdk1.8.0_181\bin my jdk folder

Xamarin - VS 2015 - looking for jdk1.7.0_71 - java.exe

I have just installed Xamarin into my existing VS2015. I have a Win 7 64 bit machine. When I start a simple Xamarin.Forms project and try to build and deploy onto an Android emulator, it throws an error -
"The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\bin\java.exe" is invalid."
In Options->Xamarin->JDK Settings = "C:\Program Files (x86)\Java\jdk1.8.0_91\"
I have uninstalled JDK 1.7 from my machine, and restarted my machine. There is no difference.
I also have a 64 bit version of JDK and my JAVA_HOME points to that, which I cannot change just for Xamarin.
Where in the world is Xamarin picking up this path from?
How to fix this issue?
I had this problem too and I solved it deleting the file sdks.cache.
You will find it in the folders OBJ (Debug or Release) and BIN (Debug or Release) of your project.
This file contains some variables configuration. This problem is because the node is targeting to wrong path (C:\Program Files (x86)\Java\jdk1.7.0_71).
Deleting the file is safe because it will be regenerated again with the next build but in this time will use your Xamarin configuration to set node with the configured path.
I hope this help you to solve your problem.
I had a similar problem when I had both versions of Java installed in my system (1.7 and 1.8). Despite Xamarin -> JDK settings pointing to 1.8 version, the error
specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\bin\java.exe" is invalid
was still displayed.
This issue can be resolved by following the steps below:
Uninstall Java 1.7
In Microsoft visual studio, click on the solution (in solution explorer) right click and select "Clean"
Ensure your Xamarin -> JDK settings point to Java 1.8 version
Rebuild the solution
Java installed version and Xamarin referred different version .. Please config correct Java version in the Xamarin In Options->Xamarin->JDK Settings.
Thanks
Xamarin.Android currently requires 32-bit Java JDK 7 (1.7). The latest version is 1.7 update 79.
Xamarin.Android also requires that a 32-bit Java JDK 7 (1.7) be installed. Later versions of the JDK can also be installed alongside JDK 7, if required by your machine.

Android Studio Error: Error:CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running

Installed Android Studio 2.2 Preview 2 and getting this error:
Error:CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher
Screenshot:
I re-installed the JDK, still same issue.
I even tried to use the embedded JDK but still having the same issue:
I had the same issue, but I have resolved it the next:
1) Install jdk1.8...
2) In AndroidStudio File->Project Structure->SDK Location, select your directory where the JDK is located, by default Studio uses embedded JDK but for some reason it produces error=216.
3) Click Ok.
REASON
This happens because for now they only ship 64bit JRE with Android Studio for Windows which produces glitches in 32 bit systems.
SOLUTION
do not use the embedded JDK: Go to File -> Project Structure dialog, uncheck "Use embedded JDK" and select the 32-bit JRE you've installed separately in your system
decrease the memory footprint for Gradle in gradle.properties(Project Properties), for eg set it to -Xmx768m.
For more details: https://code.google.com/p/android/issues/detail?id=219524
i think android studio has a 64bit kernel version which is giving the problem.
https://github.com/swcarpentry/windows-installer/issues/49
Don't worry... Its much easy to solve your problem. Just SET you SDK-LOCATION and JDK-LOCATION.
Click on Configure ( As Soon Android studio open )
Click Project Default
Click Project Structure
Clik Android Sdk Location
Select & Browse your Android SDK Location (Like: C:\Android\sdk)
Uncheck USE EMBEDDED JDK LOCATION
Set & Browse JDK Location, Like C:\Program Files\Java\jdk1.8.0_121

JDK 1.7 not shown in Program Files folder

I have started developing an Android application in Android Studio. After starting Android Studio it gives me an error: "compileSdkVersion android-21 requires compiling with JDK 7". So I ran java -version at the Commmand Prompt and it shows I have 1.7. But in Program Files there is a folder for JDK 1.6 but not for 1.7. JRE of 1.7 is there, but not JDK 1.7.
Any suggestions will be appreciated. Thanks in advance.
Try "javac -version" instead of "java -version" to confirm JDK installed version
It seems that you have a 1.7 Java Runtime but only 1.6 SDK installed.
Just get the correct SDK installer from java.com.
Uninstall all jres and jdks, reinstall the jdk you need (jre is included). Be carefull with the bit-versions, always install the correct one
new:
Idea is you can simply set you projects jdk any version you want, different from os installed one, just make sure you download it and referenece from the android studio
Same story different interfaces, donno if downvotes were necesary
https://askubuntu.com/questions/467870/how-to-set-the-jdk-for-android-studio
androidstudio set java version 1.7
old(sry tought is eclipse):
How to change JDK version for an Eclipse project
And make sure you have jdk available for eclipse to set it incase you dotn have it. Else just change type

Categories