Android SDK and Java - java

Android SDK Manager complains "WARNING: Java not found in your path".
Instead of using the information from Windows registry, the software tries to search Java in the default installation folders, and fails (I don't install software in program files because I don't like space characters in my paths). Of course I know how to modify the %PATH% environment variable. The question is — which Java does it need?
After installing the latest JDK, I’ve got 4 distinct versions of java.exe file, in the following 4 folders: system32, jre6\bin, jdk1.6.0_26\bin, and jdk1.6.0_26\jre\bin. Size ranges from 145184 to 171808. All of them print version “1.6.0_26” when launched with the “-version” argument. The one in system32 has .exe version “6.0.250.6”, the rest of them is “6.0.260.3”. All 4 files are different (I’ve calculated the MD5 checksums).
Q1. Which folder should I add to %PATH% to make the Android SDK happy?
Q2. Why does Oracle build that many variants of java.exe of the same version for the same platform?
Thanks in advance!
P.S. I'm using Windows 7 SP1 x64 home premium, and downloaded the 64-bit version of JDK, jdk-6u26-windows-x64.exe.

jre6\bin should work. That's what I put in %PATH%.
JRE is the Java Runtime Environmen and JDK is the Java Development Kit).
jre6\bin comes from JRE.
jdk1.6.0_26\bin has the development kit binary files
jdk1.6.0_26\jre\bin has an implementation of the Java Runtime Environment for use by the JDK
Please see Contents of the JDK for more info

Try setting JAVA_HOME pointing to the jdk1.6.0_26 directory. See this post.

Actually I got stuck in this same problem, and although that the above answer should work properly... it didn't work for me.
The only solution that fixed this problem for me is copying the installed jdk folder to folder C:\Program Files\ ... and name that folder Java!
I know that this doesn't make any sense! but that what solved my problem after it make me go crazy.
I hope the normal solutions would help your problem, otherwise; you might think of my ugly solution and I hope your problem gets fixed soon.
Thanks,
Mohamed A.Karim.

What helped me was changing one of Enviroment Variables (right-click on "my computer" then "Advanced system settings" or similar) named PATH. Using function "edit" i added this:
C:\Program Files\Java;C:\Program Files\Java\;C:\Program
Files\Java\jdk1.6.0_29;C:\Program Files\Java\jdk1.6.0_29\;C:\Program
Files\Java\jdk1.6.0_29\bin;C:\Program Files\Java\jdk1.6.0_29\bin\
(one of those is sufficient, but I don't know which).
I have Windows Vista 32bit.

replace "program files' with "progra~1" in your path

I have the same problem, maybe because I installed JDK on E: instead of C:
Solved by creating a run.bat file with these:
set JAVA_HOME="E:\Program Files\Java\jdk1.6.0_26"
set PATH=%PATH%;"E:\Program Files\Java\jdk1.6.0_26\bin"
call "sdk manager.exe"
Works perfectly
Perhaps the path did what I needed

Related

Everything looks perfect, but Eclipse installer can't install it for a reason that it can't find the JDK

I've tried to install eclipse, but it's connected to the web page displaying the following error and I couldn't install it.
Unfortunately the Java version needed to run Eclipse Installer couldn't be found on your system. You need the following version or a higher version: Java 1.8.0 (64 Bit)
But my JDK version is Aleady 1.8.0_231(64Bit) and i completed setting up the environment variable.
(JAVA_HOME, and Path as System Variable)
Normally, using a different IDE like InteliJ(and it works normally on my computer) can be a solution but it's not possible because I have to submit it as a university assignment using eclipse.
What should I do?
This is my CMD Screenshot with checking JDK version
For anybody else (especially other Koreans) who may be struggling with Eclipse installation, turns out that the installer won't work if your account user name is in Korean. Specifically referring to the name that shows when you run your command prompt (as shown in the poster's image hyperlink) or at C:\Users -- if that name is in Korean, that it turns out that Eclipse installer will not work even if most recent Java is installed and paths are set correctly.
Easy way to get around this issue then is to create another local account with only English characters, and run the installer. Not sure why this happens, but it seems to be a common pattern I noticed with the most recent version of Eclipse installer.
It seems installing Eclipse on the account with English characters only still does not allow Eclipse to run, so I have to be signed into that account if I'm using the laptop. Maybe someone who can deal with this issue in a more efficient way can help us out?
I had a similar problem with AdoptOpenJDK 13 (The PATH and JAVA_HOME variables were correct).
The way I fixed that was simple. I created a eclipse.ini with the following contents in the same directory as the eclipse installer:
-vm
C:\Program Files\AdoptOpenJDK\jdk-13.0.0.33-hotspot\bin\javaw.exe
After doing that, the installer stopped complaining and I could install eclipse.

Eclipse not working after deleting a version of java

