最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

linux - how to forbid the process called java which engages high cpu - Stack Overflow

programmeradmin0浏览0评论

Here is the output of top command

There is a process called java uses excessively high cpu. And the pid changes all the time. This is really annoying because it make the fan of the laptop noisy even when I run no apps.

So how to forbid this process from running? Thanks.

If I kill the process, a new process with name java but new pid creates. I want to forbid it from running.

Here is the output of top command

There is a process called java uses excessively high cpu. And the pid changes all the time. This is really annoying because it make the fan of the laptop noisy even when I run no apps.

So how to forbid this process from running? Thanks.

If I kill the process, a new process with name java but new pid creates. I want to forbid it from running.

Share Improve this question asked Nov 20, 2024 at 7:51 Liang XiaoLiang Xiao 1,5162 gold badges14 silver badges21 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0
  1. Find the Parent Process

    • Use the pstree or ps command to trace the parent process: pstree -p | grep java Disable the Parent Process

    • If it’s a service, disable it: sudo systemctl stop <service_name> sudo systemctl disable <service_name> • If it’s a cron job, check and remove the job: crontab -e

Block Java Execution

•   Locate the Java executable:
which java

Rename or restrict permissions to prevent it from running:

sudo chmod 000 /path/to/java

Windows

  1. Locate the Source of the Java Process

    • Open Task Manager (Ctrl + Shift + Esc). • Go to the Details tab, find java.exe, right-click, and select Open File Location. • Check which application or script is launching it.

  2. Disable Startup Programs

    • Press Win + R, type msconfig, and go to the Startup tab. • Disable any Java-related startup programs.

  3. Stop Services

    • Open Services: • Press Win + R, type services.msc, and press Enter. • Look for any Java-related services, right-click, and select Stop, then set the startup type to Disabled.

  4. Prevent Java from Running

    • Rename java.exe: • Navigate to its directory (found in Step 1) and rename it to something like java_disabled.exe. • Alternatively, use Group Policy to block it: • Press Win + R, type gpedit.msc, and navigate to:

    Computer Configuration > Administrative Templates > System > Don't run specified Windows applications

发布评论

评论列表(0)

  1. 暂无评论