Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

JNI and portability in java

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
TheSilverBullet
Asked:
TheSilverBullet
1 Solution
 
Ajay-SinghCommented:
> 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
 
CEHJCommented:
Portability is limited. You can try recompiling under each platform - depends on what you're doing
0
 
objectsCommented:
depends on the portability of your C+ code. You solve it by making your native code portable.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
TheSilverBulletAuthor Commented:
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
 
CEHJCommented:
Well different OSs treat file times in different ways too, so there again you would need to be in one #ifdef or other
0
 
objectsCommented:
you're best asking in a different TA, as its not really a Java question.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now