Solved

JNI and portability in java

Posted on 2006-11-22
6
300 Views
Last Modified: 2013-11-22
Hi,
I ve got a general question:
If I write a piece of functionality in c++ and make it provided to my java classes via JNI, what is the impact of this crossing on the portability of my java apllication , will it work on linux supposed that the c++ dlls compiled on windows xp or vice versa or not? how to solve this kind of non-portability due to JNI in case there is any?

thanks
0
Comment
Question by:TheSilverBullet
6 Comments
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 125 total points
ID: 17994631
> will it work on linux supposed that the c++ dlls compiled on windows
> xp or vice versa or not?

may not work. so and dll are different. You need to recompile it on windows, linux

> how to solve this kind of non-portability due to JNI in case there is any?
a. Use pure java
b. Use #ifdef WIN32...
   for different platforms
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17994633
Portability is limited. You can try recompiling under each platform - depends on what you're doing
0
 
LVL 92

Expert Comment

by:objects
ID: 17994676
depends on the portability of your C+ code. You solve it by making your native code portable.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:TheSilverBullet
ID: 17995531
Hi All,
Thanks for your invaluable contributions. actually I need to get the creation date of a list of files, java supports only getting file modification date, which does not suffice in my case, since my main application is written in java I would need a way to walk around this, is there alternative to c++ that migh work on other operating systems, at least the linux flavours ?

do I need to ask this in another thread or does suffice only to increase the points here?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17995554
Well different OSs treat file times in different ways too, so there again you would need to be in one #ifdef or other
0
 
LVL 92

Expert Comment

by:objects
ID: 17999130
you're best asking in a different TA, as its not really a Java question.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to build JSON File in Delphi 6 3 34
why cannot we forward request once the response is committed 2 42
javap bin 2 34
How to convert from xls to xlsx using java 7 39
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question