Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - Exec cmd echo for beep with java on linux

 
Thread Tools Search this Thread
Old 10-21-2005, 09:02 PM   #11
Default Re: Exec cmd echo for beep with java on linux



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
  Reply With Quote
Old 10-21-2005, 09:03 PM   #12
Pradyut
 
Posts: n/a
Default Re: Exec cmd echo for beep with java on linux

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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46