M
M
Morfeey2017-05-10 16:04:14
Java
Morfeey, 2017-05-10 16:04:14

How to connect ProcessInfo in Java?

I decided to start learning Java, I need to work with processes, I googled and found some convenient code:

List <ProcessesInfo> processesList = JProcesses.getProcessList();

        for (final ProcessesInfo processInfo : processesList) {
            System.out.println("Process PID: " + processInfo.getPid());
            System.out.println("Process Name: " + processInfo.getName());
            System.out.println("Process Used Time: " + processInfo.getTime());
            System.out.println("------------------");
        }

Naturally I tried to connect java.lang.Object.*, but nevertheless the result is zero. I tried to googling harder, but either little is clear, or not right.
PS: My apologies for such a junior question.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question