The system cannot find the path specified (Java Development Kit) - java

I just started working with Cordova/PhoneGap and when I want to use the command "cordova run android" on my newly created application, it goes somewhat like this:
C:\Users\tobbog\Desktop\MyNewApp>cordova run android
ANDROID_HOME=C:\Users\tobbog\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_144
The system cannot find the path specified
However, the two paths above are both perfectly like that in my Environmental Variables. How can it be that it doesn't find the path?
Thanks in advance for any help!

Remove android by the below command
cordova platform rm android
Then add the version 5 by the below command
cordova platform add android#~5
That should help!

You may also want to place the paths in quotation marks " ", since it's possible the space in "Program Files" is throwing it off, I know this happens often when trying to run certain programs via command line that take file arguments. So maybe write it like this:
C:\Users\tobbog\Desktop\MyNewApp>cordova run android
ANDROID_HOME="C:\Users\tobbog\AppData\Local\Android\sdk"
JAVA_HOME="C:\Program Files\java\jdk1.8.0_144"
Can't be 100% sure though as I'm unfamiliar with what that program expects (cordova) and other options that may be supplied to it! You could always try checking the readme or documentation related to that program, it probably shows some examples as to how to run something similar.
See how it even changes in the Stack Overflow text formatting? It's possible once it hits that white space after Files (in C:\Program Files) that it's ignoring the rest of the path, so basically you're trying to specify this path for JAVA_HOME:
C:\Program
And that's it! Would explain why it can't find that path since you probably don't have just a "Program" directory!

I found the answer to my problem! The problem was that I installed and uninstalled the Android Development Kit before. During the uninstal, it didn't delete all of the folders so that I had to delete them manually before installing Android again.

Related

The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\javac.exe" is invalid

Ok im wondering where does xamarin get this path from?
Severity Code Description Project File Line Source Suppression State
Error The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\javac.exe" is invalid.
So I can go and change it to the new jdk1.8. I have the new JDK set up I just need to know where to change the path at.
I had the same problem and solution is.
Remove all jdk and install jdk 1.8
Change reference java location in Visual Studio Tool > Options > Xamarin
Clean and Rebuild Project
I've just solved this exact problem for me.
I don't know why you wouldn't have a JDK_HOME variable. Completely remove the JDK and install it again maybe?
The Environment Variables for java were set to my previously installed path. I guess Oracle screwed up here.
As I had the same error, here's what I did:
I went to C:\Program Files\Java\ and checked what the jdk folder is called. For me it's jdk1.8.0_102.
For users who don't know where to find System Variables:
Go to System Properties and on the left hand side, click Advanced System Settings. Switch to the Advanced tab, click Environment Variables. Under System Variables there should be two variables in the list called JAVA_HOME and JDK_HOME.
I edited those values and change the path to what I found in the java folder. In my case this would be C:\Program Files\Java\jdk1.8.0_102.
No need to close VS, just build your app and it should get passed the annoying error.
Hope this helps :)
I had exactly the same problem. I got it to go away (which is not the same thing as fixing it).
Un-install every bit of JAVA you have. Delete both JAVA folders (Program Files and Program Files (x86)).
Install the latest version of the Java (x32) SDK.
Clean and Rebuild your project(s).
Since my Solution is multi-platform, I changed the Startup Project to the .iOS one, built it, ran it in an emulator, and set the Startup Project back to the .Droid project.
Somewhere in all this, the problem went away.
And remember kids! If it can go away all by itself, it can come back again all by itself!
I had this issue as well, I downloaded 32 bit Java but VS was still looking for the 64 bit one.
To solve it all I had to do was change the JAVA_HOME and the variable in my Path, clean my project and rebuild it.
Just set JAVA_HOME and JDK_HOME ambient variables, clean your solution and build again. For me worked fine.
Don't forget to clean your solution.

Tesseract OCR Build Issue on Windows

