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 / General / September 2007

Tip: Looking for answers? Try searching our database.

problem using native mthods

Thread view: 
mohsen_fakhari@yahoo.com - 20 Sep 2007 09:36 GMT
Hi
I've just learnt using JNI.
I'm writing a program that uses some native methods to do some of its
jobs.
After the program do its job completely I call System.exit(0) but a
'java.exe' remains in the processes
always and causes further problems.
This problem happens only when the program uses native methods.
What's wrong?
What should I do?
Any thing is appreciated
I'm using WinXP , jdk1.4 and JBuilder2005 if it can help.
kcwong - 20 Sep 2007 09:44 GMT
> Hi
> I've just learnt using JNI.
[quoted text clipped - 8 lines]
> Any thing is appreciated
> I'm using WinXP , jdk1.4 and JBuilder2005 if it can help.

The DLL might have problems unloading. Do you own the native source
code? If so, you can trace to see that the DLL can be unloaded
properly.

Most IDE have an "attach to process" that you can use to debug. Set
java.exe as the executable and provide the parameters (-classpath and
the main class name), then add break points in DLLMain.
mohsen_fakhari@yahoo.com - 20 Sep 2007 12:29 GMT
thank you for your answer
Why a dll might have problems unloading when it returns good results
with no error?
I have written the C part(the dll)too.It is not so complicated.

I don't know how to debug the native parts at all.
Is it possible with JBuilder?
kcwong - 20 Sep 2007 13:04 GMT
> thank you for your answer
> Why a dll might have problems unloading when it returns good results
[quoted text clipped - 3 lines]
> I don't know how to debug the native parts at all.
> Is it possible with JBuilder?

No, JBuilder only does Java.

Eclipse has a plugin for C++... it can be configured to use different
compilers.   I don't have much experience with it though, and I think
the plugin is pretty new.
(Eclipse http://www.eclipse.org/)
(C++ Plugin http://www.eclipse.org/cdt/)

Also, Visual Studio 2005 Express is a free download. (http://
msdn2.microsoft.com/en-us/express/default.aspx) This free version
doesn't support a few things, like MFC and remote debug. But if you
don't need those then it's okay.


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.