An error occur while running this code:
$ javac HelloWorld.java
$ javah jni HelloWorld
error: cannot access jni
class file for jni not found
javadoc: error - Class jni not found.
2 errors
how could I overcome it?
please give me a solution..
thanks.
Use javah -jni instead of javah jni.
Related
I have download the git repo containing the c++ tutorial for bazel and I am trying to compile the examples.
When performing the command bazel build //main:hello-world, I get the following error:
ccache: error: Failed to create temporary file for /home/username/.ccache/tmp/tmp.cpp_stderr: Read-only file system
Thus I tried several actions: sudo bazel, change permission to /.ccache/tmp/ folder but none has worked. How can I get ride of this error ?
I work on fedora27.
The reason for this error is that ccache is used and requires write access ~/.ccache.
See in Ondrej's comment to: Bazel building C++ sample with ccache fails
Using --sandbox_writable_path ~/.ccache fixes the issue without disabling the sandbox feature.
Solved using the option --strategy=CppCompile=standalone :
bazel build //main:hello-world --strategy=CppCompile=standalone
I am aware of similar questions on this site but none of them have helped to solve my problem.
I am very new at OCaml and am using the following tutorial about using Camlp4 https://github.com/ocaml/camlp4/wiki/OCaml_code_generation_tutorial
However I get an error on the first line:
open Camlp4.PreCast
saying "Unbound module Camlp4"
There is a camlp4.exe file where I have downloaded OCaml so I assumed it was installed. I have tried this both on Windows 8 and Xubuntu
This is the input I am passing to the command line to compile the file:
ocamlc -o test.exe test.ml
where test.ml is the file that contains the line with the error
You should know that camlp4 is deprecated, you should use ppx instead.
If you need to compile an old programs using camlp4, they should have instructions on how to build. Anyway it's very rare to use ocamlc directly, you should try ocamlbuild or at least use ocamlfind.
Since my original question was met with dead silence, I've futilely tried more research and experimentation. I think it should be possible to install PyGLPK in Python 2.7 on Windows because I managed to get PyGLPK installed in Python 2.7 on Ubuntu, but I just cannot seem to do the same in Windows 7.
I am beginning to suspect that it has something to do with not "installing" GLPK properly on Windows, but I am at a bit of a loss for how to properly do that. The "official" way of doing it (according to this) is to "copy the DLLs to %SystemRoot%nsystem32 (e.g. c:\windows\system32)," but that is confusing because there are dll files with "dll" in the name, dll files without "dll" in the name, batch files with "dll" in the name, files that aren't classified into any particular type, and should I copy the dll's directly or put them inside what folder or subfolder? I tried just putting everything directly under C:/Windows/System32, but that didn't help me install PyGLPK.
Here is the full text of the error message I am getting after I try "python setup.py build --compiler=mingw32 install":
running build
running build_ext
building 'glpk' extension
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Isrc -IC:\Python27\include -IC:\Python27\PC -c src\glpk.c -o build\temp.win32-2.7\Release\src\glpk.o -m32
In file included from src\glpk.c:21:
src\lp.h:24:18: error: glpk.h: No such file or directory
In file included from src\glpk.c:21:
src\lp.h:32: error: expected specifier-qualifier-list before 'glp_prob'
src\lp.h:49: error: expected ')' before '*' token
src\glpk.c: In function 'initglpk':
src\glpk.c:52: error: 'GLP_MAJOR_VERSION' undeclared (first use in this function)
src\glpk.c:52: error: (Each undeclared identifier is reported only once
src\glpk.c:52: error: for each function it appears in.)
src\glpk.c:52: error: 'GLP_MINOR_VERSION' undeclared (first use in this function)
src\glpk.c:53: warning: implicit declaration of function 'glp_version'
src\glpk.c:53: warning: passing argument 2 of 'strcmp' makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1
I would really like to be able to use this tool for my thesis project so this is very important to me. Thank you to anyone who has any clue about what to do here.
Maybe you can download binaries from here and just install like other applications on windows. I have done in this way but have not test yet.
I am new to JNI and swig and I'm trying to access AMD's ADL-SDK v6 from clojure but am running into some errors.
;; Clojure 1.5.1
=> (com.vnetpublishing.swig.adl.AdapterInfo.)
UnsatisfiedLinkError com.vnetpublishing.swig.adl.adlsdkJNI.new_AdapterInfo()J com.vnetpublishing.swig.adl.adlsdkJNI.new_AdapterInfo (adlsdkJNI.java:-2)
=> (System/loadLibrary "libatiadlxx")
UnsatisfiedLinkError no libatiadlxx in java.library.path java.lang.ClassLoader.loadLibrary (ClassLoader.java:1886)
The swig template is as follows
/* File jadl-sdk.i */
%module adlsdk
%{
#include "adl_sdk.h"
%}
%include "adl_defines.h"
%include "adl_structures.h"
%include "adl_sdk.h"
The classes were generated with the following command
swig -java -package com.vnetpublishing.swig.adl -v -DLINUX -I${JAVA_HOME}/include -I${JADL_PATH}/ADL_SDK/include -outdir ${PACKAGE_PATH} jadl-sdk.i
Does anyone know how to get this to function?
-edit-
I have been able to get this to partially function using
(clojure.lang.RT/loadLibrary "atiadlxx")
(clojure.lang.RT/loadLibrary "jadlsdk")
The only problem is the jadlsdk library isn't on the java.library.path , it is inside a jar, and I can't get it to load from leiningen.
I have solved the problem. The solution was to run the loadLibrary call as part of the static constructor and to install the swig generated wrapper library as a system library (On linux under /usr/lib).
The complete code is available on github at https://github.com/rritoch/WarpCTL/tree/master/extra/JADL-SDK
Once the wrapper library has been installed, and the java wrapper code has been compiled to a jar it can be loaded in the project.clj under :resource-paths
The clojure side code can be accessed # https://github.com/rritoch/WarpCTL
I am trying to compile some Clojure code to Java using the Clojure 1.2 compiler. I am including the Clojure and Clojure-contrib 1.2 jars in the classpath. When I do the compile it fails and I get the folowing error:
Exception in thread "main" java.lang.ClassNotFoundException: clojure.contrib.io.Streams (io.clj:121)
: Has anyone seen this before?
Update:
Here is the line I use to compile my clj files:
java -cp "..\lib\h2.jar;..\lib\vaadin-6.4.4.jar;..\lib\clojure.jar;..\lib\clojure-contrib.jar;..\lib\wlfullclient-10.3.0.0.jar;..\..\..\..\..\jre1.6windows32bit\lib\rt.jar;." -Dclojure.compile.path=cljclasses clojure.lang.Compile oe.main.oe-main
clojure.contrib.io.Streams is a protocol defined in clojure.contrib.io
To help you more you have to share more details about how and what you are trying to compile.
use (compile 'oe.main.oe-main) from a clojure REPL using the same class path, and this works