sdk bundle install java error - java

I have tried to install sdk bundle on windows 8 64 bit and windows 7 64 bit machines.
After unpacking to c:\development dir I try to run te eclispe.exe from \adt-bundle-windows\eclipse and I get same error for both:
![error message][1]
"a java runtime enviroment JRE or JDK must be available to run eclipse. No java virtual machine found in c:\development\adt-bundle-windows\eclipse\jre..."
There is no jre directory in the installed c:\development... therefore the error.op
I tried installing java manually to the eclipse directory but it did not create a jre directory so error came up the same.
My understanding from the install instructions is that everything needed is provided in the "bundle"!
What am I missing? Why is the java stuff not there?

If you have the JRE installad on your machine, then go to Properties of my computer > Advanced tab > Select Environment Variables
Then in the section of System variables, look for the variable "Path" and edit that, and add you JRE path there with a semicolon.
like
";C:\Program Files\Java\jre7\bin"

Related

Vscode extension error, java runtime could not be located on window subsystem for linux

I have installed the java runtime in the window subsystem for Linux (Ubuntu), and the Vscode is installed on the windows 10 system.
I did not install java runtime in windows 10 system. When I use vscode to edit java, it usually pop up a notice says the "java runtime could not be located".
I have point the vscode "java.home" to the java jdk directory of window subsystem linux file folder, which is C:\\Users\\Myusername\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState\\rootfs\\usr\\lib\\jvm\\. In the folder, it has:
java-8-openjdk-amd64 directory, and three files
.java-1.8.0-openjdk-amd64.jinfo,
default-java
java-1.8.0-openjdk-amd64.
But however, the vscode still pop out the notice that the java.home variable defined in VS Code settings does not point to a JDK.
Can anyone let me know how to set up the vs code properly so that it can locate the JDK file in the window subsystem for Linux (WSL)?
Thanks in advance.
It won´t work like this because you are trying to use a jdk builded for linux on windows.
It is the same as if you download the jdk for linux and try to execute on windows.
As for the solution, unfortunately there is no solution right now.
However you can call your java and javac directly on terminal using WSL
wsl javac
You can´t point the java_home using wsl.
Maybe in the future the guys from Microsoft can make the trick. I hope so.

Invoke JRE that is found in JDK

I first installed JRE and Java applications ran fine. Later on, I installed JDK and found out that JRE is part of JDK as sub-directory. So, I removed the original JRE. This time, all the Java applications would not start. JAVA_HOME is set correctly to point to the JDK (I am able to compile Java code). The OS is Windows 10. Why is the JRE that is found in the JDK not getting invoked?
When you are installing JDK, you have an option to install "public JRE" - a separate installation that will be registered in Windows independently from JDK, added to the Windows registry, will be invoked when you type java ... in the command line and will be used by the programs relying just on JRE / java executable. The option to install "public JRE" is available in this step of JDK installation:
On the other hand, the jre folder inside the JDK distribution is a "private JRE" - not exposed to all your Windows programs, not registered in the Windows registry. If you install only the JDK without the "public JRE", java executable will not be found on the path. The "private JRE" will be useful for the programs depending on the JAVA_HOME environment variable, which should be pointing to the root of the JDK.
I recommend installing a separate "public JRE", but if you want the java executable to be available in the console, add %JAVA_HOME%/jre/bin to your Windows PATH (or just %JAVA_HOME%/bin to use the java executable from the JDK itself). See here for an instruction on how to modify your PATH variable. That assumes you have set the JAVA_HOME environment variable - if you haven't, you can do it in the same configuration windows where you modify your PATH.

tools.jar seems to be not in Android Studio classpath on Windows 8

