I tried to delete a file that I have two of, one slightly changed, so I could delete the older one and replace it with the new one I changed. When I tried to delete the file I got the error message 'file in use' where it said the action can't be completed because the file is open in Java(TM) Platform SE binary.
How do I close it?
Press the Windows key + E to start File Explorer and the folder that includes the file you need to run. You should right-click the JAR file and select Open with from the context menu, then select Choose another app. Sselect to open it with Java(TM) Platform SE binary.
The Java Platform on the PC enables you to run Java based Apps, Web Pages and Games that need to be run within the Java Virtual Environment which is causing the Java to drain a portion of the CPU. Uninstalling it will cause Java needing Web Pages, Applications and Games not to run Properly so it not advised.
OpenJDK is a free, open source implementation of the Java SE Platform Edition from Sun Microsystems. It was originally developed by Oracle Corporation in 2006 as part of their work on the Java Community Process (JCOP).
In many cases, this can be traced back to a video driver issue that results in the Java application crashing on a Windows computer. To fix this issue, check your video card driver installed in your system then update accordingly.
This is what worked for me (using Windows). It is basically the same procedure as commented by ali haider, but with more details...
Using Windows command prompt:
tasklist | findstr java
("findstr" is a command line utility for Windows similar to "grep" in Linux)
Search for any lines with 'java' and note the PID of the java process.
taskkill /F /PID "PID_OF_JAVA_PROCESS"
where "PID_OF_JAVA_PROCESS" should be replaced with actual PID number.
Result:
SUCCESS: The process with PID "PID_OF_JAVA_PROCESS" has been terminated.
Repeat for each java process that is running. Now you should be able your desired file!
Let me know if you need instructions for Linux (i.e. ps, kill, etc.), but probably most Linux users know these...
Simply open the task manager on Windows, Check for Processes, Close all the java processes. Now again try deleting the file, you should be able to. This worked for me.
Cheers!
Close the project in Eclipse and it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With