issuing hard drive commands with java

后端 未结 4 1365
日久生厌
日久生厌 2021-01-24 12:27

Does anyone know of a way to issue commands to a hard drive within Java? Does Java even support this kind of hardware interaction?

For example, if I have a SCSI hard dri

相关标签:
4条回答
  • 2021-01-24 13:06

    No, since Java runs in a "virtual" machine rather than a real one. But it could be used as a bridge as dj mentioned earlier using JNI.

    According to Wikipedia JNI can also call assembly directly. JNI could be used to call complete programs written in C or C++

    0 讨论(0)
  • Java doesn't support talking directly to hardware like that. However, you can use JNI to call a C/C++ function from Java that can.

    0 讨论(0)
  • 2021-01-24 13:13

    Three words "JNI or JNA". I strongly recommend taking a look at the latter to see if it suits your situation, instead of just opting for JNI.

    0 讨论(0)
  • 2021-01-24 13:18

    you need to write the HDD interface code in C/C++ and then call that from Java using JNI

    0 讨论(0)
提交回复
热议问题