Android.bat can't run java - java

I know this question has been beaten to death but I still cannot get the SDK Manager to run on my Windows 7 Home.
I downloaded the eclipse + adt bundle. The SDK Manager.exe is in the sdk folder where I try to run it from. I even tried copying it to the tools folder and tried running from there but no luck.
The error I get is:
Failed to execute tools\android.bat:
The system cannot find the file specified.
The file clearly exists. I tried running it as "Administrator" as well.
Next I tried running the android.bat file itself which says:
Windows cannot find 'E:\path\to\batfile'.
Make sure you typed the name correctly, and then try again.
I then ran it as "Administrator" which at least detects and tries to execute it. I added in a few pause statements to android.bat itself to prevent it from closing.
Here is what I see:
'"E:\ADT\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal
or external command, operable program or batch file.
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
http://www.oracle.com/technetwork/java/javase/downloads
If you already have Java installed, you can define the JAVA_HOME environment
variable in Control Panel / System / Avanced System Settings to point to the
JDK folder.
Not sure why it says that because when I run where java in cmd I get this:
C:\Users\(MyUser)>where java
C:\Program Files\Java\jdk1.8.0_05\bin\java.exe
C:\ProgramData\Oracle\Java\javapath\java.exe
C:\Windows\System32\java.exe
And when I open cmd and manually run
'"E:\ADT\sdk\tools\lib\\find_java.exe" -s'
it works fine.
I then tried setting the java_exe in android.bat to
set java_exe=C:\Program Files\Java\jdk1.8.0_05\bin\java.exe
After commenting out the find_java I ran it again and this is what I get:
'"C:\Program Files\Java\jdk1.8.0_05\bin\java.exe" -jar lib\archquery.jar' is not
recognized as an internal or external command,
operable program or batch file.
Invalid path
And once again, when I manually run it, I get:
C:\Users\MyUser>"C:\Program Files\Java\jdk1.8.0_05\bin\java.exe" -jar E:\ADT\sdk\t
ools\lib\archquery.jar
x86_64
Am I missing something or should I finally give up trying to get it to work on my windows machine.

Your where java shows too many java.exe, the find_java.bat will try to look for javaw as well in the folder where java is.
set JAVA_HOME and make sure the echo %PATH% points to your main jdk installation.

Related

Error loading python27.dll (error code 14001) while running Jython script by cmd

I have installed Jython on my Windows 7 machine, something I did often. I have set the environment variable PATH with the path C:\jython2.7.1\bin\ and I launched the program from cmd as jython myProgram.py.
The following error appears:
Error loading Python DLL: C:\jython2.7.1\bin\python27.dll (error code 14001)
I've also tried to launch the program with C:\jython2.7.1\jython.jar myProgram.py and it works! The problem is that I can't debug at runtime.
Why that error while I run jython myProgram.py? It had never happened to me before. Yet the python27.dll file in the bin folder is there! I hope it's nothing serious.
On Windows 7 you are using a too high version of Jython. Go to this site, download and install the 2.7.0 version. After that, set the PATH environment variable as C:\jython2.7.0\bin.

Javac working with Powershell but not Command Prompt

I am trying to install Java in Windows 10 Home (64 bit). Like many tutorials point out, I downloaded the Java jdk setup file, executed it and once installed changed the Path in the Environment Variables. But for some reason, when I execute the command 'javac' it returns the not internal/external command error in Command Prompt but runs absolutely fine in Powershell. I tried to rectify this by uninstalling Java and reinstalling it very carefully, following all the steps but still this keeps on happening.
Also, during installation of Java, I lost the original value to my Path variable. Could this be causing the problem?
Edit : I was able to get the java command running in the command prompt but javac still won't work. I've already tried the methods suggested on other forums and this one but no luck so far.
See there is no problem with Java installation if you can find JDK(Java development kit) and JRE(Server Java runtime environment) in programme files in windows in a JAVA folder.
The main problem is with the environment variable declaration.
Go to environment variables and make a new path for that.
JAVA_HOME = "YOUR JDK & JRE INSTALLATION PATH"
And another one is
JAVA = "YOUR JDK & JRE INSTALLATION PATH"
Hope that help to you. After doing that if still there problem persisist just restart your PC and check again.
Just add your variable location up to /bin/
Refer to this :
https://www.windows-commandline.com/javac-not-recognized-internal-external-command/
Open file explorer
Right click computer then click properties
click advanced system settings
click environmental variables
click path (for me there was one in user variables for admin and another in system variables)
find the directory for javac (for me it was here C:\Program Files (x86)\Java\jdk1.8.0_191\bin)
so go back to file explorer and open program files x86
then open the java folder
then open the jdk folder
then open the bin folder
highlight the path in the search bar and copy it
click edit on path and paste into the path in the environmental variable for both(if you have more than one path)
If no path exists then create one in user variables
If there is any existing text place a semicolon ; between the text you pasted in there and the preexisting text.
close command prompt and reopen it.
type javac -version
the version info should be listed
This problem comes up with the directory of your command prompt.
check your PowerShell and command prompt default directory.
We can run command prompt as WinKey+R then type cmd, Hit the enter button then check our java version cmd javac -version.

