This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes inserting linux commands in java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "inserting linux commands in java program" Watch "inserting linux commands in java program" New topic
Author

inserting linux commands in java program

swati tawade
Greenhorn

Joined: Nov 15, 2007
Posts: 1
hi ther

Right now i m working on project vpn i.e virtual private network.
its based on linux and java.
this project is intended to facilate handling vpn for the people who dont know linux or having less command over it.

So all the setting of vpn should be provided in the from of gui.
information which user enter in the form shold be saved as zip file.
so just want to know that is it possible to insert linux commands for configuring vpn in java program.

if yes please provide me code doing hte same or having similar kind of operation.

thanks
swati
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14278
    
  21

Welcome to JavaRanch.

You can run other programs from Java with Runtime.exec(). Look it up in the API documentation.

Also see this: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you're using Java 5 or better, there is also the newer
ProcessBuilder


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inserting linux commands in java program