I installed Android Studio but it was giving me error that I need to install JDK but JDK was already installed. Then I realized it is asking to install 64bit version of JDK.
Anyway I just downloaded latest JDK 64bit version and set the following in Environment Variable but still Android Studio is giving error:
Error
'tools.jar' seems to be not in Android Studio classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.
Following paths are set in my Windows 8.
Path in User Variables
E:\Program Files\Java\jdk1.8.0_25\bin
JAVA_HOME in System Variables
E:\Program Files\Java\jdk1.8.0_25
Path in System Variables
E:\Program Files\Java\jdk1.8.0_25\bin
32bit JDK is installed on C drive while 64bit JDK is installed on E drive (as shown above). 32 bit JDK is not being used in any User or System Variables.
I have also restarted the PC.
How do I fix this issue?
I had this same problem and was able to fix it after wasting about 3 hours:
Just copy tools.jar from %JAVA_HOME%\lib to (Android Studio Root)\lib
check your JAVA_HOME value!
it should be like this
E:\Program Files\Java\jdk1.8.0_25\jre
First locate in your PC the route of your JDK (for instance: C:\Program Files\Java\jdk1.7.0_45)
then change the JAVA_HOME variable as follows:
Right-click the My Computer icon on your desktop and select Properties
Click the Advanced tab
Click the Environment Variables button
Under System Variables, click New
Enter the variable name as JAVA_HOME
Enter the variable value as the installation path for the Java Development Kit
I installed jdk 1.8.0_51 64bit on Windows7.
After that, no JAVA_HOME was defined, so I had to define it myself as described above, but it did not work unless I added a trailing backslash:
D:\Programs\Java\jdk1.8.0_51\.
Without the backslash at the end it did not work.
Known issue - my solution was to install JDK 7u80 - worked after that.
https://code.google.com/p/android/issues/detail?id=187048
Just Copy the tools.jar from your jdk to Android lib directory.
In my case I've installed newest Java version without uninstalling older version first. After I've uninstalled the older Java version this error was gone.
Also make sure your JAVA_HOME system variable is set properly, e.g.:
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.8.0_31\
And finally, that you've installed proper version for your OS, x86 or x64.
I had exactly the same problem.
In my case I finally installed JRE to "C:\Program Files..." and the JDK to my default destination , which is "E:\Program Files..."
It seems that the JDK and JRE cannot point to the same place for Android Studio .
I had the same issue on windows 7 when I installed Android Studio. I had Jdk 8 on my system. So for me, copying the tools.jar from jdk\lib to androidstudio\lib worked. I found the tools.jar was missing from androidstudio's lib directory. I had set JAVA_HOME in user variable and JDK in system variable.
I had the same error -- tools.jar seems to be not in Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.
I have a few Java JDKs downloaded. JAVA_HOME was pointing to C:\java\jdk1.7.0_45. When I switched to C:\java\jdk1.7.0_75, it worked. It makes no sense - both have lib/tools.jar. I did a jar tvf on each of the tools.jar files and they were fine. I ran java -version on each java & it ran ok. Dunno - makes no sense.
Platform: Windows 7 Professional - 64-bit v1.10.00.AG B11 Service Pack 1
Installing it to the default installation path instead of a custom one did solve the issue for me.
Source: https://code.google.com/p/android/issues/detail?id=187048#c9
First locate in your PC the route of your JDK (for instance: First locate in your PC the route of your JDK (for instance: C:\Program Files\Java\jdk1.8.0_11)
then change the JAVA_HOME variable as follows:
Right-click the My Computer icon on your desktop and select Properties
Click the Advanced tab
Click the Environment Variables button
Under System Variables, click New or edit it if there already a path for it ( you should make sure that the path is jdk)
Enter the variable name as JAVA_HOME
Enter the variable value as the installation path for the Java Development Kit)
1) Just install JDK from here
2) Change JAVA_HOME variable (e.g. C:\Program Files\Java\jdk1.8.0_112)
I add a similar problem on Linux.
In my case my JAVA_HOME env was pointing to the JRE HOME instead of the JDK HOME.
On my linux system I had done:
sabayon ~ # eselect java-vm list
Available Java Virtual Machines:
[1] icedtea-bin-8
[2] oracle-jdk-bin-1.8
[3] oracle-jre-bin-1.8 system-vm
sabayon ~ # eselect java-vm set system 2
And then Android Studio started like a charm. Download and install the SDK.
After I set JAVA_HOME variable and restart my windows pc I resolved my issue.
JAVA_HOME value should like below.
C:\Program Files\Java\jdk1.8.0_25\bin
I paste a screenshot for someone's help.
You can go here From My Computer / This PC > Property > Advance Variable.
I recently came across this issue while using a Managed Software solution. The company I was working with had Android Studio has part of their managed applications, however, it was a much older version that the latest release. When you use an older version of Android Studio coupled with a newer JDK (I tried 11 and 15) you then receive the error indicating tools.jar cannot be found in CLASSPATH. I resolved this by downloading the latest version from Android Studio's website and it worked like a charm!
I tried everything I could but it didn't help. So I reinstalled Windows and installed Android Studio and now everything works.
And the irony is, there is no JAVA_HOME or JDK_HOME variable defined but it still works.