I have Windows 8.1, Android Studio and NDK installed.
I am making an OCR android app and following this tutorial
http://www.codeproject.com/Tips/840623/Android-Character-Recognition
I am facing a problem at building the project.
I updated my PATH in System Variables to
“C:\Program Files\Java\jdk1.8.0_25\bin;D:\Softwares\Studies\Android\android-sdk\tools;D:\Softwares\Studies\Android\android-ndk-r10d”
And then first I executed “ndk-build” command on DOS which executed successfully and then when I executed this command
“android update project --path D:\Softwares\Studies\Android\OCR\Code_Project\tess-two-master\tess-two”
I got this error:
“ `'xcopy' is not recognized as an internal or external command, operable program or batch file`.
Error:
The project either has no target set or the target is invalid.
Please provide a --target to the 'android.bat update' command.
”
I ve searched all over the internet but could not find the solution, can you please help me with this?
Thanks
I have searched the whole internet and could not find a single place where the proper ans is given.
This had basically two parts:
i) "xcopy" is not recognized
ii) The project either has no target set or the target is invalid.
Please provide a --target to the 'android.bat update' command.
The first part part can be solved by any of the two ways:
i) Moving xcopy.exe file from Windows/System32 folder to android-sdk\tools folder OR
ii) Adding %SystemRoot%\system32 to PATH in System Variables in Environment Variables. The PATH must contain android-sdk\tools;android-ndk-r10d;%SystemRoot%\system32 at least.
Now comes the second part. Enter this command:
android update project --path (location of tess-two folder) --target android-19 (19 is the API level here and may vary)
for e.g. android update project --path D:\Softwares\Studies\Android\OCR\Code_Project\tess-two-master\tess-two --target android-19
THAT'S IT. Hope it is clear even to someone who is very new. :)
Ps. If you find it useful, please do vote up, I am new and need reputations. :)
This blogpost has a elaborate description on how to build tesseract on Windows using Eclipse.

No LeapJava in java.library.path

I'm encountering a problem with the build of my JavaFX project with the Leap Motion.
When I run the file.jar, the application's window is opening, but when I call the leap motion, it's not working any more.
I have the following error :
Native code library failed to load.
java.lang.UnsatisfiedLinkError: no LeapJava in java.library.path
Yet, I have configured the buildpath. I have added the leapJava.jar, with the native library x64.
I don't understand why it doesn't work ?
Anyone with an idea ?
Thanks
The LeapJava.dll is missing or the Java library path is not set up correctly. Please have a look at the docs - setting up a project:
https://developer.leapmotion.com/documentation/java/devguide/Project_Setup.html
I have followed each step in the Eclipse section. :/
Firstly, since you haven't mentioned any specification about your system, I am answering this in context with a 64 bit Ubuntu machine.
You will posses a libLeap.so and a libLeapJava.so in 'YourDeveloperKitDirectory'/LeapSDK/lib/x64/ . These files should be copied to your /usr/lib and the configuration/bulid path (if using IntelliJ IDE -> 'Edit Configurations'->'Application'->'configuration'->'VM options'->"-Djava.library.path=/usr/lib") should be appropriately stated.
Save and run your application.
I had this problem, what solved it was adding -Djava.library.path=/Path/to/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib to the command line call for the .jar file. (make sure your developer kit is the right version)
So rather than:
java -jar leapMotionProgram.jar
It had to be:
java -jar -Djava.library.path=/Path/to/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib leapMotionProgram.jar

Create a portable Android/Eclipse on Mac/OSX

