Board index » jbuilder » Making some windows-dll.

Making some windows-dll.


2003-10-15 07:39:36 PM
jbuilder24
Hello,
I want to compile code in java and make it a dll (for single platform -
windows) , so I can use it by some JNI protocols.
Can I compile source code of java and make it dll by JBuilder ?
Thanks :)
 
 

Re:Making some windows-dll.

Mr. x a écrit :
Quote
Hello,
I want to compile code in java and make it a dll (for single platform -
windows) , so I can use it by some JNI protocols.
???
usually it is the reverse, java code using DLLs through JNI
Quote
Can I compile source code of java and make it dll by JBuilder ?
no
--
Ludovic
-----------------------------------------
"Les formes qui differencient les etres importent peu
si leur pensees s'unissent pour batir un univers..."
Yoko Tsuno (in 'Les titans' by Roger Leloup)
[The shapes that differenciate beings are not important
if their thoughts unite to build a universe]
 

Re:Making some windows-dll.

Mr. x < XXXX@XXXXX.COM >wrote:
Quote
I want to compile code in java and make it a dll (for single platform -
windows) , so I can use it by some JNI protocols.
I think you're mixing up concepts completely.
If a piece of code is written in Java already, there's no sane reason
at all to funnel its usage through a DLL and JNI --- call the actual
Java class from the other app and be done with it. JNI is for access
to code written in *other* languages, from Java, not to access Java
code from Java.
--
Hans-Bernhard Broeker ( XXXX@XXXXX.COM )
Even if all the snow were burnt, ashes would remain.
 

{smallsort}

Re:Making some windows-dll.

I know what JNI is.
I just want to compile to Dll, and not having to buy any other compiler for
that ?
Does JBuilder support compilation to dll, in some way ?
Thanks :)
"Hans-Bernhard Broeker" < XXXX@XXXXX.COM >wrote in message
Quote
Mr. x < XXXX@XXXXX.COM >wrote:

>I want to compile code in java and make it a dll (for single platform -
>windows) , so I can use it by some JNI protocols.

I think you're mixing up concepts completely.

If a piece of code is written in Java already, there's no sane reason
at all to funnel its usage through a DLL and JNI --- call the actual
Java class from the other app and be done with it. JNI is for access
to code written in *other* languages, from Java, not to access Java
code from Java.

--
Hans-Bernhard Broeker ( XXXX@XXXXX.COM )
Even if all the snow were burnt, ashes would remain.
 

Re:Making some windows-dll.

"Mr. x" < XXXX@XXXXX.COM >wrote in message
Quote
Does JBuilder support compilation to dll, in some way ?
No.
--
Gillmer J. Derge (TeamB)
 

Re:Making some windows-dll.

So for simple dll, I should use borland bcc32.exe (5.5) compiler,
which I think it is for free - Is it ?
Thanks :)
"Gillmer J. Derge (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
"Mr. x" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Does JBuilder support compilation to dll, in some way ?

No.

--
Gillmer J. Derge (TeamB)

 

Re:Making some windows-dll.

"Mr. x" < XXXX@XXXXX.COM >wrote in message
Quote
So for simple dll, I should use borland bcc32.exe (5.5) compiler,
which I think it is for free - Is it ?
It is, but it's a C/C++ compiler, not a Java compiler, so I don't think
it will help you much if you want to turn Java code into a DLL. For
that you'll have to get something like JET
(www.excelsior-usa.com/jet.html) or gcj
(gcc.gnu.org/java/).
Having said that, it still isn't at all clear that this is a good idea.
Why are you trying to turn Java code into a DLL? If you're trying to
call it from Java, you'll only be making more work for yourself. If you
want to call it from some other language, then maybe this is the right
solution, but you still might want to ask yourself if it's a better idea
to just write it all in the other language instead of introducing Java
into the mix.
--
Gillmer J. Derge (TeamB)
 

Re:Making some windows-dll.

O.K,
For what you are saying I'll preffer using JBOSS for that, which can do dll
export.
(By the way how much JBOSS costs, and what extra installation I need to do
something like Web-Logic).
The case for what I am doing a dll - is just for using one of the windows
api functions (that's not multi-platform) - what I am doing - is calling
that API function (compiled dll - BCC32) , and use that function on Java.
After I connect that function by the JNI protocol - javah , etc... and use
policy tool to declare that the dll is executable - that's what I did, and
succeed calling the windows-api function by JNI - What I am asking is that :
Isn't there any other better way to use windows-api functions ? (besides -
what I am doing in dll is very very simple code, that's why I intend to use
a very simple compiler as BCC32).
Thanks :)
"Gillmer J. Derge (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
"Mr. x" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>So for simple dll, I should use borland bcc32.exe (5.5) compiler,
>which I think it is for free - Is it ?

