Current Position:Home > How to Access the Systems ipaddress in a java program

How to Access the Systems ipaddress in a java program

Update:10-11Source: network consolidation
Advertisement
Hi
   In a network The ip addresses of every system is changing.So that i want to know the ipaddresses of the system dynamically.
   I want a client program to  do that.
And also i want to kno how to create a .exe file for java
class file

The Best Answer

Advertisement
Hi
In order to find the IP address of a system dynamically through a java programme Here is code...
    import java.net.*;
    public class check{
     public static void main(String args[])
              try
{ InetAddress addr = InetAddress.getLocalHost();
    String ipaddress_as_text =addr.getHostAddress();
    System.out.println(ipaddress_as_text);
        catch(Exception ex){}
  For the 2 question ie to convert a .class file to a
.exe file there are some tools available...
I think the following link will be useful to you.
       http://duckware.com/jexepack/index.html 
    Thank you....
  • How to Access the Systems ipaddress in a java program Update:10-11

    Hi    In a network The ip addresses of every system is changing.So that i want to know the ipaddresses of the system dynamically.    I want a client program to  do that. And also i want to kno how to create a .exe file for java class fileHi In order

  • Setting persitent system environment variables using java program Update:11-30

    hai, Iam tryng to write installation for an application,which require to set some persistent system environment variables using java program. I have tried using set command Runtime.getRuntime().exec("cmd /c set blah blah "),but this applies only

  • How to access database file on CDROM from Java Programe?? Update:10-11

    Hello friends, I am making online exam application. I want my question database to be reside on CDROM. but i am not getting any idea how to make DSN or static path that resolute the path that i have mentioned for CDROM. basically i want to know how t

  • Accessing DB2 data through DBLINK in Java program recieves ORA-02063 error Update:11-23

    Hello, Is it posible to access a mainframe DB2 table through a Java JDBC connection utilizing a DBLink / Synonym. Using Toad or SQLDeveloper, I can select the DB2 data just fine. Also, PL/SQL programs can access the data without issues. When I try to

  • How do you access things like volume in a java program Update:10-11

    I want to access the volume on a computer with a java program. How does one do this?Are you saying that you need to add rows to a table in DB2 via a Java program? If so, you need to look at the JDBC API, (available on this site along with a bunch of

  • How to make internal speaker of a computer system on with a java program Update:11-30

    hi experts........ i got a requirement that i have to just make a sound when i get some exception. is this possible to make internal speaker on from a java program? if so please tell me the solution thanks Naresh G.thanks for the solution it is makin

  • Unable to connect to ECC system through stand alone JAVA program using JCO. Update:11-30

    Hi All, I want to connect to ECC system through standalone JAVA program using jco.while executing my java program it is saying that connection refused. I am getting the error as shown below. com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION

  • How can I pass system commands from a java program? Urgent! Update:11-30

    hi, I have been trying this out since a long time. How do I send system commands to command.com or cmd.exe from a java program and an output of the executed command back to the java application. If u have any idea, or have any information about the k

  • How to access system calls from java program? Update:11-30

    i am having a doubt regarding accessing system calls from a Java program like accessing unix system calls from a c program.Runtime.getRuntime().exec("line command here"); example: Runtime.getRuntime().exec("ls -la");Read other 2 answer

  • Accessing Sql Server from AS400 Java program Update:11-30

    Hi everybody, I am trying to access Sql Server from an AS400 Java program. I have tried various Sql Server JDBC drivers including the Microsoft one but no luck yet. When i try to compile my Java program (with driver file in the classpath) it gives so