Okay im working on a java program which will get peoples system info and save it to a text file so i can help them with problems (designed for members of my family to use as i seem to be their own personal IT guy lol)
package sysinfo;
import java.io.*;
public class Main {
public Main()
{
}
public static void main(String[] args)
{
System.out.println();
System.out.println("JAVA SYSTEM INFORMATION PROGRAM");
System.out.println();
System.out.println("Java Runtime Information.");
System.out.println(System.getProperty("java.runtime.name") + " version " + System.getProperty("java.runtime.version") + System.getProperty("java.vm.version") + " by " + System.getProperty("java.vm.vendor"));
System.out.println("Execution Directory: " + System.getProperty("user.dir"));
System.out.println();
System.out.println("OS / Platform Information.");
System.out.println("OS appears to be: " + System.getProperty("os.name") + " Version " + System.getProperty("os.version") + " on " + System.getProperty("os.arch") + " architechture");
System.out.println("Number of (Logical) CPUs available: " + Runtime.getRuntime().availableProcessors());
System.out.println();
System.out.println("User Information.");
System.out.println("User: " + System.getProperty("user.name") + " has a home directory at: " + System.getProperty("user.home"));
System.out.println("Desktop environment appears to be: " + System.getProperty("sun.desktop"));
File[] roots = File.listRoots();
System.out.println();
System.out.println("Filesystem Information.");
System.out.println("Temp directory is: " + System.getProperty("java.io.tmpdir"));
System.out.println();
for (File root : roots)
{
System.out.println("File system root path: " + root.getAbsolutePath());
System.out.println("Total space (Megabytes): " + root.getTotalSpace() / 1048576);
System.out.println("Usable space (Megabytes): " + root.getUsableSpace() / 1048576);
System.out.println();
}
}
}
Got this far, but im after some more info like total RAM, free ram, (only seem to be able to find out how much is available to the JRE itself) as well as CPU make/model and network info like IP.
Is there a portable way to do this? Linux/Windows/OSX?