• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java for system adminstration?

 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I use Java for system administration in Linux like the way we
use c or Perl?


best regards,
omi
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*nix systems tend to use plain text files for configuration, so at first blush I'd say yes, Java may work. However, depending on your Linux distribution, Java support may be spotty (this should get better now that Sun has released Java on an open-source license).
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It all depends on what "system administration" means. Certainly if you are set up to run Tomcat, JBoss or the like as core system services, you're already using Java for system administration.

If you mean for system control and maintenance, certainly - I could, for example, write a crontab maintenance utility in Java either as a standalone app or as a webapp.

The only real restrictions are portability and overhead. You can't reasonably use Java in an environment where a JVM has to be fired up everytime it's needed but the task requires that startup delays be kept minimal (or storage is at a premium). Of course, if you by into the type of stuff that BEA (among others) is playing with, Java is essentially part of the OS, so that overhead mostly goes away.

Portability wouldn't be an issue execpt for the half-baked noncompliant gcj implementations, but thanks to Sun's opening the doors, I expect that incomplete JVMs will join J++ in the dustbin of history before much longer.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks bartenders for your replies.

But sir,How about system automation tasks ,for ex. copying registry file,
executing network commands,shell programming,executing asm code.

Can we do that like that we do with perl,c,bash scripts,and python like languages?

I know as a Java programmer it's hard to do low level tasks but just
for ending my curiosity I am asking the above question.

best regards,
omi sharma
[ August 13, 2008: Message edited by: omi sharma ]
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some problems are better suited for scripting languages and some are better suited for object-oriented programming languages. Use the correct tool for the job. Picking the correct tool may take some trial and error until you get a sense of what the strengths and weaknesses of each are.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While you technically can do anything with Java that you can do with any other language, I think this is a serious mistake. If you are the sysadmin, and will always be the sysadmin, then by all means, do what you like. But if there is any chance, however small, that the system will grow and be put in production, and managed by professional sysadims, then you should do it using the "when in Rome, do it the Roman way" approach.

For Linux, the Linux way is perl or bash scripts.

Plus, perl is a useful language to know. You can do many sysadmin things in five lines of perl that would take many times as much in Java.

p.s. you are showing your Windoze biases talking about "registry" as there is no such think in Linux, BSD, etc. All that stuff is kept in ascii text files.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great replies, thanks for your suggestion and I have known what should I do.
You guys replied very well specially Pat,ending my curiosity ,I am completely satisfied.

I will learn Perl and Python too but after finish some Java stuffs.

best regards,
omi
[ August 13, 2008: Message edited by: omi sharma ]
reply
    Bookmark Topic Watch Topic
  • New Topic