I've been building PhoneGap apps for BlackBerry for about a year now. Suddenly, the build process is hitting errors like this:
build:
[exec] [INFO] Parsing command line options
[exec] [INFO] Parsing bbwp.properties
[exec] [INFO] Validating application archive
[exec] [INFO] Parsing config.xml
[exec] [WARNING] Failed to find the <author> element
[exec] [INFO] Populating application source
[exec] [INFO] Compiling BlackBerry WebWorks applicatio
n
[exec] I/O Error: Cannot run program "C:\Program": CreateProcess error=2, T
he system cannot find the file specified
[exec] [ERROR] RAPC exception occurred
I suspect this may have something to do with a recent Java update (Java 7 maybe?)
I've tried the old DOS 8.3 trick of using PROGRA~1 instead of Program Files in the bbwp.properties and project.properties files. None of that seems to help.
Any ideas where else the problem might reside?
I've seen a few other people out on the Internet asking the same question, so I'll post my solution here in case it helps those who hit the problem in the future.
The root of the problem seems to be related to the upgrade to Java 7. The combination of it and Apache Ant get hung up on file paths with spaces. After hours of tinkering, the best solution was to reinstall Java, Apache Ant, WebWorks and PhoneGap. Each were placed in a folder off the root of the C:\ drive with no spaces in the filenames.
C:
├ \ant
├ \java
├ \phonegap
└ \webworks
Once I had this org structure, and reset all of the environment variables (PATH, JAVA_HOME, ANT_HOME, etc.) the builds all started working again. Just make sure you update your project.properties file in your project folder.
Update:
It may also be helpful to use the DOS Where command to see where Java resides on your hard drive.
> where java
In my case, the JAVA_HOME path pointed to Java 1.6, but a check of the Java version from the command line (java -version) showed that Java 1.7 was being run. The reason was that Java.exe had been installed in my C:\Windows\System32 folder (why?), and since that folder is the first entry in my PATH variable, that version of java.exe is what gets run. Always.
Bottom line: Use the DOS Where command to ensure the version of java being run by ANT is really the version you think it is.
The problem is that Webworks installer copies the JAVA PATH to a couple of files:
installvariables.properties (<java>XXXXXXXXXXX</java>)
bin\bbwp.properties (Java_Home=XXXXXXXXXXXX)
That leads to errors when compiling, even if you have changed your PATH variables and JAVA instalation.
Change the value to the correct path in these files to solve the problem.
Is recommendable to install all this stuff in non-whitespace paths because that could lead to other compiling problems.
Related
Here's what I did:
Downloaded Apache ZooKeeper 3.4.6 (.tar file), extracted to C:\cygwin\home\user\zookeeper-3.4.6\
Ran ant at the root of the ZooKeeper folder (C:\cygwin\home\user\zookeeper-3.4.6)
Navigated to C:\cygwin\home\user\zookeeper-3.4.6\contrib\ZooInspector\
Ran ant, and I get the following error:
Output:
Buildfile: C:\cygwin\home\Jean\zookeeper-3.4.6\contrib\ZooInspector\build.xml
BUILD FAILED
C:\cygwin\home\user\zookeeper-3.4.6\contrib\ZooInspector\build.xml:19: Cannot find C:\cygwin\home\user\zookeeper-3.4.6\contrib\build-contrib.xml imported from C:\cygwin\home\user\zookeeper-3.4.6\contrib\ZooInspector\build.xml
Total time: 0 seconds
This leaves me with no .cmd or .sh file to execute. How come the build-contrib.xml file isn't there?
Also, I noticed that there seems to be an already-compiled ZooInspector JAR file: zookeeper-3.4.6-ZooInspector.jar. However, attempting to run it with the following command yields failure too:
$ java -cp zookeeper-3.4.6-ZooInspector.jar:lib/* org.apache.zookeeper.inspector.ZooInspector
Error: Could not find or load main class org.apache.zookeeper.inspector.ZooInspector
This is a bit frustrating -- setting up the ZooKeeper server was straightforward but for some reason I just can't figure out how to run this standalone GUI. What am I missing?
For windows:
#echo off
set cp="./*;./lib/*;../../*;../../lib/*"
java -cp %cp% org.apache.zookeeper.inspector.ZooInspector
ZooInspector 3.4.6 (that's bundled with ZooKeeper 3.4.6) doesn't seem to be able to connect to a running ZooKeeper instance on Windows.
Better use zkui:
https://github.com/echoma/zkui/wiki/Download
zooInspector just need 3 libraries and 1 jar to load the main class.
the mainclass lives zookeeper-3.3.0-ZooInspector.jar and it needs jtoaster-1.0.4.jar, zookeeper-3.3.0.jar and finally log4j-1.2.15.jar
After download the tar.gz file from apache servers, you must untar and build with ant. finally copy the zookeeper-3.3.0.jar and log4j-1.2.15.jar to contrib/ZooInspector/lib/. Finally cd to contrib/ZooInspector and launch this command
java -jar zookeeper-3.3.0-ZooInspector.jar -cp lib/*
I met the same issue today, and created a pre-compiled version, which should work on Windows as well. You can find details here:
https://www.admon.org/scripts/zooinspector-zookeeper-graphic-interface/
I am trying to make a PhoneGap package for Symbian. I've installed Cygwin with the "make" package. and when I'm typing "make on the symbian folder it gives me this error:
cp lib/phonegap.js framework/www/phonegap.js
cd framework/ && zip -r app.zip www/* -x www/wrt_preview_frame.html www/wrt_prev iew_main.html www/preview/ www/*.wgz
cygwin warning:
MS-DOS style path detected: /usr/local/bin/C:\Program
Preferred POSIX equivalent is: /usr/local/bin/C:/Program
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Can't find C:\Program on PATH.
Makefile:28: recipe for target `package' failed
make: *** [package] Error 29
My PhoneGap folder is directly on the C: drive and without any spaces. Any ideas?
I think you have in your PATH the Symbians tools which contains the make tool, so you are not executing cygwin's make.
First check what make you are executing
type make
If you get something like this:
/cygdrive/c/Program Files (x86)/Common Files/Symbian/tools/make
Then it means your PATH is wrong and you aren't executing the correct make.
Be sure to have installed the Cygwin's make package and modify your PATH so it takes the correct "make".
I've solved this problem by adding Java Runtime Environment path to Windows environment Variables after installing latest copy of cygwin. (eg. C:\Program Files\Java\jre6\bin)
I have a project which includes a number of test cases and I compile it using the Maven surefire plugin 2.13. When I set the forkmode = none everything works fine,but when I omit that entry, the default forkmode become once and my project fails:
Forking command line: cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_37\jre\bin\java" -jar G:\Gottware-server\core\math\target\surefire\surefirebooter
7758025909061587587.jar G:\Gottware-server\core\math\target\surefire\surefire8735550212668630533tmp G:\Gottware-server\core\math\target\surefire\suref
ire_08386349728753606434tmp"
The system cannot find the path specified.
It looks like it's an OS problem, I am using Windows 7. What can be going wrong? IT's curious that also after succesfull builds I get the same error:
[INFO] -----------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------
[INFO] Total time: 15.504s
[INFO] Finished at: Fri Mar 08 15:08:54 CET 2013
[INFO] Final Memory: 13M/353M
[INFO] -----------------------------------------------
The system cannot find the path specified.
In fact I have debugged my last line of my maven of the mvn.bat
cmd /C exit /B %ERROR_CODE%
and this simply does not work anymore returning:
The system cannot find the path specified.
I further went down in debuggining:
U:\>cmd.exe
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
The system cannot find the path specified.
In the line you pasted, I see a doubled double-quote:
Forking command line: cmd.exe /X /C ""C:\Program
^^^^
Maybe you've set a bad value for JAVA_HOME (or some other place where you've defined the Java path). This would also explain why it doesn't fail on other systems: you've got a different (and correct) JAVA_HOME there.
The surefire plugin doesn't always report friendly errors. Couple of things I can think to check:
How much disk space is available in G:\Gottware-server\...? Could you be bumping up against a disk quota (on a NAS share) or is your laptop drive full?
Check where the local artifact repository is located too. Have you hit a quota/run out of room there?
How much memory is available on the build machine? Do you have enough memory available to run the tests in a separate JVM, and if yes, is the JVM configured to have enough memory? You may try using the <argLine> property to configure memory settings for the forked VM. (I've also helped someone who had huge memory settings in <argLine>, more than was available on their machine when running Eclipse, and multiple browser windows, etc. In that case lowering the memory settings for the forked JVM solved the problem.)
I had the same error, and it was there becase I had a bat file launched automatically when cmd launched (and I guess some linked paths issues).
I will quote this answer to explain my solution: https://superuser.com/questions/144347/is-there-windows-equivalent-to-the-bashrc-file-in-linux#answer-916478
My script was called bashrc.bat, which I placed under my %USERPROFILE% folder.
In registry editor (regedit) I located the following entry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
And then added a key called Autorun with value %USERPROFILE%\bashrc.bat
When I removed this key from registry, after launching cmd again, the line The system cannot find the path specified. was not displayed anymore and surefire could resume its activities.
First off I'm on Ubuntu linux if that matters.
I have a simple project idea based off of FreeTTS and the JSAPI (Java Speech API)
I've downloaded and unpacked FreeTTS and run their build script. Then tried compiling my code linking several jar's required in the lib directory into the class path like this:
javac -cp /home/travis/Desktop/freetts-1.2/lib/jsapi.jar:/home/travis/Desktop/freetts-1.2/lib/freetts.jar HelloUnleashedReader.java
Which then compiles to java bytecode just fine.
However when I run:
java HelloUnleashedReader
I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/speech/EngineModeDesc
Any help on this issue would be greatly appreciated as there are many sites around the net discussing problems with getting it to work but not many that discuss their solution.
I see that you are using Ubuntu. You must agree to the binary license before you can use jsapi.jar. You agree to this license in the process of unpacking it. To unpack jsapi.jar in Ubuntu you would type the following:
cd ~/Desktop/freetts-1.2/lib
chmod +x ./jsapi.sh
./jsapi.sh
if you receive a message like
"./jsapi.sh: 1428: uudecode: not found"
then install uudecode with
sudo apt-get install sharutils
and try again
You need to add the jsapi.jar into your classpath. The jsapi.jar can be unpacked by running lib/jsapi.exe inside the freetts installation directory.
I got this error despite I had jsapi.jar on classpath.
java -cp `ls *.jar | awk '{ORS=":";print}'` -jar WebStartClock.jar
What helped me was specifying the main class explicitely:
java -cp `ls *.jar | awk '{ORS=":";print}'` JSAPIClock
Probably something wrong in the JAR metadata or so.
I'm trying to better integrate Eclipse with my build.xml.
My build file calls GNU Make for the native portion of the program, and the Makefile uses sudo to movethe compiled libs into system path.
Unfortunately that requires entering a password, and Eclipse's terminal doesn't accept user input.
So the result from running the build in eclipse is:
[exec] sudo: no tty present and no askpass program specified
[exec] make: *** [install] Error 1
Any way around this problem? Can the ant build be elevated to root some other way?
You could set up your /etc/sudoers file so that it specifies NOPASSWD: for the user under which Eclipse is running, and for the command you're using to move the libs. Using the visudo command, you could add this to the end of /etc/sudoers:
eclipseuser ALL = NOPASSWD: /bin/cp
Be aware that this does present a security risk as the eclipseuser would then have the power to overwrite any file on the system.
Set up a separate account, e.g. deployer. Modify /etc/sudoers to include aliases that allow deployer to execute a single command, e.g. deploy, as root. Make deployer NOEXEC:. Store the deployer password in an invisible file, e.g. .deployconf having user-only access: e.g. 400 or 600. Load the password in ant, and use as required:
<loadfile srcfile="${user.home}/.deployconf" property="deployconf"/>
This works well with <signjar/>, but I've not tried it with <exec/>. Some effort may be required to keep linefeeds out of .deployconf.
Perhaps a stupid 'solution', but why not make the deploy a separate step? Have the build make an packaging artifact: DEP, RPM or something.