Solved

JNI and portability in java

Posted on 2006-11-22
6
289 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now