Can't load AMD 64-bit .dll on a IA 32-bit platform

I download the Gurobi package for linear programming. I import the corresponding gurobi.jar package. Then run the example program. Then it appears the following errors:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
C:\gurobi460\win64\win64\bin\GurobiJni46.dll: Can't load AMD 64-bit
.dll on a IA 32-bit platform
Then I downloaded the window 64 bit Jre, and use the "window-->preference-->Installed JRE" to install this new JRE.
However, it still appeared this error.
If you are still getting that error after installing the 64 bit JRE, it means that the JVM running Gurobi package is still using the 32 bit JRE.
Check that you have updated the PATH and JAVA_HOME globally and in the command shell that you are using. (Maybe you just need to exit and restart it.)
Check that your command shell runs the right version of Java by running "java -version" and checking that it says it is a 64bit JRE.
If you are launching the example via a wrapper script / batch file, make sure that the script is using the right JRE. Modify as required ...
If you are launching the example via an IDE, check that the IDE is using the right JRE to launch. Check and modify the IDE configs. The details will depend on the IDE you are using. Check the documentation. (Just setting external environment variables such as JAVA_HOME may not be sufficient in this case.)
Try this:
Download and install a 32-bit JDK.
Go to eclipse click on your project (Run As → Run Configurations...) under Java Application branch.
Go to the JRE tab and select Alternate JRE. Click on Installed JRE button, add your 32-bit JRE and select.
Uninstall(delete) this: jre, jdk, eclipse.
Download 32 bit(x86) version of this programs:jre, jdk, eclipse.
And install it.

Finding the JRE on Windows

I know this question is going to sound very stupid but here goes nonetheless. I need to bundle the new version of the JRE with my applicaiton and I cannot find either a version of the JRE that is not in .exe nor can I find where the jre is installed to on Windows 7 (windows 7 search cannot find anything so it is not helpful). Can anyone tell me where I can download a version of the JRE the would be good to bundle or where I can find the path that windows installed the JRE too?
Not sure about Windows 7 but on Windows XP the installation defaults to C:\Program Files\Java\jre6
corsiKa is correct about Windows 7
I found that the file path for jre is
C:\Program Files (x86)\Java\jre7
For my purposes I needed to install the Connector/J JDBC driver in the ext directory.
jre7\lib\ext\
Alternatively, install a JDK, if you haven't done it yet, and take the jre folder in its installation directory.
The JDK can also install it in Program Files (64-bit on 64-bit Windows, always on 32-bit Windows) or Program Files (x86) (32-bit on 64-bit Windows) as explained above.
It also installs java.exe, javaw.exe and javaws.exe in C:\Windows\system32
It will be the last installed version...
I have found another, more generic solution that I'm using in Powershell. The problem is that Java is now using symlinks to java, javaw and javac, so you can't always rely on using "where.exe java" because it returns the symlink.
I now rely on Java to report where it's actually running from by using verbose mode and parsing the output.
$javapath=((java -verbose -version | ? {$_ -match "Opened" }).replace("[Opened ","")).replace("\lib\rt.jar]","")
It will find the path that java reports it's actually using and return the installation directory. The only problem I haven't quite resolved is that it outputs extra information because of the "-version" option, but the only other option is the help, which is worse. However, when run from a script, the console output can simply be ignored. If someone else has a way of keeping it quiet, I'd like to hear it.

Categories