I'm trying to create a portable environment (USB Flash/Disk) that can be copied from one device to another - and work "out of the box" on a Mac/OSX (10.10.x environment) specifically. My purpose for this, is I'm teaching a "Portable Programming" class next semester, and I want to be able to just copy (or give the student a .zip file), have them expand it on a specifically named volume, and the environment works. This includes the SDK version(s), AVDs, etc. I've got everything apparently working (so far), but have a problem with the AVDs.
This is a new install, using latest Eclipse, etc.
I'd hoped to find these directories, etc. within an XML/INI file, and use an editor or sed to change the strings, but can't seem to find the directory names of anything I've needed to change so far within an XML/INI file within the unzipped Android directory - but don't see them.
I do see a reference within Preferences->Android->Build "Default debug keystore" that references ~./android - but it is not editable. There IS a "custom" debug keystore setting on the same dialog page, but changing it does not seem to have an effect on the AVDs and their location. So far, that's the ONLY reference I've found for my home directory. I've looked at the Eclipse CLI at eclipse.org, but don't seem to see anything relating to this issue (at least not anything that's ringing a bell with me).
So - how can I change my default "home" directory (without boogering up the environment, etc.) for Eclipse/Android, so my AVDs (and whatever else I HAVEN'T run into yet), can be installed and used/run from the USB drive/stick?
Please - I DO NOT WANT links to other "portable" packages, as I'm not sure what's actually been altered in them (and probably not current, and an update is likely to hose everything anyway), and don't want to pass along anything to students. I'm downloading official packages from official locations, and want to keep it that way. So I'm only looking for things that can be fixed/edited within an officially installed environment to get the effect I'm looking for. Thanks!
Found this at Launch mac eclipse with environment variables set
There is an alternate solution which involves replacing the executable that is run by MacOS X when the user launches the Eclipse application with a shell wrapper that sets up the environment.
Create an empty text file called "eclipse.sh" in the Eclipse application bundle directory /Applications/eclipse/Eclipse.app/Contents/MacOS.
Open the eclipse.sh in a text editor an enter the following contents:
#!/bin/sh
export ENV_VAR1=value
export ENV_VAR2=value
logger "`dirname \"$0\"`/eclipse"
exec "`dirname \"$0\"`/eclipse" $#
In the example ENV_VAR1 and ENV_VAR2 are the environment variables being set up. These variables will be visible to processes launched from within Eclipse. The logger command will just log the path of the eclipse executable to the system.log as a debugging aid.
In the Terminal set the executable flag of the shell script eclipse.sh, i.e.:
chmod +x /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.sh
Open the Eclipse.app Info.plist and change the value for the key CFBundleExecutable from eclipse to eclipse.sh.
MacOS X does not automatically detect that the Eclipse.app's Info.plist has changed. Therefore you need to force update the LaunchService database in the Terminal by using the lsregister command:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/Eclipse.app
The next time you launch Eclipse.app from the Dock or from the Finder the environment variables should be set.
It took me a while to research, as that info was from Sep. '09, which was back in Snow Leopard (OSX 10.6) days. I'm now running 10.10, and while some things don't change - a LOT has changed, so it took a while to research the above approach and make sure it wasn't going to do some potential damage to the installation. A LOT of under-the-cover stuff has changed in those 4 versions, and I wasn't willing to just take off with it. I've also not found a good explanation of exactly what ANDROID_SDK_HOME actually controls - although this above approach seems to work - so far.

JVM: could not open

Error - JVM - BlackBerry 9800
Simulator
--------------------------------------- JVM: could not open
C:\Users\Bayron.Tellez\Downloads\eclipse-java-helios-win32\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\simulator\Java\net_rim_bis_lib.cod
My friend installed Eclipse with the Blackberry simulator. I'm assuming it was a portable installation because at no point we were prompted to install.
Now, he zipped it up and copied it to my machine when running I receive that error above. Obviously it's because it's trying to look for something on my friends directory. How can I change it to my path?
My path is:
C:\Eclipse\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\simulator\Java\net_rim_bis_lib.cod
Where do I change this?
I would suggest not running eclipse from a copy of someone else's installation. This will probably contain lots of installation-specific files which are unlikely to match your machine.
Why not install it yourself, then install the Blackberry Java Developer plugin? It's available at http://na.blackberry.com/eng/developers/javaappdev/devtools.jsp
You can change the early installed paths of all .cod files from xml.manifest
[Eclipse Installed Path]\plugins\net.rim.ejde.componentpack7.1.0\components\simulator\[BlackBerry simulator version].xml.manifest
Eg:
C:\Program Files\Eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components\simulator\9800.xml.manifest
Then remove the [BlackBerry simulator version].xml.manifest.bin file.
Now it should be work.
You may also want to check file Settings.rc,
found in the folder
PATH\plugins\net.rim.ejde.componentpack4.6.1_4.6.1.49\components\bin
first you have a path to your eclipse installation, and then corresponding Simulator you are trying to run.
hope this helps,
Use notepad++ to replace all occurrances of old directory into new directory in the eclipse directory.
Start the eclipse, and click clean simulator button.
That should be all.
Though it is not advisable to run a copy of eclipse, there is a very simple way for one to solve such a problem: it is by running the clean.bat file that is in the simulator folder of the specific component pack version folder. The path to that file would look like this: PATH\plugins\net.rim.ejde.componentpack[BlackBerry version]\components\simulator\clean.bat
I think that would do.
Still, installing a new version is the best option.
It will be better you install it yourself frsh rather than copying it from friends machine.
But you can give it a try.
Goto your eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29 directory and check do on of these files contain this path:
plugin.properties
plugin.xml
META-INF/eclipse.inf
.options
Or else you could grep for problem path in your plugin directory and replace same with updated path.
This error occurse cause your simulator have previously loadded application. Removing them solve your problem.
How to remove installed Java programs on the simulator?
Quote from Reset and clean the blackberry simulator:
Are you sick of having a million icons on your BlackBerry simulator for every HelloWorld and demo project you have every tested? Try this to remove old programs from the simulator and start with a clean ribbon. From the command line browser to your rim jde directory, switch to the simulator sub directory and run clean.bat. This program takes longer than you would expect (about 30 seconds or so on my 3 ghz machine).
UPDATE
Also delete all [app name].cod|cso|debug|jar files from simulator folder Also make sure projects you don't want on simulator are not active and are not in build configuration.

Categories

Resources