Info about dependencies and mechanism
jensli opened this issue · 2 comments
Hello,
Thanks for a interesting project!
I have some question about how jHardware works.
-
I noticed that JNA is in the Maven dependencies of the project (transitively though jSensors). But at the same time the read-me file says that JNA is not used. So can I use jHardware without having JNA on my classpath? Can I use some functionality from jHardware without JNA?
-
I also noticed jPowerShell in the dependencies. Does that mean that PowerShell must be installed on a Windows system for jHardware to work?
-
Is PowerShell and JNA the tools that jHardware uses to read hardware information? How does it work on Linux? Does it invoke other native commands to get information?
-
The read-me text says that jHardware is "using pure Java". I don't think this is accurate if you are in fact using JNA and calling native programs such as PowerShell to get information.
I think this information would be useful have in the read-me text!
Thank you!
Hello,
It is interesting what you say and in fact your analysis is perfect, you are totally right.
I started the project with the goal of making a multiplatform tool using only pure Java and some platform commands. In Linux it is quite easy because there are plenty of commands, but in Windows... it is necesary to make lots of queries WMI in order to get the good information! Thats why I created jPowerShell, which uses Powershell console.
After some time, I get a little bit discouraged because I found that it was not so easy. For example, when using a system configured in another language, the result of some commands is different, and that make the parsing almost impossible. That is the main reason why the project is half abandoned.
Regarding JNA, I did not use it until the 0.8 version, I think. What happened? In order to get the temperature of CPU, GPU etc, I used some commands but the results where totally inaccurated. At that time I had created another project called jSensors, which uses some dlls on windows and other linux libraires, using JNA.
So, for 0.8 version (I think) I decided to take advantage of jSensors. Maybe I have made an error including this, I do not know...
After that I have been concentrated in other things and the project is not updated very often so I guess the description is not totally right.
In summary:
- Maybe..., have you tried?
- Yes
- In linux is really easy: 'cat /proc/cpuinfo', 'cat /proc/meminfo' etc
- One day I will take a decision and I will remove jSensors, or change the description :-)
Feel free to propose changes/pull request or fork the project and make it live again.
Best regards!
Thanks for the information! These things are helpful to know.