I found out I had the JRE and the JDK on 2 different folders, I then deleted the JRE. The JRE is still here in the JDK install.
I then searched a bit about the problem. I created the environment variable (I am on W10) JAVA_PATH with the good path but it still doesn't work.
A dialog box says (I can't copy paste all) :
JVM terminated
C:\ProgramData\Oracle\Java\javapath\javaw.exe
(lots of things)
I don't know how to get it working.
Reinstalling your JRE will solve the problem. If you want to get rid of some software always deinstall it if possible because you don't know where all of the files and settings were installed.
you will need java, if you have a JDK the a JRE is included there by default..., maybe you had 2 version of java and you still have a jdk, so lets say you deleted the jre, then you need to tell the eclipse IDE that it must use the version you have installed and where it can find it..
How:
like this...
but now, if you deleted ALL the java versions then you will need to install at least one...
You should have defined your environment variable as JAVA_HOME and assign it your JDK's path. Then, add this variable to your PATH variable as JAVA_HOME/bin.

one program(eclipse Mars) need java 8 and one program(console app) need java 7 what to do?

when I open eclipse Mars it ask for java 8(for JavaFX), and then When I did install java 8u74 now some of my older java app showing that it need java 7(my older installed version). And when I tried to keep both I found some of faculty said to not keeping both. I don't know what to do? Please Kindly help me?
When I open eclipse Now It is showing:
"You are not running your eclipse instance with Java7 or Java8. The JavaFX tooling is disabled because of this.Make Java7/8 the default system java or adjust your eclipse.ini to pass -vm pointing to your Java7/8 install."
You can try to manually change the Java library for a specific project.
Right click on the project folder, then go to:
properties->Java Build Path->Libraries->Add Library
and there add the Java 7 library.
If this doesn't work or you don't see the Java 7 library you might need to add some environment variables (e.g. JAVA_HOME)
Go to the eclipse installation folder and modify the below property in eclipse.ini file:
-Dosgi.requiredJavaVersion=1.7
Hope this helps!

Google App Engine JSP can't deploy: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE

this is hopefully something simple but... Eclipse has been working relatively fine for everything except deploying to GAE.
I can run my GAE app locally, but when I try to deploy to google, I get this message:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
I have set the build path to JDK.
It also happens when trying to deploy the same project from more than one system (win7 and win8) so I suspect the problem is to do with the project itself. This particular project is existing and already running on google for years.
Interesting that this error only shows up when I have .jsp files in my app to deploy. If I remove the jsp files, it deploys without error. (kinda need the jsp files tho)
thanks
link to image of my build path
I had the same problem and was able to deploy successfully after forcing Eclipse to use
the JRE within my SDK directory (Win 7 64bit). To force Eclipse to use a particular JRE see this. It seems that the JVM that Eclipse uses, the JVM that app engine spawns, & the JVM that appconfig uses should all be the same. Hope this helps w/ your situation as well.
I tried setting my project jre to be the same as my eclipse jre according to AlohaCode's answer. This was insufficient for me. The answer was in my classpath, there is java.exe in C:\windows\system32 which was BEFORE my java home variable.
The solution is to put the java home path before the C:\windows\system32 entry.
I found the answer here: 2FL5sJ">https://groups.google.com/forum/?fromgroups=#!msg/google-appengine-java/RyFybJWUhU4/78UE_2FL5sJ
In Eclipse, go to: Window->Preferences->Java->Installed JREs , add->Standard VM TO JDK PATH\JRE. and If you had a JRE checked previously uncheck it and check this jre
The given advice solved my problem. The -vm argument cannot be the first line.
-vm
C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javaw.exe
Setting -vm in eclipse.ini did not help. All other settings were seemingly pointing to the JDK. Out of desperation, I uninstalled all JREs from my system, leaving only the JDK. The consequence was that Eclipse would not start as the JDK bin directory was not on my PATH (Windows 8 here). Adding this in environment system variables got Eclipse to start. Thereafter I could deploy to app engine.
Removing the JRE file located in my C:/Program Files(*86)/Java folder , reopening the eclipse IDE resolved the issue.
I had Java JDK installed in my C:/Program Files/Java folder which was not detected earlier.

download jdk1.5.0_18 source code

I'm looking for the JDK source code for Java 1.5 update 18 (on win XP). I don't want to install a JDK, I don't want the source code for the entire VM, just the source for the JDK libs, so that when I navigate to a Java class in Eclipse, it opens up the source code.
Is it possible to download just src.zip (or a zip that contains src.zip)? I don't want to install a new JDK/JRE just to get access to src.zip as I'm concerned that this will have undesirable side-effects such as modifying JAVA_HOME.
Thanks,
Don
The best place to go to get old versions of Java stuff is the Archive page. JDK 1.5.0_18 is there.
However, I don't think it is possible to download just the source code ZIP file. But hey, you could always get a friend to download the relevant JDK and copy it onto a CD/DVD for you.
EDIT re your concern about environment variables being changed.
Installing a JDK does not modify the JAVA_HOME environment variable or any other environment variable. Indeed, the JDK / JRE installation instructions explain that you need to update JAVA_HOME and PATH manually.
Sun have always been careful to allow you to install multiple JDK/JREs side-by-side. The only thing of that nature that gets changed by the installer is the version of Java used by your browser's Java plugin. And that only changes if you give the installer permission to change it!!
Below is the source for the latest JDK 1.5 but it seems difficult to find update 18 specifically, at least there is no obvious link :-(
http://java.sun.com/j2se/jrl_download.html
Only place I know of that you can get them is with the JDK. You can grab it here
Installing it shouldn't modify JAVA_HOME
http://download.java.net/jdk6/source/
Is that what you want?
Download the JDK for the release you want to use, and install it.
Then start Eclipse and go to Window -> Preferences -> Java -> Installed JREs, and Add the JDK you just installed, and ensure it has the checkmark!
That should do it (and it doesn't mess with the default java versions and JAVA_HOME and all)

Categories