![]() |
|
|
|||||||
![]() |
Java - Exec cmd echo for beep with java on linux |
|
|
Thread Tools | Search this Thread |
|
|
#11 |
|
Nanou wrote: > Hello, > > > I want to execute the command echo -e "\a" ( this command produce a > beep)from a java program whit Runtime.getRuntime().exec(); but it's > doesn't work. I don't heard the sound. > I can't use Toolkit.getDefaultToolkit().beep(); because under linux > this function have not effect. > > OS: Mandriva Linux > JDK 1.5 > > Any help will be welcome. > Thanks I don't know about linux but under windows to execute we use code1: - ---------------------------------------------- //import java.io.*; public class RunExec { public static void main(String args[]) { String path="http://pradyut.tk"; try { Process p = Runtime.getRuntime().exec("RunDLL32.EXE shell32.dll,ShellExec_RunDLL " + path); } catch(Exception e ) { System.err.println(e); } } } ------------------------------------------------------- code2: - -------------------------------------------------------- public class RunExec1 { public static void main(String args[]) { String path="http://pradyut.tk"; try { Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler http://yahoo.com" ); } catch(Exception e ) { System.err.println(e); } } } -------------------------------------------------------------- thanks Pradyut http://pradyut.tk http://spaces.msn.com/members/oop-edge/ http://groups-beta.google.com/group/oop_programming India Pradyut |
|
|
|
|
#12 |
|
Posts: n/a
|
Nanou wrote: > Hello, > > > I want to execute the command echo -e "\a" ( this command produce a > beep)from a java program whit Runtime.getRuntime().exec(); but it's > doesn't work. I don't heard the sound. > I can't use Toolkit.getDefaultToolkit().beep(); because under linux > this function have not effect. > > OS: Mandriva Linux > JDK 1.5 > > Any help will be welcome. > Thanks I don't know about linux but under windows to execute we use code1: - ---------------------------------------------- //import java.io.*; public class RunExec { public static void main(String args[]) { String path="http://pradyut.tk"; try { Process p = Runtime.getRuntime().exec("RunDLL32.EXE shell32.dll,ShellExec_RunDLL " + path); } catch(Exception e ) { System.err.println(e); } } } ------------------------------------------------------- code2: - -------------------------------------------------------- public class RunExec1 { public static void main(String args[]) { String path="http://pradyut.tk"; try { Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler http://yahoo.com" ); } catch(Exception e ) { System.err.println(e); } } } -------------------------------------------------------------- thanks Pradyut http://pradyut.tk http://spaces.msn.com/members/oop-edge/ http://groups-beta.google.com/group/oop_programming India Pradyut |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What Is Linux? | Andrew.Robinson.group.com@gmail.com | DVD Video | 0 | 12-31-2007 03:06 PM |
| Suse Linux and Red Hat Linux | Raymond | A+ Certification | 3 | 07-16-2004 01:41 AM |
| Re: Dual booting W2K and Linux on TWO HDs | Tom MacIntyre | A+ Certification | 0 | 08-06-2003 11:29 PM |