File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes fatal error : jni.h when runnin make/make-sheduler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "fatal error : jni.h when runnin make/make-sheduler" Watch "fatal error : jni.h when runnin make/make-sheduler" New topic
Author

fatal error : jni.h when runnin make/make-sheduler

anouar jock
Greenhorn

Joined: May 03, 2011
Posts: 8

Hello,

I download the source code of job scheduler (Linux version) to change it in order to have the desktop interface (job scheduler object editor) in French.
the download link is below:

http://jobscheduler.sourceforge.net/...ownload_en.php

But unfortunately, extensions are. class.
So I tried to compile the project to obtain the .java files following job_scheduler_how_to_compile_en.pdf document that exists in the downloaded source code folder.

I compiled the source code of job scheduler, but this command

returns this error
. / z_com.h: 43: fatal error: jni.h: No such file or folder of this type

Any solutions please ?

that's exactly what I command returns the make / make-scheduler

make: "libxml2.a is updated.
make: "libxslt.a is updated.
g + + ...-c-g-MD-Wall-Wno-sign-compare-Wno-long-long-Wuninitialized-DNDEBUG-O2-m32-DMAKE_UBUNTU-Wno-deprecated-Wno-reorder-Wno-non-virtual-DTOR .. / log.cxx
In file included from ../xml_libxml2.h: 43,
from .. / log.cxx: 40:
.. / z_com.h: 43: fatal error: jni.h: No such file or folder of this type
Compilation terminated.
make: *** [log.o] Error 1

Note:I use ubuntu 11.04, but I encountered the same problem in ubuntu 10.10. I already installed java because the command returns java version "1.6.0_22"
Regards
jockhip12
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

You need to add an include directive to your compilation command. Something along the lines of

-I $JAVAHOME/include

where $JAVAHOME is the path to your JDK installation directory.

You may also need to add

-I $JAVAHOME/include/linux

Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

James is right, although I believe there shouldn't be a space between the -I and $JAVA_HOME$: -I$JAVA_HOME/incude -I$JAVA_HOME/include/linux.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
anouar jock
Greenhorn

Joined: May 03, 2011
Posts: 8

Thank you foe the answers.

but I didn't understand very well.

where I need to add an include directive to my compilation command?

should I start with after that I running the command

the same question for this command
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Rob Spoor wrote:James is right, although I believe there shouldn't be a space between the -I and $JAVA_HOME$: -I$JAVA_HOME/incude -I$JAVA_HOME/include/linux.


A space should not be necessary since the OP is using g++ .
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

[quote=anouar jock

but I didn't understand very well.

where I need to add an include directive to my compilation command?

Somewhere in the build script there will be a compilation command starting with g++ (though this might be hidden from obvious view by the use of a macro). You should modify that command along the lines I indicated. If you have any doubt then you need to look at the 'man' page for g++.

Your lack of background knowledge of Linux and g++ is likely to make this a very difficult problem for you to solve.
anouar jock
Greenhorn

Joined: May 03, 2011
Posts: 8

so, if I understand you, I should modify the source code of the make-scheduler file ?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

anouar jock wrote:so, if I understand you, I should modify the source code of the make-scheduler file ?


You have to modify something in the build system but without looking in detail at how the program is built I can't say what needs changing.

anouar jock
Greenhorn

Joined: May 03, 2011
Posts: 8

Hello,

I installed MinGW on windows to compile the source code under windows job scheduler.
the comand
that returned in Ubuntu fatal error:. / z_com.h: 43: fatal error: jni.h: No such file or folder of this type
returned, this time fatal error: zlib.h: No such file or folder of this type

What should I do please?

Regards
jockhip12
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

I seem to be missing something. You were trying to build on Linux and failing because you did not have the correct 'include' directives in the compilation. For some reason I really don't fathom you are now trying to build on Windows using MinGW and are getting a similar error to that you obtained on Linux but don't seem to understand that the basic problem is the same - once again you don't have the correct 'include' directives.

Until you spend time learning about g++ I don't see how anyone can help you.

Sorry but I can't help any further.

anouar jock
Greenhorn

Joined: May 03, 2011
Posts: 8

Ok
Thank you any way

have a nice day
=)
anouar jock
Greenhorn

