How to do a ping with ICMP in Java under Linux?

Does anyone know an easy way to do a ping with ICMPs under Linux? I did it under Windows, but under Linux, I've got some issues. I need a procedure that sends a ping with a id number and a seq number and another function pong that waits for a reply and returns the seq and id of the packets it received.
if anyone did this, please tell me how. I know it should be a native method, but how do I implement it...

rigth, i thought of that. but imagine that i have something like 100 hosts wich i must ping something like 20 times and get all the results in something like 5 seconds.
so i don't think that runtime will be a solution because that kind of pings tend to be safe and wait 1 sec between 2 succesive pings in order to prevent a flood.
i already did it in windows with a native dll. but i'm not so experienced in linux... :( so, if anyone can help...please do

Similar Messages

  • How can i get started with messaging in java

    how can i get started with messaging in java

    If you're talking about writing mail clients in java, you might want to start with a better forum. We're focused on Messaging Servers, here. Unlikely you'll get any Java programming from us.
    If you're talking about Messaging Server, start by downloading the software from sun.com/downloads.

  • How to install Oracle 10g with its grid functionality on Linux?

    Well, I thought changing the subject line might help to convey the meaning of what I want better. Here's my earlier post from a few hours earlier.
    Hi,
    I need carry out TPC-C benchmarking test for Oracle 10g (using one, two and four servers; basically using the grid in case of multiple servers). I have installed oracle 10g (with default options) on all the four servers, but beyond that I have no idea as to how can I invoke the grid option in order to carry out the tests-by my statement, I mean do I need to choose grid option while installing Oracle or is it the case that I specify the grid option in the code that I write for carrying out the tests. The OS is LInux (Scientific Linux).
    An unrelated problem-one of the servers is 64 bit while others are 32 bit, and proper versions of oracle have been installed. Neglecting the obvious fact that this will make comparisons difficult does anyone anticipate any other problem?
    Many Thanks!
    Steve
    *******************************************************************************************************

    Do you think that the installation of RAC can be done
    in a week? yes, as long as you know what you are doing and can catch the concept quickly and good at following instructions.
    Moreover, we do not have a cluster-all we
    have are four servers that are separate. Do you know
    if the name Real Application Clusters implies that
    the servers have to be in a cluster?
    The basic idea of RAC is all these hosts need to share same set of storage. The most popular such storage are SAN and NAS.
    An example of building RAC on linux
    http://www.oracle.com/technology/pub/articles/hunter_rac10gr2_iscsi.html

  • How to create a folder with spaces written in Java under Linux?

    Hello,
    I have a serious problem
    I want to run a Linux command using a Java class with the runtime interface, there is a command to create a folder named eg "My Folder", with a space
    For create the Unix command is easy to do either:
    mkdir My\ Folder
    or
    mkdir "My Folder"
    But how to translate this in Java, I tried with two commands :
    Runtime.exec("mkdir My\\ Folder")
    Runtime.exec("mkdir \"My Folder\"")
    For example :
    import java.io.IOException;
    public class CreerDossier {
    public static void main(String[] args) throws IOException {
    Runtime runtime = Runtime.getRuntime();
    runtime.exec("mkdir My\\ Folder");
    runtime.exec("mkdir \"My Folder\"");
    But it's still not working,
    For runtime.exec("mkdir My\\ Folder") it creates two folders My\ and Folder
    For runtime.exec("mkdir \"My Folder\"") it creates also two folders "My and Folder"
    Are there solutions?
    Thank you !

    But my real problem is how to apply the chmod 777 on a folder containing spacesSo why not say so in the first place?
    Runtime.exec ("chmod 777 My\\ Folder");Runtime.exec(new String[]{"chmod", "777", "My Folder"});
    That is why I chose the example of mkdirYour reasoning on this point is incomprehensible. You wanted help with A so you asked about B. Just wasting time.

  • How to persist an entity with (any) Serializable Java Object as a field?

    Hello,
    I've understood, that in addition to basic and primary types, an entity bean can have basically any serializable object as its field. I just can't get it working. All I want, is just to have an entity bean with, for example, a HashMap or Properties as one of the its fields. And afterwards, when I'd query the bean again from the persistent storage, it would have the HashMap or Properties fields set just as they were while persisting the bean. So the basic functionality.
    So far, the only way I've gotten this working, is by defining the field as byte[] and then by using ObjectInput/OutputStreams and ByteArrayInput/OutputStreams I can read/write my HashMap or Properties as a byte[] and persist the entity... Not very clever, is it :)
    I've tried to annotate the field with @Lob but it eventually ends up with casting problems when fetching the data from the persistent storage, because TopLink gets a blob, a byte array from the persistent storage and doesn't know how to convert it into HashMap or Properties like I want it to.
    This was close to mine, but still didn't get it working..
    http://forum.java.sun.com/thread.jspa?threadID=749447&messageID=4287919
    ps. Working with AS PE9, MySQL and PostgreSQL..
    Best regards,
    Samuli

    Hello,
    Sorry, I'm not sure what you mean. The ID used for the entity does not need to match the actual database constraints, so you can use any mapping in the entity as the ID as long as its value will be unique. If it is not unique, you will run into problems when EclipseLink thinks the entity already exists, performing an update instead of an insert.
    Can you describe the performance problems you are having, and what type of sequencing you are using? It is possible to improve performance using batch writing and sequence pre-allocation.
    See http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_(ELUG)#How_to_Use_Batch_Writing_for_Optimization
    and http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_(ELUG)#Table_11-11 for some of the options available.
    Best Regards,
    Chris

  • How to call sql procedure with parameter from java

    Hello,
    i am trying to call one sql procedure with two parameters from java.
    the first parameter is In parameter, the second is OUT.
    the return value of this java method should be this second parameter value.
    the following is my java code:
    protected String getNextRunNumber() {
         String runnumber=null;
         String sql = "{call APIX.FNC_SST_EXPORT.GET_NEXT_RUNNUMBER (?,?)}";
    CallableStatement state = null;
    try{
         Connection con= getDatabaseConnection();
         state = con.prepareCall(sql);
         state.setString(1, m_appKeyExport);
         state.registerOutParameter(2,Types.NUMERIC,0);
         state.execute();
    ResultSet resultR = (ResultSet)state.getObject(2);
         while (resultR.next()) {
              runnumber=resultR.getBigDecimal(1).toString();
    catch (SQLException e){System.out.println("You can not get the export next run number properly");}
    return runnumber;
    i got error message like:
    java.lang.ClassCastException: java.math.BigDecimal
    As far as i knew, if the parameter is number or decimal, we should give also the paramer scale to the method: state.registerOutParameter(), but i still get this error message.
    Please help me to solve this problem.
    Thanks a lot.

    state.execute();
    i try to use debug to find the problem, in this line, i saw
    OracleCallableStatement(OraclePreparedStatement).execute() line: 642 [local variables unavailable]
    is this the problem?

  • How to reload proxy configuration with Next Generation Java Plug-in

    When using the Next Generation Java Plug-in, I no longer see an option in the console to reload the proxy from the browser by pressing p. If the proxy information is changed in the browser after the Java console loads, is there a way to reload the proxy from the browser? If not, why was it removed?
    It's been useful to us because of the way we test with LoadRunner, which uses a proxy. Our other options are to either disable the Next Generation Java Plug-in so the option comes back, or set the proxy in the Java settings instead of trying to read from the browser, but I'm trying to find out it's one of those will be necessary.
    We're using Java 1.6.0_17. Thanks!

    btenney,
    Thanks very much for your suggestion. Can you explain what the parameters are on the ssvagent.exe that you noted -high -jpisetup -old? I can't seem to find any information on the parameters. Also, will this set the configuration just for the user logged on (current user) OR for all users existing and future?
    We are having trouble getting next-gen java shut off for all possible users that may logon to a machine in future .. thus looking at putting in bootup login script, but hoping there is a better way to have it take affect at the machine level. Or to at least automate at the user level (existing and future windows users/profiles)

  • How to Disable Portal Links with Web Dynpro Java?

    Hi all,
    I have configured some access to my apps through iviews in my portal content, each application is included in a PCD Structure inside a User Role; according the roles asigned to my users are the access to the applications the user wolud have
    For example:
    Role 1
    RootApp
         iView1.1
         iView1.2
         iView1.3
    Role 2
    RootApp
         iView2.1
         iView2.2
    Role 3
    RootApp2
         iView3.1
    My users might have one or even the 3 roles, and depending on their roles is the access to the applications that they may have.
    Now I have a requirement of the user wherein when the user logs in to the portal and clic in the RootApp link the Dynpro Application must to present an iView showing a set of terms and conditions; if the users accept the terms then they can continue using the application defined by the PCD definition, but if the users don't accept the terms, the aplication links in the portal must be disabled and the user can not use the aplications defined, but this only has to be applied to the root link selected (RootApp) in wich the user doesn't agreet the terms and conditions, however, other applications that are non dependent of the root link (RootApp) can be used (RootApp2).
    Are there any way to disable only certain portal links using a web Dynpro implementation?
    Thanks In Advance

    Hi
    IMyService portalservice=(IMyService)WDPortalUtils.getServiceRefrence(IMyService.KEY);
    portalservice.myMethod();
    This is the code to get portal service reference and call methods implemented in the service
    Also, add prtapi.jar to build path. Add sharing refernce to portal:sap.com/<Portal Application name>
    Regards,
    Yoga

  • M93p Tiny with 2 DP Monitors under Linux

    We have several M93p Tiny machines with a second display port in the back. All of the ones running windows work fine, but I have just installed Linux (Ubuntu 14.04 at the moment) on one, and only the monitor plugged in to the primary port appears to be working, although everything else works fine.  Can anyone confirm whether this should or should not work? Or maybe point me in the right direction of what hardware is involved in that second port?

    Nevermind.  Apparently making sure the cable is plugged in all the way is an important step In case anyone else happens to be wondering about this, it works perfectly fine.

  • How to properly set the environment for user oracle under Linux

    Hi,
    Every time I install XE on Linux somewhere, I repeat these steps (along with [fixing the /etc/init.d/oracle-xe startup script|http://forums.oracle.com/forums/thread.jspa?threadID=843780&tstart=0]), so I thought, why not contribute this to the community.
    Those who have installed XE on Linux know that, after installation, logging in as user oracle gets you in a
    $cryptic prompt. On top of that, none of the essential environment variables are set. Not amusing. That's because the oracle user lacks the proper configuration files for the bash prompt. Log in as user oracle and create these:
    .bashrc
    if [ -f /etc/bashrc ]; then
      . /etc/bashrc
    fi.bash_profile
    if [ -f ~/.bashrc ]; then
      . ~/.bashrc
    fi
    . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
    unset USERNAME.bash_logout
    clearNow log out and then log in again - a nicer prompt, and all environment variables are set, ready to run sqlplus, imp, etc.
    This should help make your overall XE experience on Linux easier. Regards,
    Georger

    Nice. I checked the .bash_profile of my oracle installation and this is what I can contribute (I got the additional stuff from some tests with other Oracle Versions):
    # /etc/skel/.bash_profile
    # This file is sourced by bash for login shells.  The following line
    # runs your .bashrc and is recommended by the bash info pages.
    [[ -f ~/.bashrc ]] && . ~/.bashrc
    # Oracle Profile Settings
    if [ $USER = "oracle" ]; then
       source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
       if [ $SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
       else
          ulimit -u 16384 -n 65536
       fi
    fiC.

  • Flex with webdynpro for java using Flex Island

    Hi Friends,
    I am on Netweaver/SAP Enterprise Portal 7.0 SPstack12, I am developing UI for BI reports using VC, I am interested in developing UI using flex and want to integrate those apps with EP, I came to know flux Island supports flux with webdynpro java,  basically I am a webdynpro for java developer, I want to develop flux applications with webdynpro for java in NWDS. And i want to know how to use Flex Island with webdynpro for java. So could u please post some useful links.
    Thank in advance
    Regards
    samba

    Hi
    If you want to try out using ADOBE Flash Islands with WDJ, you would need to download SAP CE 7.1 EhP1 trial version, if not done so already.
    The following link may help you in building the WDJ component with Flash Islands..
    The specified item was not found.
    If you donot want to develop the Flex project you can download the .swf file provided by the SAP mentors:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10989ef6-968c-2b10-50a9-eb34a5267163
    Thanks.
    Chitrali

  • How to output executable Bin file under linux from java

    Hi
    im beginner in java under linux and i want to out put my java programs to be bin files that can run
    if this not possilble
    how to run the output jar files with just double click ?
    does i have to run sh file that do the hob how?
    thanks in advance.

    say your main method (application's entry point) is located in a class com.my.Class,
    then first you create a text file (say, manifest.txt) that contains this line:
    Main-Class: com.my.Class
    [/code}
    and then you append this to the jar's manifest as such:
    jar cfm yourjarfile.jar manifest.txt [additional files you might want to add]
    for more info,
    http://java.sun.com/docs/books/tutorial/deployment/jar/manifestindex.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can I use SignalExpress under Linux?

    We have just acquired some Tektronix 1001B oscilloscopes and we are trying to use SignalExpress with a computer working under Linux. How can we do this? Do we need any drivers/special configuration?
    Thank you very much.
    Noelia Gutierrez

    HI Noelia,
    Unfortunatelly Signal Express is only for windows platforms, there is no version for Linux.
    Regards,
    Jaime Cabrera
    NI Applications Engineering Spain

  • MediaPlayer MediaUnsupportedException with any kind of video under Linux

    Hi folks,
    I am trying to play back a video with the JavaFX MediaPlayer under Linux (OpenSuSE 11.2, x86_64) but get a com.sun.media.jmc.MediaUnsupportedException for any kind of file I tried: flv, mpg, ogg, ... gst-inspect (from gstreamer) lists all of the above media types as supported. Does anybody have an idea what the problem could be? Or how to get more information about the reasons of this problem?
    We want to use JavaFX technology in a demonstrator at CeBIT.
    Any help or comments appreciated.

    Thanks, PhiLho, but I am rather sure it finds the file because when it doesn't it issues a different error message. I got my code from the JavaFX book, which is something like
    source: "{__DIR__}flowers_720_1250.flv"

  • Problems with Weblogic6.0 Under Linux

    Hi,
    I have been having this weird problem with weblogic 6.0 under linux.
    I have WL6.0 installed on Redhat Linux 7.2 ( the 2.4 Kernel).
    I start the WL server on Linux and my bean deploys successfully,
    however I have a client bean on an NT box which tries to do a lookup
    on the bean which resides on the Linux box.
    I know that I get the initial context, because on the server side I
    see the IP address being added to its client list , but as soon as I
    try to do a lookup I get the error message
    "Connection refused ..... etc....."
    However , if I start the WL server on the NT box from where my client
    bean resides, (and leave WL server running on Linux) everything works
    fine , and I can reference the object.
    This leads me to think that the following is happening :
    The client actually connects the WL server on Linux looking for the
    relevant stub classes etc.. but the WL server on Linux tells the
    client to look for them else where , ie the machine from where it came
    (in this case the NT machine)
    This explains why when the WL server on NT is running all works fine ,
    because the client goes back to the machine from where it came (NT
    machine) and in this case the WL server is running so it can deal with
    its requests !!
    Running the client and server on Linux works fine and I can also run
    the same code between NT machines and Solaris machines. As soon as I
    introduce the Linux machine into the equation , I start getting this.
    Any help , ideas would be greatly appreciated.
    Thanks.

    Hi.
    Strange. Please post the exception and the full stack trace here.
    Thanks,
    Michael
    Zac Burke wrote:
    Hi,
    I have been having this weird problem with weblogic 6.0 under linux.
    I have WL6.0 installed on Redhat Linux 7.2 ( the 2.4 Kernel).
    I start the WL server on Linux and my bean deploys successfully,
    however I have a client bean on an NT box which tries to do a lookup
    on the bean which resides on the Linux box.
    I know that I get the initial context, because on the server side I
    see the IP address being added to its client list , but as soon as I
    try to do a lookup I get the error message
    "Connection refused ..... etc....."
    However , if I start the WL server on the NT box from where my client
    bean resides, (and leave WL server running on Linux) everything works
    fine , and I can reference the object.
    This leads me to think that the following is happening :
    The client actually connects the WL server on Linux looking for the
    relevant stub classes etc.. but the WL server on Linux tells the
    client to look for them else where , ie the machine from where it came
    (in this case the NT machine)
    This explains why when the WL server on NT is running all works fine ,
    because the client goes back to the machine from where it came (NT
    machine) and in this case the WL server is running so it can deal with
    its requests !!
    Running the client and server on Linux works fine and I can also run
    the same code between NT machines and Solaris machines. As soon as I
    introduce the Linux machine into the equation , I start getting this.
    Any help , ideas would be greatly appreciated.
    Thanks.--
    Developer Relations Engineer
    BEA Support

Maybe you are looking for

  • Nothing shows up on my Desktop. I can put a file into the Desktop folder but it will not appear on the DTop. The HarDrive is not on the DTop either.

    Nothing appears on my Desktop. The Finder seems to work, so I can place a file into the DTop folder, but nothing appears on the DTop, not even the HarDrive.

  • J2SDK1.4 Installation problem on Linux

    After downloading J2sdk 1.4 from Java Sun site, it was stored on my windows system as j2sdk-1_4_0_01-linux-i586-rpm.bin file. I did ftp to this file to a location in my Linux box. But I am unable to extract the .bin file to .rpm file.Somebody please

  • Customer aging with hierarchies

    Hello, We are looking for a way to see the customer aging of open items by highest entry in the customer hierarchy. With S_ALR_870121789 we are pretty close to what is expected but the highest level in this report is the payer. Hierarchy is not taken

  • COBRAS error

    Hello,  Has anyone seen this error on COBRAS import?  (error) executing call handler update in RestoreCallHandlerTopLevel on CallHandlers.cs:Query=execute procedure csp_callhandlermodify ( pAuditAlias='unityadmin',pAuditComponent='COBRASImportForConn

  • Info about Tax on sales/purchase from a business perspective

    Hello everybody, Where could I find information about tax on sales/purchase? I am especially looking for info from a business perspective. The questions I try to answer are, for example, the followings: - What are the main business issues regarding V