944,175 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1655
  • Java RSS
Feb 24th, 2007
0

Possible to use system(); in Java?

Expand Post »
Hi,

I am new to Java.

Id like to know if I can use system commands in Java applications. Thanks in advance,


Jan
Similar Threads
Reputation Points: 27
Solved Threads: 2
Posting Whiz in Training
jan1024188 is offline Offline
254 posts
since Aug 2006
Feb 24th, 2007
0

Re: Possible to use system(); in Java?

Click to Expand / Collapse  Quote originally posted by jan1024188 ...
Hi,

I am new to Java.

Id like to know if I can use system commands in Java applications. Thanks in advance,


Jan
Sure

System.out.println();

:lol:
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Feb 24th, 2007
0

Re: Possible to use system(); in Java?

no....I mean like
Quote ...
system("reboot");
Can I use em?
Reputation Points: 27
Solved Threads: 2
Posting Whiz in Training
jan1024188 is offline Offline
254 posts
since Aug 2006
Feb 25th, 2007
0

Re: Possible to use system(); in Java?

whatever happened to trying?
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Feb 25th, 2007
0

Re: Possible to use system(); in Java?

Is there even a portable, cross platform way to perform a reboot in java?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Feb 25th, 2007
0

Re: Possible to use system(); in Java?

Read the API doc for Runtime.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Feb 25th, 2007
0

Re: Possible to use system(); in Java?

here is output
Quote ...
[jan@localhost hello]$ javac helloJava.java
----------
1. ERROR in helloJava.java (at line 7)
System("xmms");
^^^^^^
The method System(String) is undefined for the type helloJava
----------
Reputation Points: 27
Solved Threads: 2
Posting Whiz in Training
jan1024188 is offline Offline
254 posts
since Aug 2006
Feb 25th, 2007
0

Re: Possible to use system(); in Java?

yup, that's not the way to call things outside the JVM...

Quote ...
Is there even a portable, cross platform way to perform a reboot in java?
Of course not, as there is no platform independent way to do it at all (except for pulling the powerplug, and that's assuming there's no UPS attached).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Feb 25th, 2007
0

Re: Possible to use system(); in Java?

Look into the Runtime.exec methods, as masijade suggested
Reputation Points: 683
Solved Threads: 53
Posting Virtuoso
Infarction is offline Offline
1,580 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Java III help needed to be done !!!
Next Thread in Java Forum Timeline: Where did I go wrong??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC