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)
Related
I'm trying to set up Cordova. When I run cordova build android I receive the following error:
(node:6816) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Failed to run "javac -version", make sure that you have a JDK installed.
You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.
Your JAVA_HOME is invalid: C:\Program Files\Java\jdk1.8.0_161;C:\Program Files\Java\jdk1.8.0_161\bin
However I can run javac -version just fine.
C:\>javac -version
javac 1.8.0_161
I've tried to set JAVA_HOME in various ways: pointing to the root; pointing to the bin folder; set it as a User variable and also a System one; add %JAVA_HOME%\bin to Path (both for User and System) and so on.
I've checked several articles about this issue, and they say that if I'm able to use javac -version then that's supposed to indicate that my environmental variables are set correctly. Even if that's the case, Cordova still doesn't seem to recognize it.
Update
Following Stephen C's instructions, I've reset my variables, yet my error still persists. As you can see in the image I can call javac just fine, and both JAVA_HOME and Path seem to be set in the right way. (Note that actually it is %JAVA_HOME%\bin and not C:\Program Files\Java\jdk1.8.0_161\bin in the Path.)
I think you are confusing JAVA_HOME, PATH and CLASSPATH
The JAVA_HOME variable should be set to the name of a single directory. Not multiple directories with separators. The JAVA_HOME directory is the top directory of your JDK or JRE installation. Not the "bin" directory.
The PATH and CLASSPATH variables consist of a list of paths. For PATH the paths are pathnames for directories. For CLASSPATH the paths are pathnames for directories or JAR / ZIP files (or a particular kind of wildcard).
The PATH is where the shell searches for commands if you use a command name that is a simple name; e.g. java or javac.
`
The CLASSPATH is one of the ways that you can tell Java tools to look cor compiled classes to load, compile against, etcetera.
Your error message says this:
Your JAVA_HOME is invalid:
C:\Program Files\Java\jdk1.8.0_161;C:\Program Files\Java\jdk1.8.0_161\bin
This is wrong for two reasons:
JAVA_HOME should not be a path
C:\Program Files\Java\jdk1.8.0_161\bin is not a Java home. The Java home is C:\Program Files\Java\jdk1.8.0_161 .... probably.
The other thing you may have gotten wrong is that changes to environment variables do not necessarily propagate. For example, if you start a shell and then change an environment variable via the Windows GUI, the change may not propagate to the shell. You may need to exit the shell and restart it to pick up the new value.
If you are unsure, you can run (for example) echo %PATH% to see the current value of PATH in the current shell or script.
UPDATE
According to http://cordova.apache.org/docs/en/7.x/guide/platforms/android/index.html, you need to:
install Android Studio
set the ANDROID_HOME environment variable to the location of your Android SDK installation.
It is also recommended that you add the Android SDK's tools, tools/bin, and platform-tools directories to your PATH.
Remove java.dll from C:\Windows\System32 (if any).
I'm not sure but It may work correctly.
I have to convert my Matlab algorithm in Java. For this I'm using matlab builder ja toolbox, after following all the necessary steps, the build fails and this error is displayed:
'javac' is not recognized as an internal or external command, operable program or batch file. Error: An error occurred while shelling out to javac (error code = 1). Unable to build executable.
When typing java -version in the matlab command line, this is what i get:
Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
It means I should have this compiler of java installed on my computer, only then the matlab builder ja works. I'm new to Java, I'm not sure what compiler I should be looking for.
First make sure you have installed jdk and jre, both are installed with the java software development kit. The installation folder is typically C:\Program Files\Java.
Now go to Computer > Properties > Advanced system settings in the advanced tab click on Environment Variables
In System variables find the variable named Path, in the value of Path you will find a java path like C:\ProgramData\Oracle\Java\javapath, just change it to C:\Program Files\Java\jdk1.x.x_x\bin.
Hope that helps.
If you want javac (the compiler), you'll need to download the Java Development Kit (JDK), not just the Java Runtime Environment (JRE). Note that the JDK includes a JRE.
This tutorial give instructions to install JDK to your computer.
You need to make sure that Java SDK is installed and also PATH is set properly so that windows would be able to know where the executable is. Detailed steps on how to debug this issue is explained here: http://www.windows-commandline.com/javac-not-recognized-internal-external-command/
To solve the aforementioned problem follow the mentioned steps:
1) Copy the address location of your Java\jdk\bin folder usually installed in your C: drive. It should look something like this:
C:\Program Files (x86)\Java\jdk1.8.0_65\bin
2) Right click on My Computer-->Properties-->Change settings-->
Advanced-->Environment Variables.. -->New..
3) Now,
Set Variable name: PATH
Variable value: C:\Program Files (x86)\Java\jdk1.8.0_65\bin
4) Press OK, re-open your cmd and compile your program.
Hopefully it worked!
Path is defined as the filename. Ex, C://aklsej;dlfkj/blahblah
You will need to specify the full path in the system control panel, advanced system settings, edit variables, edit path, put a semicolon after the last entry and don't delete anything, and then add the full path wherever you installed java to.
to make this easy, do a search for javac in the search panel and then just add the full path to the environmental variables from there.
Set Following Environment Variables
It will works
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_09
set PATH=%JAVA_HOME%\bin
Download Java from given link according to your requirements.
http://www.oracle.com/technetwork/java/javase/downloads/index.html
then follow below steps:
Step-1 : Right Click on MyComputer and click on properties .
Step 2 : Click on Advanced tab
Step 3 : Click on Environment Variables
Step 4 : Create a new class path for JAVA_HOME
Step 5 : Enter the Variable name as JAVA_HOME and the value to your jdk bin path ie c:\Programfiles\Java\jdk-1.6\bin and
NOTE Make sure u start with .; in the Value so that it doesn't corrupt the other environment variables which is already set.
Step 6 : Follow the Above step and edit the Path in System Variables add the following ;c:\Programfiles\Java\jdk-1.6\bin in the value column.
Step 7 :Your are done setting up your environment variables for your Java , In order to test it go to command prompt and type
java
who will get a list of help doc
In order make sure whether compiler is setup Type in cmd
javac
who will get a list related to javac
Hope this Helps !
If you receive this error, Windows cannot find the compiler (javac).
Here's one way to tell Windows where to find javac. Suppose you installed the JDK in C:\jdk1.8.0. At the prompt you would type the following command and press Enter:
C:\jdk1.8.0\bin\javac HelloWorld.java
If you choose this option, you'll have to precede your javac and java commands with C:\jdk1.8.0\bin\ each time you compile or run a program. To avoid this extra typing, consult the lecture "Creating a Hello World application" in this website
Class names, 'HelloWorld', are only accepted if annotation processing is explicitly requested
If you receive this error, you forgot to include the .java suffix when compiling the program. Remember, the command is javac HelloWorld.java not javac HelloWorld.
I have a java program in which a use the GLPK Solver. The error that i receive when i run it on eclipse is the following:
The dynamic link library for GLPK for Java could not beloaded.
Consider using
java -Djava.library.path=
The current value of system property java.library.path is:
/Users/maria/Documents/solver_library/GLPK/w64
I had the same problem on my old windows computer and i solved it doing the following:
1. Adding in the Java Build Path->Libraries the glpk-java.jar file
2.Adding as the Native library location of the above jar the corresponding path (C:\ProgramFiles\solver_library\GLPK\w64
3. adding in the PATH environment variable the above path.
I am doing exactly the same things on my new MAC OS X computer but still receiving the above error. I did with exactly the same way the steps 1 and 2 above and also I modified through the terminal the PATH system variable. This now is:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/maria/Documents/solver_library/GLPK/w64
Could you please tell me if you have any idea of how to solve this? I am a new Mac user so i don't know many things.
Thanks in advance!
Here's what I did to make it work on OS X.
Install glpk.
I used for this homebrew
$ brew install glpk
$ brew install swig // this package we well need for glpk for java
Install glpk for java http://sourceforge.net/projects/glpk-java/files/glpk-java/
Unzip the archive with:
$tar -xzf glpk-java-1.0.37.tar.gz
$cd glpk-java-1.0.37
Configure with:
$./configure \
CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers \
SWIGFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
Make and install with:
$make
$make check
$make install
Now in swig dir you should have 3 jars:
glpk-java.jar, glpk-java-sources.jar, glpk-java-javadoc.jar and the .lib folder (hidden).
For compiling you need to put glpk-java.jar in your classpath and specify javac option -Djava.library.path=/YOUR_PATH/libglpk-java-1.0.37/swig/.libs
I have came across this problem while installing rJava on R3.0.1:
"configure: error: One or more JNI types differ from the corresponding native type"
The detailed message is attached below.
I searched for similar problems but my issue is a little trickier and many proposed solutions either didnt work or I could not try, because I am working on a server which I do not have write access to system libraries.
OS: Linux 2.6.18-348.6.1.el5 #1 SMP Tue May 21 15:44:27 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux (info given by typing "uname -a" sorry I couldn't quite understand this info)
R: R3.0.1, I downloaded the source, put in my home directory, and built R from source.
rJava: I ran 'install.packages("rJava")', during installation I got:
=========================
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/../include -
I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/../include/linux'
java libs : '-L/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/lib/amd64/se
rver -ljvm'
checking whether JNI programs can be compiled... yes
checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or
a different compiler in order to fix this.
ERROR: configuration failed for package 'rJava'
* removing '/home/me/R-3.0.1/library/rJava'
==================================
Since I can only access the server remotely, I do not have write access to anything outside my home directory /home/me.
Any information would be highly appreciated!
I ran into the same problem trying to install.packages("rJava") in R version 3.0.2, as long as I tried to install as ordinary user (Linux, Debian). There was no problem running install.packages("rJava") as root. Then, trying library(rJava) worked for root but not for me as a user:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/usr.local.original.Debian/lib/R/site-library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
This problem required to add the environment variables JAVA_HOME and LD_LIBRARY_PATH
to ~/.login (following instructions found at Trouble in Setting Java Environment Path on Ubuntu (libjvm.so: cannot open shared object file: No such file or directory)):
setenv JAVA_HOME /usr/lib/jvm/java-7-oracle/
setenv LD_LIBRARY_PATH $JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/server
# For c-shell; for bash, it would have to be:
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/server
So, you would have to have a system administrator install rJava for you, then set your environment variables and, of course, set your own .libPaths() in R such as to find rJava.
I hit the same issue on my mac OSx El Capitan. I tried updating the java paths/envs used by R using "R CMD javareconf" with no effects.
Finally, I saw that when I ran "R CMD javareconf" my Java library path: in the output was empty. By digging up further I figured out that my JAVA_HOME was not set correctly as pointed here https://stackoverflow.com/a/3311983 . I had to add an extra /jre in the JAVA_HOME path.
Using linux, specifically, 64 bit Gentoo, my solution was to add the following line to /etc/env.d/20java-config
LD_LIBRARY_PATH="/etc/java-config-2/current-system-vm/jre/lib/amd64:/etc/java-config-2/current-system-vm/jre/lib/amd64/server"
Then
Run env-update
source /etc/profile
start rstudio (or if you are using GUI menu, logout and login to load the environment)
The above change needs to be made by root but then will apply to non-root users who use the same system, on next login.
Basically, rJava conf test was failing to find libjvm.so, the conftest program would compile but not link :)
On OS X 10.8.2, I'm using JNA and gstreamer-java (through the Eclipse IDE) to load gstreamer libraries. At first I installed gstreamer using the SDK provided by gstreamer.com. However, I uninstalled this and use Macports to install it.
The SDK's libs were installed to:
/System/Library/Frameworks/GStreamer.framework/Versions/0.10-x64/lib
But that directory no longer exists.
Where Macports installed the libs to:
/opt/local/lib
Now, say I want to set java to know of this location via some environment variable. Is this possible? It seems so, because running this line:
System.out.println( System.getProperty("jna.library.path"));
Shows /System/Library/Frameworks/GStreamer.framework/Versions/0.10-x64/lib. But I cannot for the life of me figure out where that got set. It's not set as a runtime VM argument. My $PATH and $DYLD_LIBRARY_PATH, $LD_LIBRARY_PATH do not have this directory set. They actually have the path I want, /opt/local/lib/ set which has no effect it seems. Running env shows no variables with the Framework path either.
So, jna.library.path. Is it set externally? How can I change it--without setting it at runtime or via java command-line arguments? Zero points for telling me to symlink.
EDIT:
Searching through gstreamer-java's files led me to gstreamer-java.spec, which has this line:
sed -i [...] -e "s,\(run.jvmargs=-Djna.library.path=\).*,\1%{_libdir}:$(pkg-config --variable=pluginsdir gstreamer-0.10),"
Running the contained command pkg-config --variable=pluginsdir gstreamer-0.10 gets me this:
/opt/local/lib/gstreamer-0.10
Which is the correct path for plugins. Further running pkg-config --print-variables gstreamer-0.10 gives me all these:
typelibdir
datarootdir
exec_prefix
pluginsdir
datadir
prefix
libdir
includedir
girdir
toolsdir
Which are all at or under the correct /opt/local/ directory.
Have you tried running outside of Eclipse?