jadPlugin on OSX

Is there any interest in this? I got it working locally but it involved quite a few changes to the source. Basically the culprit is the Runtime.exec call, which just creates one big string to execute with quotes which OSX does not like. The correct approach is to call exec(String[]), so I had to make changes in various places to ensure that that is the call that is done. The authors of jadPlugin should switch to that method call IMHO as it's much safer. I can either upload an OSX version or patches for getting it to work.

5 comments

Hani Suleiman wrote:

Is there any interest in this? I got it working locally but it involved quite a few changes to the source. Basically the culprit is the Runtime.exec call, which just creates one big string to execute with quotes which OSX does not like. The correct approach is to call exec(String[]), so I had to make changes in various places to ensure that that is the call that is done. The authors of jadPlugin should switch to that method call IMHO as it's much safer. I can either upload an OSX version or patches for getting it to work.


Long ago, I posted how to change the code to make it work on linux.
Same there, I had to remove the quotes in the exec call.

I had the change made in one place only, as a hack that removed quotes
from the quoted string just before exec was called - so using only one
long string. Probably your approach would have worked as well.

Well, now the more OSs have been tried, I suppose that the best thing
would be not to build a String or String[] but a CommandLine object that
internally knew how to compose substrings for win, linux and mac.
(perhaps an abstract CommandLine with its own factory method ...)

Edo

0

I think that'd be overkill IMHO. The String[] solution is guaranteed to work across all platforms (it would remove the need to use quotes, which cause the problem), and thus incorporate both my changes and yours. Removing the quotes without changing it to String[] will cause problems if any of the paths have spaces in the name. The String[] call handles that gracefully though. As currently distributed, the jad plugin only works on Windows.

0

Edo - thanks for pointing me at this discussion.

I incorporated changes in the most recent version of IdeaJad that will probably make things a lot easier for Unix folks.
Most importantly I changed Runtime.exec(String) to Runtime.exec(String[]) - which should solve the quote problem. Please let me know, if you encounter any other difficulties. I am not always watching this forum, so please feel free to contact me directly at hs@tagtraum.com

What I was wondering: which jad executable are you using for OSX?

-hendrik

Download: http://www.tagtraum.com/ideajad.html

0

Oops, didn't know there was one on the official site...

-hendrik

0

Please sign in to leave a comment.