It's not a secret anymore!*
The moose likes Java in General and the fly likes Shell Extension Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Shell Extension" Watch "Shell Extension" New topic
Author

Shell Extension

Amarhzb Salk
Greenhorn

Joined: Feb 28, 2012
Posts: 9
Hi All,

As I'm new, and I've to develop shell extension using java, that should work in all Operating system! I've no idea, Please help me by providing simple code. if Possible

Thanks,

Amar
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1502
    
    5

Amarhzb Salk wrote:Hi All,

As I'm new, and I've to develop shell extension using java, that should work in all Operating system! I've no idea, Please help me by providing simple code. if Possible

Thanks,

Amar

Welcome to CodeRanch!

Please not note that this forum is NotACodeMill. Please provide your code (or at least what logic you are thinking about). Also, be specific about your requirements. By 'that should work in all Operating system' do you mean that it should run commands like ps, top, ls etc. on Windows? In my opinion, it's not that easy


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Welcome to the Ranch.

What exactly is a "shell extension"; do you mean something like a Windows shell extension, where you could add things to the right-click popup menu of Windows Explorer when you right-click a file or directory?

It's not going to be easy to write that in Java, even if you would only want to do it for Windows. Java was designed to be platform-independent, which means that it has not a lot of built-in support for operating system-specific features such as shell extensions. It will most likely be impossible to do this in pure Java, without any native code.

If you want to make it work on all operating systems, that's going to be even harder. It might not even be possible to do a similar kind of thing on Linux or Mac OS X.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Amarhzb Salk
Greenhorn

Joined: Feb 28, 2012
Posts: 9
Hi Jong,

Regarding this Shell Extension<right click on any folder and our menu Item exist>, does c or cpp works for all operating system. So that I'll go for JNI?


Regards,

Amar
Amarhzb Salk
Greenhorn

Joined: Feb 28, 2012
Posts: 9
Hi Shivalkar,

Thanks for your reply,
I'm just try to gather sample code for generating this Shell Extension, So that I'll put it to every OS, Such as MAC, linux, and Windows. there are not such direct coding regarding this topic, but Still with the help of Ranch peoples I'll do it. any Idea or any clue. hope help full for me, to write such JNI version.


Regards,

Amar.
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1502
    
    5

Amarhzb Salk wrote:does c or cpp works for all operating system

C and/or CPP works for (almost) all operating systems, but the problem is, C/CPP is not platform independent - i.e. code which works for Windows, won't necessarily work for Linux. Even going further, you'll have to compile respective code on corresponding operating systems (unlike compile once and run anywhere).

And even after this, you create system dependent libraries for those shell extensions, then all your Java code would be simply using JNI and making calls to functions from those libraries. So, anyway your application is not going to be platform independent, and hence I don't see any specific reason to use Java here. Better would be an application completely written in C/CPP.

I hope this helps.
Amarhzb Salk
Greenhorn

Joined: Feb 28, 2012
Posts: 9
Hi Shivalkar,

it's true that c or cpp is not platform independent, So is it possible that for linux I'll kept as .so file for windows .dll files and MAC I've no idea, but still some .extension file in our application, So that when ever linux come to picture then .so file starts working. for windows .dll so on and so forth.

One more thing, is it mandatory to store .dll or .so file to client machine not at server side. if yes then...... any idea!



Regards,

Amar
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1502
    
    5

Amarhzb Salk wrote:So that when ever linux come to picture then .so file starts working. for windows .dll so on and so forth.

Yes. It is possible. Ultimately, it is your choice of course, but I still think that if more than 90-95% code is written in C/CPP, at least I don't see any advantage of using Java just for JNI

Amarhzb Salk wrote:One more thing, is it mandatory to store .dll or .so file to client machine not at server side. if yes then...... any idea!

Well, I'm not sure how and why shell extension and client/server environment is related with each other. Can you please clarify on this?
Amarhzb Salk
Greenhorn

Joined: Feb 28, 2012
Posts: 9
Shivalkar,

No, I'm not saying Client or server.... I'm discussing these things only to contribute an idea. So as off now I got an idea for .so and .dll file's first check which operating system client is using, then according to that operating system we need to provide an environment like .so or .dll and for mac something like that. I think I'm missing something.

Any way thanks for this great help, once develop with coding I'll share and come back to this topic again.




Regards,

Amardeep Salkar.
 
Don't get me started about those stupid light bulbs.
 
subject: Shell Extension
 
Similar Threads
applet
WA #1.....word association
What shell script is wise invest in learning? ksh? bash? sh? csh? help!
Helpm with favicon.ico
Anti-Virus: impromptu scanning