Error: JAVA_HOME is not set and could not be found after Eclipse installation

Actually I installed hadoop successfully. hadoop version command worked fine. Now I wanted to run the map reduce program. So I installed eclipse. After which I am getting an error saying "Error: JAVA_HOME is not set and could not be found."
Even echo $JAVA_HOME command in cygwin terminal did not print the value after eclipse installation.
How can I fix this issue first?
How can I run the MaxTemperature map reduce program using eclipse.
Thanks
Try to set JAVA_HOME. You can do this by editing your env.sh such that it will have:
export JAVA_HOME=/absolute/path/to/your/java/home
In case the path contains spaces, surround it with double quotes.
Example:
export JAVA_HOME="/cygdrive/f/program files/java/jdk1.7.0_51"
You may need to refer to Eclipse Runtime Options.
I would try first to launch Eclipse with the -clean option
If that does not work, try launching Eclipse with -vm path to java vm
There are things you can do to modify the .ini file directly, but if these two fails, try to reinstall Eclipse. Remember, the java.exe exists in multiple locations on your PC. Changing your PATH variable manually might help you with Eclipse, but it may break other things. This is why some products use %JAVA_HOME% to distinguish from the Java that might be loaded before it.
If you want to really know what is going on with your Java installation, open a command prompt window and type c:\> where java.
As you can see, I have Java installed in multiple locations AND multiple versions of Java (7 and 8). It is important that you know these things before you start messing with environment variables.

jar file is not executing on double clicking on windows 7

I have CQ5 executable jar file.It is suppose to be executed on double clicking.But i get error saying "could not find Main class program will exit".The same jar file executed on all my team mates machine but i am unable to execute it.
I am working on windows 7 OS.
I have jre6 installed.
I have done all steps provided in following link .jar file keeps giving me " could not find the main class". Program will exit.
my ftype and assoc is set to propervalue.
there is no problem in manifest file(becoz it executed on others machine).
all my path variables are set properly.
type of file on my system is "JAR" but on everyone else machine its "Executable JAR"
Could not figure out what is problem with my system.
Help plz.
You can alternatively try executing this command from a command console,
first CD to the location where you have the jar file and execute
For Win7 32-bit:
java -Xmx1024M -jar .jar
For Win7 64-bit:
java -XX:MaxPermSize=256m -Xmx1024M -jar .jar
if you have supported version of Java installed correctly, then the command should be able to start the CQ5 server. In that case, for fixing the double click issue, you would need to fix the filetype association of .jar files to open with /bin/javaw.exe
For supported Java versions, refer
CQ5.5 http://dev.day.com/docs/en/cq/5-5/deploying/technical_requirements.html
CQ5.6 http://dev.day.com/docs/en/cq/5-6/deploying/technical_requirements.html

Can't run mvn command on windows from unpacked source archive

My laptop got stolen so I had to redownload Java and Maven and I can't seem to get Maven up and running, even though I had no problems last time. I have the following locations:
C:\Program Files\Java\jdk1.7.0_03
C:\Program Files\apache-maven-3.0.4
In my environment settings, I added the following system variables:
M2_HOME - C:\Program Files\apache-maven-3.0.4
JAVA_HOME - C:\Program Files\Java\jdk1.7.0_03
I updated my Path system variable so that the following would be at the beginning:
%JAVA_HOME%\bin;%M2_HOME%\bin;
All this I got from the Maven installation instructions. However, when I open a new command prompt and check the version, I get the following message:
'mvn' is not recognized as an internal or external command,
operable program or batch file.
Does anyone know what I am missing?
UPDATE
When I installed Java, I noticed java -version automatically started working without me having to do anything. Might there be a Java conflict somewhere?
Your path variable should have %M2_HOME%\bin instead of %M2%\bin
Check the properties of mvn.bat to see if it is blocked.

Categories