Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Interix, Java and Jni

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> Interix, Java and Jni Page: [1]
Login
Message << Older Topic   Newer Topic >>
Interix, Java and Jni - Oct. 3, '06, 12:09:38 PM   
gdueck

 

Posts: 2
Joined: Oct. 3, '06,
Status: offline
There have been a number of threads asking the same question: how can I use Java native methods with Interix? The problem is that while Java is started from an Interix shell command, it's actually running in the Win32 subsystem. As a consequence, native methods have to be implemented by Win32 dlls. This situation has been well-described in numerous answers to numerous questions posted to this forum.

This is all well and good, but my needs, and those of others who have posted this question, are to have an Interix port of Java that can reference native methods from .so libraries in native Interix format.

Are there any plans to port Java to the Interix platform?
Post #: 1
RE: Interix, Java and Jni - Oct. 3, '06, 1:50:45 PM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
AFAIK there are no plans for Microsoft to do so.

From a /Tools perspective:
It would be cool to have an Interix version of Java.
The difficulty is the the pain level to make it happen.
To build the current release of Java you need a running version of Java.
It's not a "perfect catch-22", but damned close to it. Most other
projects can be build with a C/C++ compiler and make -- or at least
can be initiated that way to "bootstrap" to their private environment
(Qt is an example of the latter).

I'm not worried about the "pain" for lots for fiddle-diddle things.
It's the sheer amount of time to devote to one port versus time that
could be spent on other things where the benefit isn't measureable.
By this I mean that there are older versions of existing ports that
need to be updated, maintained, enhanced, etc. while the Win32 Java
can be leveraged to work for most cases. We don't make gobs
of money by giving away free packages for Interix. Even with the CD's
that people buy, we're a charity to Interix users.
Gads, then there's the legal/licencing issues... {where's my aspirin?}

We've had some kind people sponsor some projects over the years and/or
donated/maintain certain ports. But it's few and far between. We've tried
different things over the years, as the older members will know, but it
comes down to blunt reality that 99.9% don't want to ante anything (and
that includes individuals and corporations); the 0.1% are really nice
but there's not enough of these souls. Yes, this has turned into a *rant*,
but it's also an explanation of why it's very unlikely to happen.
If someone wants to sponsor it, then grand!

(in reply to gdueck)
Post #: 2
RE: Interix, Java and Jni - Oct. 3, '06, 2:37:18 PM   
Krabi

 

Posts: 5
Joined: Oct. 2, '06,
Status: offline
I though about that too. I have reached with my thoughts to that Interix platform
is designed badly. I think that JNI and .dll binding proble to .Net is not new thing.
I get working .dll, that can corporate with Java/JNI and also with C#.Net, with Cygwin? Why Interix don't do things like Cygwin do? Yes I know that in calling
are made with many subcals:
Java or .Net application search corresponding function, then
Pass data and call it, then
in this function do unix like calls to Cygwin subsystem , then
Cygwin do workaround to Win32 functions or directly to windows kernel level functions.
I think that is not big loss!
I don't looked in to Cygwin source, but I am sure that most functions are
implemented with kernel level functions (without calling them through Win32 SDK functions).
If JNI is not new thing and if every day are asked questions about JNI, or similar and if other compete organisations can resolve those problems then I think that
architecture of Interix is not good and complete. This is my criticism.

(in reply to Rodney)
Post #: 3
RE: Interix, Java and Jni - Oct. 3, '06, 3:30:55 PM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The design and intent of Interix differs from Cygwin.
Interix is designed first-most to provide a Unix environment and do
so with a performance level matching other Unix systems on the same hardware.
Cygwin is an emulation: it uses the Win32 API's to emulate. It does not call
the NT kernel directly. Your guess doesn't hold. The fork() call is the biggest
example of slow emulation in Cygwin. You need to have more technical understanding
of the OS architecture before trying to make a technical critism.

Besides, you can compile in "mixed mode" with Interix to call out to Win32 DLL's.
The principle example of this is the Oracle DLL's which started with 5.2.

The previous poster (gdueck) was asking about a native port to Interix of
Java. This is distinctly different from your posting.

(in reply to Krabi)
Post #: 4
RE: Interix, Java and Jni - Oct. 4, '06, 4:10:40 AM   
Krabi

 

Posts: 5
Joined: Oct. 2, '06,
Status: offline
Of course fork and maybe pthread are different but what about Cygwin open,read,write,close? Are they going through CreateFile or it implemented with kernel-mode system calls?
What I want to say is that, need we really Java version for Interix or is better that Interix change its concept or architecture?

(in reply to Rodney)
Post #: 5
RE: Interix, Java and Jni - Oct. 4, '06, 1:17:08 PM   
gdueck

 

Posts: 2
Joined: Oct. 3, '06,
Status: offline
I understand from the reply to this and other similar threads that a Java port to the Interix platform would be difficult and time consuming, and that it's expected ROI is low enough to make it disappear off the bottom of the todo list.

That being said, I looked into porting Kaffe. First blocking point: SFU 3.0 doesn't support pthreads. Second blocking point: the download site for SFU 3.5 was broken and it took an email to Microsoft to get it working. Third blocking point: on SFU 3.5 out of the box, gcc faults unless you turn off DEP for the whole system. I guess you could turn off DEP just for gcc and it's myriad of dependent programs, but that requires more knowledge of gcc that I have at present. Apparently, they build trampoline code on the stack and that's what blows DEP. Fourth blocking point: Kaffe still needs pthreads and the configure script is unaware of Interix support for them. I suppose that's just a matter of modifying some dark corner of the configure script, but if I jiggle and poke my way to a successful compile, I may not have a result that would be reproducible on someone else's machine.

So my question(s) is (are): has anyone done a successful port of Kaffe to Interix? If not, is the ROI worth my time? Will I be able to run the Java SE 5 jdk tools on the Kaffe JVM (javac in particular, Netbeans would be nice)? Will I be able to run native Interix methods loaded from .so libraries?

There are enough interesting questions here to make this worth looking into. Anyone interested in helping?

(in reply to gdueck)
Post #: 6
RE: Interix, Java and Jni - Oct. 4, '06, 1:39:15 PM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The SFU 3.5 download is going to be around for a few more years.
The replacement, SUA, comes with the OS distribution now for R2 and Vista.

Everything from 3.5 forward has pthreads. The gcc compiler with SUA
has the DEP thing fixed today. I received e-mail today that a hotfix for gcc DEP
on 3.5 is in the final "dot the i's" stage. So that is RSN for getting fixed.
Kaffe knowing, or not knowing, about pthreads on Interix is likely a straight
forward hack to configure -- I expect it may be the same for shared library awareness.

Once it's ported I think it would all work as well as on any other system.

(in reply to gdueck)
Post #: 7
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> Interix, Java and Jni Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.031