It is, but it's a C/C++ compiler, not a Java compiler, so I don't think
it will help you much if you want to turn Java code into a DLL. For
that you'll have to get something like JET
(www.excelsior-usa.com/jet.html) or gcj
(gcc.gnu.org/java/).

Having said that, it still isn't at all clear that this is a good idea.
Why are you trying to turn Java code into a DLL? If you're trying to
call it from Java, you'll only be making more work for yourself. If you
want to call it from some other language, then maybe this is the right
solution, but you still might want to ask yourself if it's a better idea
to just write it all in the other language instead of introducing Java
into the mix.

--
Gillmer J. Derge (TeamB)

 

Re:Making some windows-dll.

"Mr. x" < XXXX@XXXXX.COM >schrieb im Newsbeitrag
Quote
I know what JNI is.
I just want to compile to Dll, and not having to buy any other compiler
for
that ?
Does JBuilder support compilation to dll, in some way ?
NO, hopefully it doesn't. I wonder why you want to do so and bother yourself
with DLLs explicitely for Java itself? However, since you seem somehow to
insist on that java DLL theme, I can so far only imagine that some real Java
native compilers like Gnu GCJ, OpenJIT, JOVE, JET etc. maybe support this
under certain circumstances.
I think you should maybe better use directly C# instead of Java. C# supports
Assemblies (DLLs) and the whole MS.Net Windows stuff. You can use here
preferably also then Borland's C#Builder private edition or the free
SharpDevelop IDE. You then have also the option to try out MS J#, which to
some limited degree allows to convert and take over Java code to the .Net
IML world, but J# supports only the Java SDK 1.1.4 state and thus can't
handle the conversion of more actual Java SDK capabilities. However, I
wouldn't bother with J# at all and better use directly C# then.
As I understand it from your comments, you restricted yourself to the
windows world. Meaning you don't need or will not make any use of Java's
platform independence capabilities etc. If so, I think in your special case
you will probably better go with C# instead of Java...
-Valentino
 

Re:Making some windows-dll.

Mr. x < XXXX@XXXXX.COM >wrote:
Quote
The case for what I am doing a dll - is just for using one of the windows
api functions (that's not multi-platform) - what I am doing - is calling
that API function (compiled dll - BCC32) , and use that function on Java.
For *that* case, going through JNI and all that is a perfectly valid
way of doing it. But that's nowhere near the case you originally
described to us here.
In particular, you kept asking for putting *Java* code into such a DLL
--- and that would simply make no sense whatsoever. JNI is needed
_only_if_ you want to interface Java code to code that is, maybe even
must be, written in some language other than Java.
Quote
What I am asking is that : Isn't there any other better way to use
windows-api functions ?
That's what you're asking _now_. But it has no particular relation to
the original question you were asking, nor to your insistence that you
want to compile Java code into a DLL.
As to the question itself: the best way to use Windows API functions
from Java, according to the sacred texts, is of course never to use
them at all. The next-best one is what you've already found out how
to do: JNI wrappers for therm written in C or C++ (or whatever else
you like).
--
Hans-Bernhard Broeker ( XXXX@XXXXX.COM )
Even if all the snow were burnt, ashes would remain.
 

Re:Making some windows-dll.

O.K.
The function I am currently use is : "LoadKeyboardLayoutA", which change the
language to the language of mine.
Though Java has the property : ComponentOrientation, it is lake of writting
in the language layout (I am using hebrew), so it is from right to left, but
for someone who uses several languages, the caret flag (the blinking cursor
when typing character) need to change its direction - In Java it isn't
changed by default (because it is something that is on windows), so
characters normally in java (right to left) are English.
For Windows I can use one dll, and on Lynox I'll use other dll.
Isn't any better way to change the ComponentOrientation with the appropiate
direction of caret flag ?
(Something built in at Java)
Still, I think that I'll use other API functions (for some problems, as I've
mentioned Java cannot give a good solution for me), but the number of
functions will be very very few.
I cannot predict what the future of my development will be - so what if I
need to do dll (both for lynox & windows) - I want to have only one compiler
for that (java and only java, not bcc32, etc...) - Is there any good
solution for that, or the best is as I've mentioned (Bcc32 and JBuilder).
(Still, I am in love in JBuilder ...)
Thanks :)
"Hans-Bernhard Broeker" < XXXX@XXXXX.COM >wrote in message
Quote
Mr. x < XXXX@XXXXX.COM >wrote:

