How to get name of my machine ?

Could someone please give a code snippet on how to find out the name of my computer ? By name, I don't mean the IP-Address. As for example, my computer name is Pluto, and I want to write Java-code to get it.
Cheers
/Andreas

Try this:
import java.net.*;
public class Example {
    public static void main(String[] args) throws Exception {
        InetAddress addr = InetAddress.getLocalHost();
        System.out.println(addr.getHostName());
}

Similar Messages

  • Photoshop elements 10 will not migrate to my new macbook pro/retina display.  There is no CD/DVD player on this machine.  Any suggestions on how to get Elements onto my machine?  Yes, I have the disk(s).

    Photoshop elements 10 will not migrate to my new macbook pro/retina display.  There is no CD/DVD player on this machine.  Any suggestions on how to get Elements onto my machine?  Yes, I have the disk(s).  Am I going to have to buy an external CD/DVD player to load this one program:(

    I have ordered a USB3 BluRay/DVD/CD player/burner and will use that both with my iMac ( in which the Superdrive seems to be failing ) and the MBPro Retina I just bought .

  • How to get name of sbRIO programatically

    How to get "name" and "Comment" of sbRIO which I write to sbRIO-9602 in MAX in Identification box (Model, Serial number, MAC address, Name)?
    Solved!
    Go to Solution.

    That shows:
     - IP settings
          - IP adress:        136...etc.
          - DNS name:      MyMaster5                   - THAT IS WHAT I NEED, just in wrong place - in MAX it is not in IP settings, that's why i didn't searched for it there.
          - subnet mask    255.255.255.0
          - gateway          136...
          - DNS server      136...
     - MAC address        00800...
     - serial number        16....
     - system state        Running
     - model name         sbRIO-9602
     - model code          7373
     - password protected restarts?    T/F
     - halt if TCP/IP fails?                   T/F
     - locked?                                   T/F
     - use DHCP?                             T/F
    Still there is no "comment" as in MAX. But that's not so important now.
    I have LW Development system 2009 SP1 Profesional, Realtime Development 2009 SP1
    Thanks very much!

  • How to get name of table from front end

    Hi,
    How to get name of table from front end in EBS 11i?
    thanx
    Ashish

    Hi
    Sandeep is correct. The "Help"/"Record History" will give you the table/view name, but sometimes this particular menu function give me a "Record History is not available here." error message.
    I then use the following menu functions (this will also give you additional information, like column details).
    1) Open Forms
    2) Click on Help/Diagnostics/Examine (*you might have to enter the APPS password at this point)
    3) Change "Block" to "System"
    4) Change "Field" to "Last_query"
    The system will populate the "Value" field with the query that was executed in order to populate the form.
    Regards
    Frank

  • How to get names of sub tabs?

    Hi All,
    Could someone tell me how to get names of all sub tabs?
    I have Parent Tab T1. T1 has 3 sub tabs T1_1, T1_2 and T1_3.
    I would like to have T1_1, T1_2 and T1_3 sub tab names in the list.
    Thanks in advance!!
    Dip

    Dip,
    You can get the tab names from apex dictionary views, apex_application_tabs & apex_application_parent_tabs . Thanks.
    Regards,
    Manish

  • How to get names of method parameters ?

    How to get names of method parameters (Not only their type and value) is it only possible during debugging ??
    for example void myFunction(int a,int b)
    I need the "a" , and the "b" The issiue is about the java.lang.reflect.InvocationHandler ,
    and its method invoke(Object proxy,
    Method method,
    Object[] args)
    throws Throwable
    I Have the parameter objects themself and their types using method.getParameters() , this is fine ,, but i need the names of the parameters !!!

    If the class file was compiled without debug information included then it is impossible to get the original parameter names, as used in the source code.
    However, If the class file does include debug information, then the method names are hidden deep within the class file. You'd need to parse the class file yourself. Check out a copy of the Java VM Specification for a detailed format of the java class file format.
    It's not a trivial task to parse the java class file, and the VM spec isn't easy reading. You'd nearly be writing a class file disassembler.

  • How to get names of INCLUDE or FORM within included forms

    Hello,
    I want to get names of Include program and included form within included forms.
    I tried SY-REPID or SY-CPROG but these two SYST variables return the name of report program that performs the form, not the name of Include or form.
    Please give me any advice about how to get names of include / included form.
    thanks and regards,
    Hozy

    You can use the statement
    READ REPORT <Report name> into itab
    to read the source code into an internal table.
    Later you can use the "Contains Pattern" operator to get the statements that you need.

  • How to get names of all hard disks?

    Hi,
    How to get names of all hard disks.
    For example:
    There are 3 disks in my computer: A, C,D (OS:&#12288;Windows).
    and then I want to know how many disks (3) and their names( A, C, D) are there?
    Please give me some code sapmles. Thanks.
    (---sorry, my English is not very well----)

    Look at a few of these
    http://onesearch.sun.com/search/developers/index.jsp?qt=%22hard+disk%22+label&qp=forum%3A31&qp_name=Java+Programming&col=devforums

  • How stub gets copied in Client machine

    Hi,
    I'm new to EJB. Tutorial states that stub would be in client side and it would make communication to skeleton which is in EJB server. Could someone pls explain when /how stub gets copied to client machine ?
    Thanks.
    Patil

    When you request a page which contains Java Applet ( which is nothing but as .class file ) it gets transfered from server to the browser and gets executed using Browser's JVM. ( But I dont understand in what why this is related to my original questions )
    Thanks.

  • How to get IPAddress of the Machine

    Hi All,
    Could anyone please tell me how to get the IP Address of the machine. Ie, I want to get my machine's IP Address and initialise the ServerSocket with that IPAddress. Thanks in Advance.
    Regards,
    Shankar.

    You find static methods for this in class java.net.InetAddress.
    import java.net.InetAddress;
    InetAddress myLocalIp = InetAddress.getLocalHost();If you have just one Network-card in you machine thats all you need to know, and as was stated in the previous post you don't need to initialise the ServerSocket with it beause the localhost-ip is used automaticly
    If you on the other hand have more than one Network-card, or if you have any other open Network channels (like for instance your connected to the Internet via a modem you could use the following code-fragment to get all the available InetAddress-objects of you machine:
    InetAddress local_ip=null;
    InetAddress [] all_local_ips=null;
    try {
         //First retrieve your local hostname
         local_ip=InetAddress.getLocalHost();
         //now use you local hostname to get an array of all the IP's avaliable for you machine
         all_locals_ips=InetAddress.getAllByName(local_ip.getHostName());
    catch(UnknownHostException uhe) {
         //Don't know my own names;
         all_local_ips=null;
    catch(SecurityException se) {
         //Not allowed to read the names
         all_locals=null;
    }

  • How to get names of all Windows in a Form Application at runtime

    Dear All,
    I want to get the name of all windows in a form module programatically at run time. How to get it?
    Any help or comments will be highly appreciated.
    Thanks in Advance.
    Best Regards
    Bilal

    Hi Francois Degrelle,
    First of all thanks for the response.
    What if I have no items on a content canvas? In my application, I am using content canvas to hold the Image banner and help text of the current form, having no items at all. I am also using tab canvases to hold all items of form. The tabs are displayed on the content canvas at run time. So the tab canvases acts like frames (In my case).
    Now if I am looping through items, it gives me the list of all of the tab canvases. Whereas the tab canvas always has no window assigned, as it is displayed on content canvas which has that Window which I need. Thus I am unable to get the names of windows in my case through the above stated procedure.
    Another option could be if I can get the name of the content canvas upon which the given tab canvas is displayed?
    Any way to do this or some other way to achieve the use case?
    Any help will be highly appreciated.
    Thanks in advance
    Bilal

  • How to get name of an entry?

    I search in my schema with code below:
    List<OrganizationPojo> organizationPojoList = new ArrayList<OrganizationPojo>();
         DirContext ctx = null;
         try { 
         // get a handle to an Initial DirContext
         ctx = new InitialDirContext(env);
         String[] attrIDs = { "dc", "objectClass","ou" };
         SearchControls ctls = new SearchControls();
         ctls.setReturningAttributes(attrIDs);
         ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
         String filter = "(&(dc=*) (objectClass=organizationalUnit) (ou=*))";
         NamingEnumeration answer = ctx.search(searchBaseDn, filter, ctls);
         try
                   while (answer.hasMore())
                             SearchResult sr = (SearchResult) answer.next();
                             LdapName dn = new LdapName((String)sr.getNameInNamespace());
                             LdapName rdn = new LdapName((String)sr.getName());
    I learned SearchResult.getName returns the name "relative to search base"
    But i only want to get the name of entry.
    I am getting dn correctly but can not find out how to get rdn relative to parent in the tree.

    More generally, to get the RDN of any search result, you're nearly there:
    List<Rdn> rdns = new LdapName(sr.geNameInNamespace()).getRdns();
    Rdn rdn = rdns.get(rdns.size()-1);

  • How to get name or unix id of last switched System Events process?

    Hello
    I am writing a script to be used as an idle function to send a command to a process as soon as it's not frontmost anymore. So far, I can figure how to get the unix id or name of the frontmost process, but not of the previous process . Here is what I have:
    on idle {}
    my handleProcesses()
    return 5 --- '5' tells idle () to run every 5 seconds.
    end idle
    on handleProcesses()
    tell application "System Events"
    set FrontApp to (get name of every process whose frontmost is true)
    set PrevApp to (get name of previous process)
    end tell
    --- my command here, like tell PrevApp to hide...
    end handleProcesses
    My problem is that "previous process" is not in the System Events dictionary. I cannot use "frontmost if false" either, because this would return all other opened applications, not just the previous one.
    I know one partial solution would be to use Command-Tab, get the name of frontmost, and use Command-tab again. But, it's not really pratical nor elegant.
    What I need is a function which can get my frontmost process name (which is easy), and return it when the process is inactive (no more frontmost).
    Thanks.
    Vic

    You can do what you want if you maintain a record yourself of what used to be frontmost:
    tell application "System Events"
    set FrontApp to (get name of every process whose frontmost is true)
    set lastFrontApp to FrontApp
    repeat while FrontApp = lastFrontApp
    set FrontApp to (get name of every process whose frontmost is true)
    end repeat
    set BackApps to (get name of every process whose frontmost is not true)
    if lastFrontApp is in BackApps then
    --the app is open in the background
    else
    --the app was closed
    end if
    end tell

  • How to get name of selected image?

    Hello ,
    I want the name of selected image.I have PDEImage and PDEElement of selected image.
    How to get the name of selected image?is it possible to get name of image on document?
    please,help me.

    That information is not required to be stored in the PDF.  It present, it could be present in the XMP-based metadata of the image.
    Consult ISO 32000-1, ISO 16684-1 and the XMP specification for details.

  • How to get name of the month from current date.

    Hi,
       How to get the name of the month from current date.
    Thanks,
    Senthil

    Sethil,
    Use your date(let us say Date1) instead of sy-datum.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
    TABLES
    MONTH_NAMES = itab_month
    EXCEPTIONS
    MONTH_NAMES_NOT_FOUND = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE itab_month
    WITH KEY MNR = date1+4(2).
    itab_month-LTX will contain the value you are looking for
    Good luck
    Raghava

Maybe you are looking for

  • Authentication failed in obiee 11g

    Hi All, Error: On the login screen I am getting a message as: Unable to Sign in An error occured during authentication. Try again later or contact your system administrator. Solution applied but did not work: 1) Using GUID to refresh the web catalog

  • The database error text is: ORA-01843: not a valid month

    I am trying to use a date field as a query filter and I keep getting the following error: A database error occurred. The database error text is: ORA-01843: not a valid month. (WIS 10901). When I remove the query filter and run the query it works as e

  • ZFS mirror on root, one of the two devices appears offline

    Hello everybody, I'm a new Archlinux user. I've managed to install it on a pool (called RAID1) composed of two LUKS encrypted devices (/dev/mapper/HD3 and /dev/mapper/HD10). This is the pool: # zpool status pool: RAID1 state: ONLINE scan: resilvered

  • Internal speakers and audio output gone from System preferences

    i can't get macbookpro 2010 to recognize internal speakers and audio output. only optical OUTPUT. CAN'T GET ANY SOUND EXCEPT FOR OPTICAL PORT

  • Just snipping wires to remove a completely broken display

    I know there's been a bunch of topics posted on repairing/replacing a broken screen, but... I've got a Powerbook Ti with a completely inop screen and two broken hinges (yes, I dropped it badly!). The laptop works fine with an external monitor. The on