> Hi
> I'm new to Java i want to know if it is possible to create a DLL in Java
> and how do i go a bout doing it?
>
> Thanx
Hi Tumzadoc!
You can write any method of your Java classes either in Java-language
(which is the usual way) or in a native language like C or C++.
In your Java code you have to declare such a method with the "native"
key-word, for example:
public native int myMethod(int arg);
Note that there is no { } here.
The implementation of such methods will be in a *.DLL file (in case of
Windows platform) or in a lib*.so file (in case of UNIX platform).
The technique to be used is called JNI (Java Native Interface).
There is a good on-line tutorial about this topic:
http://java.sun.com/docs/books/tutorial/native1.1/index.html

Signature
"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')
Uwe Ziegenhagen - 17 Jun 2005 16:10 GMT
>> Hi
>> I'm new to Java i want to know if it is possible to create a DLL in Java
[quoted text clipped - 17 lines]
> There is a good on-line tutorial about this topic:
> http://java.sun.com/docs/books/tutorial/native1.1/index.html
What about writing Java code and transforming this into a dll? Can the
Gnu java compiler do this?
Uwe

Signature
mail to newsgroup@ziegenhagen.info is read only from time to time. If
you need an urgent answer, google for me.
Vit - 20 Jun 2005 07:58 GMT
> What about writing Java code and transforming this into a dll? Can the
> Gnu java compiler do this?
Yes it can. You can also try JET for this:
http://www.excelsior-usa.com/jet.html
Vit
Excelsior,LLC
> Hi
> I'm new to Java i want to know if it is possible to create a DLL in Java
> and how do i go a bout doing it?
You probably do not want to create a DLL. If you want to put some code
into a reusable format, consider packaging it into a jar. This will allow
other java programs to easily use your classes.
Sadly, other languages are not very well suited to use java libraries. You
could try using some java->native compiler, but i doubt you'll end up with
a very usable library.

Signature
In pioneer days they used oxen for heavy pulling, and when one ox
couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
be trying for bigger computers, but for more systems of computers.
--- Rear Admiral Grace Murray Hopper