>The case for what I am doing a dll - is just for using one of the
windows
>api functions (that's not multi-platform) - what I am doing - is calling
>that API function (compiled dll - BCC32) , and use that function on
Java.

For *that* case, going through JNI and all that is a perfectly valid
way of doing it. But that's nowhere near the case you originally
described to us here.

In particular, you kept asking for putting *Java* code into such a DLL
--- and that would simply make no sense whatsoever. JNI is needed
_only_if_ you want to interface Java code to code that is, maybe even
must be, written in some language other than Java.

>What I am asking is that : Isn't there any other better way to use
>windows-api functions ?

That's what you're asking _now_. But it has no particular relation to
the original question you were asking, nor to your insistence that you
want to compile Java code into a DLL.

As to the question itself: the best way to use Windows API functions
from Java, according to the sacred texts, is of course never to use
them at all. The next-best one is what you've already found out how
to do: JNI wrappers for therm written in C or C++ (or whatever else
you like).


--
Hans-Bernhard Broeker ( XXXX@XXXXX.COM )
Even if all the snow were burnt, ashes would remain.
 

Re:Making some windows-dll.

Well, don't know much about hebrew writing (direction tracking) and the OS
and Java problems related with it, but I bet you can find a lot of related
information on the internet, since others for sure had the same problems
before. Do a net search for the topics...
liors.tripod.com/hebrew.html
www.ivrix.org.il/mailing-lists/ivrix-discuss/2000/04/0005.html
www.m17n.org/m17n2000_all_but_registration/proceedings/felt/tsld001.h
tm
www.macdevcenter.com/pub/a/mac/2002/03/22/vertical_text.html
www.righto.com/java/fonts/hebrew.html
...
...
-Valentino
"Mr. x" < XXXX@XXXXX.COM >schrieb im Newsbeitrag
Quote
O.K.

The function I am currently use is : "LoadKeyboardLayoutA", which change
the
language to the language of mine.
Though Java has the property : ComponentOrientation, it is lake of
writting
in the language layout (I am using hebrew), so it is from right to left,
but
for someone who uses several languages, the caret flag (the blinking
cursor
when typing character) need to change its direction - In Java it isn't
changed by default (because it is something that is on windows), so
characters normally in java (right to left) are English.
For Windows I can use one dll, and on Lynox I'll use other dll.
Isn't any better way to change the ComponentOrientation with the
appropiate
direction of caret flag ?
(Something built in at Java)

Still, I think that I'll use other API functions (for some problems, as
I've
mentioned Java cannot give a good solution for me), but the number of
functions will be very very few.

I cannot predict what the future of my development will be - so what if I
need to do dll (both for lynox & windows) - I want to have only one
compiler
for that (java and only java, not bcc32, etc...) - Is there any good
solution for that, or the best is as I've mentioned (Bcc32 and JBuilder).
(Still, I am in love in JBuilder ...)

Thanks :)

"Hans-Bernhard Broeker" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Mr. x < XXXX@XXXXX.COM >wrote:
>
>>The case for what I am doing a dll - is just for using one of the
windows
>>api functions (that's not multi-platform) - what I am doing - is
calling
>>that API function (compiled dll - BCC32) , and use that function on
Java.
>
>For *that* case, going through JNI and all that is a perfectly valid
>way of doing it. But that's nowhere near the case you originally
>described to us here.
>
>In particular, you kept asking for putting *Java* code into such a DLL
>--- and that would simply make no sense whatsoever. JNI is needed
>_only_if_ you want to interface Java code to code that is, maybe even
>must be, written in some language other than Java.
>
>>What I am asking is that : Isn't there any other better way to use
>>windows-api functions ?
>
>That's what you're asking _now_. But it has no particular relation to
>the original question you were asking, nor to your insistence that you
>want to compile Java code into a DLL.
>
>As to the question itself: the best way to use Windows API functions
>from Java, according to the sacred texts, is of course never to use
>them at all. The next-best one is what you've already found out how
>to do: JNI wrappers for therm written in C or C++ (or whatever else
>you like).
>
>
>--
>Hans-Bernhard Broeker ( XXXX@XXXXX.COM )
>Even if all the snow were burnt, ashes would remain.


 

Re:Making some windows-dll.

Mr. x < XXXX@XXXXX.COM >wrote:
Quote
I cannot predict what the future of my development will be - so what
if I need to do dll (both for lynox & windows) - I want to have only
one compiler for that (java and only java, not bcc32, etc...)
You simply will not get that wish granted. Sorry if that rains your
parade.
If a certain feature is not already interfaced to Java, then it isn't,
and nothing you do using _only_ Java can ever possibly change that
fact.
--
Hans-Bernhard Broeker ( XXXX@XXXXX.COM )
Even if all the snow were burnt, ashes would remain.