Giter Site home page Giter Site logo

jhardware's Introduction

jHardware

Get crossplatform hardware details using pure Java.

Installation

To install jHardware you can add the dependecy to your software project management tool: http://mvnrepository.com/artifact/org.jhardware/jHardware/0.8.5

For example, for Maven you have just to add to your pom.xml:

 <dependency>
      <groupId>org.jhardware</groupId>
      <artifactId>jHardware</artifactId>
      <version>0.8.5</version>
 </dependency>

Instead, you can direct download the JAR file and add it to your classpath. http://central.maven.org/maven2/org/jhardware/jHardware/0.8.5/jHardware-0.8.5.jar

Basic Usage

To retrieve hardware data we only have to call an static method. This method will return a bean with all the basic and crossbrowser data and it will also include a map with all the data retrieved in the system.

Get CPU details

    ProcessorInfo info = HardwareInfo.getProcessorInfo();
    //Get named info
    System.out.println("Cache size: " + info.getCacheSize());        
    System.out.println("Family: " + info.getFamily());
    System.out.println("Speed (Mhz): " + info.getMhz());
    //[...]

    //Get all info from map
    Set<Entry<String, String>> fullInfos = info.getFullInfo().entrySet();
        
    for (final Entry<String, String> fullInfo : fullInfos) {
        System.out.println(fullInfo.getKey() + ": " + fullInfo.getValue());
    }

Same for other hardware components as Memory, Motherboard, Bios...

Similar projects

Another similar project with the same goal is OSHI (Linux, Mac and Windows compatible). Instead of pure Java it uses native code accessed by JNA.

More info

Webpage: http://www.jhardware.org

jhardware's People

Contributors

profesorfalken avatar

Watchers

James Cloos avatar 王学门徒 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.