Joined: May 03, 2011
Posts: 8

To compile the source code of job scheduler, I created the symbolic link for java:
and another for perl
But during the compilation, the command

returns this error
cc1plus: error: / home/jockhip12/scheduler_sources.1.3.10.1090/scheduler/prod/LINKS/java/include: Not a folder
make: *** [log.o] Error 1


and the make command returns this error LINKS / java / include: Not a file and / LINKS / java / include / linux: Not a folder

There is a mistake when creating the link or what?
Thank you
anouar jock
Greenhorn

Joined: May 03, 2011
Posts: 8

the directory / java / include does not exist, that is why the command make / make-scheduler generates an error. I created manually the folders and I recompiled the project. That's what the command returns this time
make: « libxml2.a » est à jour. make: « libxslt.a » est à jour. g++ ... -c -g -MD -Wall -Wno-sign-compare -Wno-long-long -Wuninitialized -DNDEBUG -O2 -m32 -DMAKE_UBUNTU -Wno-deprecated -Wno-reorder -Wno-non-virtual-dtor ../java.cxx In file included from ../java.cxx:37:0: ../z_com.h: In function ‘bool zschimmer::com::variant_is_empty(const zschimmer::com::Variant&)’: ../z_com.h:836:60: warning: suggest parentheses around ‘&&’ within ‘||’ ../java.cxx: In member function ‘void zschimmer::javabridge::Vm::start()’: ../java.cxx:655:7: warning: suggest explicit braces to avoid ambiguous ‘else’ ../java.cxx: In function ‘void zschimmer::javabridge::throw_java_ret(int, const std::string&, const std::string&)’: ../java.cxx:1147:14: error: ‘JNI_ENOMEM’ was not declared in this scope ../java.cxx:1148:14: error: ‘JNI_EEXIST’ was not declared in this scope ../java.cxx:1149:14: error: ‘JNI_EINVAL’ was not declared in this scope ../java.cxx: In member function ‘int zschimmer::javabridge::Method::int_call(__jobject*, const zschimmer::javabridge::Parameter_list&) const’: ../java.cxx:2076:92: error: invalid conversion from ‘const jvalue*’ to ‘jvalue*’ ../java.cxx:2076:92: error: initializing argument 3 of ‘jint _Jv_JNIEnv::CallIntMethodA(__jobject*, _jmethodID*, jvalue*)’ ../java.cxx: In member function ‘__jobject* zschimmer::javabridge::Method::jobject_call(__jobject*, const zschimmer::javabridge::Parameter_list&) const’: ../java.cxx:2132:99: error: invalid conversion from ‘const jvalue*’ to ‘jvalue*’ ../java.cxx:2132:99: error: initializing argument 3 of ‘__jobject* _Jv_JNIEnv::CallObjectMethodA(__jobject*, _jmethodID*, jvalue*)’ ../java.cxx: In member function ‘std::string zschimmer::javabridge::Method::string_call(__jobject*, const zschimmer::javabridge::Parameter_list&) const’: ../java.cxx:2146:106: error: invalid conversion from ‘const jvalue*’ to ‘jvalue*’ ../java.cxx:2146:106: error: initializing argument 3 of ‘__jobject* _Jv_JNIEnv::CallObjectMethodA(__jobject*, _jmethodID*, jvalue*)’ ../java.cxx: In member function ‘int zschimmer::javabridge::Static_method::int_call(__jclass*, const zschimmer::javabridge::Parameter_list&) const’: ../java.cxx:2248:93: error: invalid conversion from ‘const jvalue*’ to ‘jvalue*’ ../java.cxx:2248:93: error: initializing argument 3 of ‘jint _Jv_JNIEnv::CallIntMethodA(__jobject*, _jmethodID*, jvalue*)’ make: *** [java.o] Erreur 1

Any solution please ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fatal error : jni.h when runnin make/make-sheduler