How to get the Ram size and Hard disk size of the PC using Java? And Is it possible to get the currently logged user name on PC through java?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Disk size:
User name:
I’m not aware of a reliable way to determine total system memory in Java. On a Unix system you could parse
/proc/meminfo. You can of course find the maximum memory available to the JVM:Edit: for completeness (thanks Suresh S), here’s a way to get total memory with the Oracle JVM only: