Skip to content
  • Java
    • Core Java
    • Java 8
    • JDBC
  • Frameworks
    • Spring
    • SpringBoot
    • JSF
    • Struts
    • Hibernate
  • SpringBoot
  • J2EE
    • Servlet
    • JSP
    • Java Mail
    • JMS
    • JMX
    • Web Services
  • Databases
  • Hibernate
  • JavaScript
  • Others
    • Build Tools
    • POI API
    • OpenShift
    • XML
    • Polls

</> MV Techbytes

Full Stack Dev Tutorials

System Host Name

How to get System Details in Java?

June 1, 2014June 4, 2020MallikLeave a comment

  • Below program explains how to get System details like, system name/hostname, IP Address and Login User Name.
package in.malliktalksjava;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
* @author malliktalksjava.in
*
* This class gives you the system Host details, IP address and
* login user name
*/
public class GetSystemInfo {

public static void main(String[] args) {
try {
InetAddress inetAddress = InetAddress.getLocalHost();

// Print Host Name
System.out.println("System Host Name : "
+ inetAddress.getHostName());

// Print complete hostname with domain
System.out.println("System Canonical Host Name : "
+ inetAddress.getCanonicalHostName());

// print IP address
System.out.println("System IP Address : "
+ inetAddress.getHostAddress());

// Print Login user name
System.out.println("Login User : "
+ System.getProperty("user.login"));

} catch (UnknownHostException e) {
e.printStackTrace();
}
}
}

 

Core Java, JavaGet System details in java, How to get IP address using Java, How to get system Login user name in java, How to get System Name using Java, Java.net.InetAdrress, System Host Name, UnknownHostException

 Search

Do you Like this site?

Do you Like this site?

Categories

  • Java
    • Core Java
    • Java 8
    • JDBC
  • Frameworks
    • Spring
    • SpringBoot
    • JSF
    • Struts
    • Hibernate
  • SpringBoot
  • J2EE
    • Servlet
    • JSP
    • Java Mail
    • JMS
    • JMX
    • Web Services
  • Databases
  • Hibernate
  • JavaScript
  • Others
    • Build Tools
    • POI API
    • OpenShift
    • XML
    • Polls

Top Posts & Pages

  • REST API Components - Standards and Design aspects
  • How to convert a JKS Keystore to a PKCS12 (.p12) format
  • Jar file Vs Executable Jar file
  • Avoid nested loops using Collection Framework in Java
  • Example Program: Search Word in Folder files and print output
  • Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tilesConfigurer' defined in ServletContext resource
  • Apache FreeMarker for transformation between data formats
  • org.springframework.beans.NotReadablePropertyException: Invalid property
  • javax.servlet.ServletException: Could not resolve view with name 'home' in servlet with name 'springDispatcher'
  • Apache Kafka vs IBM MQ
Advertisements

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 692 other subscribers

Most Recent Activities

  • Elasticsearch, Logstash, and Kibana – ELK Stack
  • Building Reactive Applications with Vert.x: A Comprehensive Tutorial
  • Java 17 Features with Detailed Explanation
  • Apache Kafka vs Apache Flink
  • Sort Employee Objects on Age
  • Apache Kafka vs RabbitMQ
  • Apache Kafka vs IBM MQ
  • Apache Kafka – Java Producer & Consumer
  • ReactJs basic application creation
  • Apache Kafka – Environment Setup
  • Spring Cloud Sleuth & Zipkin – Distributed Logging and Tracing
  • Different ways of sorting an User Object
  • Selenium Automation – Open URL in multiple browsers
  • Apache FreeMarker for transformation between data formats
  • REST API Components – Standards and Design aspects
  • Spring Boot vs LoopBack – Node.js for developing Microservices
  • Algorithms in Java Interviews
  • Spring Boot and Zuul API Gateway Integration
  • Core Java and Java 8 Concepts
  • Rules of method overloading and overriding
Advertisements

Archive

Pages

  • ES6 Interview Questions
  • Hibernate Interview Questions
Advertisements

Mallikarjun Gunda

This is Mallikarjun Gunda, I am working as a software professional. Blogging is my Passion. This blog contains the posts on Java related technologies and programming languages. I am happy to share my knowledge through the blogs.

Venkata Sai Santhosh Nedunooru

I am a Software Developer having over 9+ years of experience in IT with a strong background in Java/J2EE.
LinkedIn:
https://www.linkedin.com/in/venkatasainedunooru/

Site Stats

  • 391,458 hits

All tags

AngularJS Apache Cassandra Apache Kafka Arrays in Java Cassandra Cassandra Database Cassandra examples client stubs creating a java web service creating a web service using java difference between interface and abstract class Differences between SOAP and RESTfull webservices download the spring basic application ES6 Examples ES6 Tutorials Generating webservice client stubs Hibernate hibernate exceptions how to generated web service client stubs in STS How to implement Spring basic application how to write singleton design pattern in java interface in java Java Java Arrays Java Example Programs Java examples Java interview questions java programs java project Java sample Programs JavaScript Java Script JavaServer Faces Java Sorting alogorithms Java Tutorials javatutorials Java Web services JDBC Microservices openshift open shift POI API POI Examples public class public static void main Redhat OpenShift representational state transfer Restfull webservices sample programs in java Service-oriented architecture Singleton design pattern in java SOAP software sorting of int array in java SpringBoot Spring Framework Spring Interview Questions Spring MVC Spring MVC Example program Spring MVC sample Program Spring Sample Programs Spring Tutorials Struts technology Top Java Interview questions w3c dom Web service web service client Web Service Description Language webservices Web services writing singleton design pattern in Java WSDL Xml xml parsers
Advertisements
Advertisements

Popular Categories

Angular Apache Kafka Build Tools Cassandra Core Java Databases ES6 Frameworks Hibernate Java Java 8 JavaScript JDBC JMS JMX JSF JSP Nodejs Others POI API Polls SCJP Servlet Spring SpringBoot Struts Struts 1.x Struts 2.0 Web Services XML
One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

Follow Us

  • Facebook
  • LinkedIn
  • Twitter
Follow </> MV Techbytes on WordPress.com

Receive notifications of new posts by email.

Join 692 other subscribers

© 2009-2020

 </> MV Techbytes | All rights reserved
Create a website or blog at WordPress.com
  • Follow Following
    • </> MV Techbytes
    • Join 397 other followers
    • Already have a WordPress.com account? Log in now.
    • </> MV Techbytes
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar