[Advanced-java] Java apps and doing OS stuff
Steven J. Owens
puffmail at darksleep.com
Tue Jul 29 13:47:15 2003
On Fri, Jul 11, 2003 at 10:13:09PM +0100, Thomas Nichols wrote:
> >> >We use bourne shell scripts (on Linux and Solaris) to do things like:
> >> >
> >> >+ pre-process commands and launch our java app
> >> > --> e.g. user can simply type: ./seahorse start
> >> >
> >> >+ OS specific pre|post-installation during installs and upgrades
> >> > --> recursive copying a directory + retaining permissions, etc....
> >>
> >> If all you want is a better scripting environment for Windows, there are
> >> several Unix-clone options (such as Cygwin or MKS); these will add the
> >> functionality you're currently missing and allow you to run bash scripts
> >> under Windows.
To narrow it down, the problem you're trying to solve is easy
deployment of your app for your users, and easy development of said
deployment for you, right?
Have you considered one of the installer products (ZeroG is the
first one that comes to my mind, not for any particular reason
though)? This does sort of seem to be the problem they're designed to
solve. OR you may want to start from this point and look for jakarta
or other open source approaches to solving this problem.
> At 16:12 11/07/2003 -0400, Nikolaos Giannopoulos wrote:
> >> If you want a Java-based solution, perhaps Jython or JudoScript.
> >
> >Can these languages allow you to issue OS commands and tests on the
> >filesystem such as: recursive directory copy (keeping permissions),
> >conditional processing on exit result of an app, conditional processing on
> >existence of a dir, etc....
> >
> >One of the reasons the install/upgrade scripts are not 100% java is because
> >java does not retain permissions during file copy - do these languages get
> >me any further along in this respect? I'm guessing no from what I had
> >previously read on Jython.
>
> From http://www.judoscript.com/faq.html#q8 JudoScript can handle chmod on
> *nix
> However, http://www.jython.org/docs/differences.html suggests Jython cannot.
> Ant has a Chmod task implemented for *nix, can I think do recursive dir
> copies, not sure about testing exit code of an app -- and is utterly
> wonderful as a Java build tool. Not my first choice for cross-platform
> deployment, though, and scripts can get fairly large even for low
> complexities.
> So, AFAIK (and I know startlingly little about this) if you want a
> Java-based solution JudoScript and Ant may be your options. JudoScript is
> LGPL, so redistribution is ok if handled carefully, Ant is Apache, so few
> restrictions.
>
> If you're happy with a wholly different language, Python (BSD-style CNRI
> license) can be shipped with your apps without too much difficulty.
Python or Perl reportedly both have good windows support (even
commercial windows support, from ActiveState, if you want to pay for
it). If you're sticking with the route of having a non-java scripting
language to handle the install, I'd definitely consider just bundling
one of those languages with your package and using it to write the
install script.
--
Steven J. Owens
puff@darksleep.com
"I'm going to make broad, sweeping generalizations and strong,
declarative statements, because otherwise I'll be here all night and
this document will be four times longer and much less fun to read.
Take it all with a grain of salt." - Me at http://darksleep.com