• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is JNI crossplatform ?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, expert

Is the JNI cross platform ? As we know, java is crossplatform, so what if we use up JNI and build app with some dll(win32) .

Then can the app run at Linux with that dll? Or we need to recompile the native code again in Linux?

Is there anyway to embed C/C++ code inside java and make it work like pure java ? mean it can be crossplatform.

Thanks for reply.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The deal with JNI and native code is that it calls code which is "native" to a particular platform. So it doesn't matter that Java itself is cross platform, it doesn't build the functionality of the particular piece of native code into the java byte code, it just supplies a bridge. So its still the dll which will do the work - and so you'd need a platform which can run that particular dll to run that java code.
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic