Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-06-2008, 10:59 PM
Member
 
Join Date: Oct 2008
Posts: 5
nlgopi is on a distinguished road
linux generic Exec command...???
I have a big problem..doing a project f file tracker in linux...so, i have to use exec command in linux..as for windows, we have rundll32 url, file protocol handler..what is der here??
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-07-2008, 12:18 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 533
fishtoprecords is on a distinguished road
Quote:
Originally Posted by nlgopi View Post
what is der here??
Can you ask in English?

Look at the Javadocs for System.exec()
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-07-2008, 12:46 AM
Member
 
Join Date: Oct 2008
Posts: 5
nlgopi is on a distinguished road
hi senior member
just that i couldnt get that else where..i wanna implement a platform independent file tracker,so i gotta get the exec version for linux where i could run files in their own available default application. Can you help me???
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-07-2008, 12:55 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 533
fishtoprecords is on a distinguished road
Writing platform independent Java is easy. Writing platform independent software that uses platform specific tricks is nearly impossible.

And you have to ask hard questions such as:

What platforms to you care about?

Because if you mean PC and Linux, and not OS-X, you will get different answers than if you mean PC, Linux, OS-X, *BSD, AIX, HP-UX and others.

Once you have answered that, how about iPhone and other smart phones?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 10-07-2008, 01:21 AM
serjant's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 356
serjant is on a distinguished road
Send a message via ICQ to serjant Send a message via Skype™ to serjant
Additionally to words of fishtoprecords,if you want to use built-in commands from the OSes like DOS,Shell etc and to run them from Java,so you can do a platform independent if you check on which OS the program is running,so for checking create class constants:

Code:
/** * some handy constants that can be used throughout the program */ public class Constants { /** * the name of the OS as given by the Java system property "os.name" */ public final static String osname = System.getProperty("os.name"); /** * true if the program is running on OS X */ public final static boolean isOSX = osname.equalsIgnoreCase("Mac OS X"); /** * true if the program is running on Linux */ public final static boolean isLinux = osname.equalsIgnoreCase("Linux"); /** * true if the program is running on Solaris */ public final static boolean isSolaris = osname.equalsIgnoreCase("SunOS"); /** * true if the program is running on Windows Vista */ public final static boolean isVista = osname.equalsIgnoreCase("Windows Vista"); /** * true if the program is running on Windows */ public final static boolean isWindows = !(isOSX || isLinux || isSolaris); }
And then you can in another class to execute command line commands checking which os is that and then to put the proper command of course in order not to be given different answers from the system
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 10-08-2008, 09:08 PM
Member
 
Join Date: Oct 2008
Posts: 5
nlgopi is on a distinguished road
Hi senior member...
Quote:
Originally Posted by fishtoprecords View Post
Writing platform independent Java is easy. Writing platform independent software that uses platform specific tricks is nearly impossible.

And you have to ask hard questions such as:

What platforms to you care about?

Because if you mean PC and Linux, and not OS-X, you will get different answers than if you mean PC, Linux, OS-X, *BSD, AIX, HP-UX and others.

Once you have answered that, how about iPhone and other smart phones?
Thank you,senior ...ll try out something which doesnt need any specific tricks..
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Linux conflict - TrayIcon image not display in Linux Eranga Advanced Java 2 01-06-2009 06:24 PM
Runtime.exec() hknyo Advanced Java 2 08-16-2008 02:40 AM
linux command to start a java web server lazarus JavaServer Faces 0 06-24-2008 05:30 PM
calling linux command line in java fangzhong New To Java 0 02-03-2008 06:24 PM
Unable to execute command line command in java LordSM New To Java 1 08-08-2007 02:23 AM


All times are GMT +3. The time now is 09:38 AM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org