0

I'm writing an application in java. In order to work my code properly, I want to check whether several software are installed. (This should be done in the java code itself.) How can I do that?

This is a Linux system.

There are similar questions, but not exactly what I want.

Check if a program is installed on a linux machine from a java applet

Community
  • 1
  • 1
udakarajd
  • 114
  • 11

1 Answers1

1

There is no universal way of doing it.

You can use one of following approaches

  • Use java bindings for particular package manager for your platform if they exist.
  • Use one of the system tools like locate, whereis, etc. (which you didn't like)
  • Implement your own installed package detection, according to your requirements
deimus
  • 9,565
  • 12
  • 63
  • 107