Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java and Windows COM

 
Fedor Smirnoff
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am looking to enable my java application to do some tasks on the OS level with Windows 2003 server. For example, creating a user and setting permissions. The only way I could think of is through bridging Java and COM. Is it the best way to do it? If yes can you recommend any good Java to COM Bridge libraries.
 
Steven Martin
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also want to look into Ant libraries that support that.
 
Fedor Smirnoff
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry, I didnt understand. Ant libraries support what? COM bridge or Windows level functionality?

Thanks
 
Randall Julian
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too am interested in this. I found a couple of references, but I would be curious if anyone has any experience with doing this.

The JACOB project has been recommended more than once - but I have not tried it. Has anyone worked with this?

There is also the Jacobgen project: Jacobgen website which might also help.
 
Fedor Smirnoff
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I also read a lot about JACOB, there is a tutorial on using it in Professional JSP by WROX. I am going to try it. JCOM is another one that I found and its praised as really good, one problem is that documentation is not fully translated to English yet.
http://sourceforge.net/projects/jcom/

Any experience?
 
Dom King
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't need to resort to COM to "do some tasks on the OS level with Windows 2003 server. For example, creating a user and setting permissions."

This is core Windows OS functionality and it would be easier to accomplish using the Win32 API directly instead of COM.

An simpler and more efficient solution than the overhead of a Java-COM bridge would be to implement one or more native methods using JNI and the Win32 API that do your OS-level tasks, such as "creating a user and setting permissions."

Even if the implementation of the native method itself needed to use COM, that could still be accomplished from the Win32 side of the native method.
 
Randall Julian
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since Jacob uses JNI to talk to COM components, it makes sense that you should probably skip the trouble of creating a COM component just to get to things you can get to directly with JNI.

In my case I have a device which comes with a vendor supplied API as a COM component and I'd like to write programs to talk to the device, in Java rather than MSVC++ (ugh).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic