Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

Creating a DLL

Thread view: 
Tumzadoc - 15 Jun 2005 12:55 GMT
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
Thomas Fritsch - 15 Jun 2005 13:56 GMT
> 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
Stefan Schulz - 15 Jun 2005 19:16 GMT
> 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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.