The Java programming language and runtime environment do not cause hard drive issues in and of themselves. However, bugs in software written in Java and malicious code that exploits security issues in Java can potentially cause damage to files stored on a hard drive.
Java is a programming language designed to run on virtual machines called Java Runtime Environments, which allow code written in Java to run on any computer that has a Java Runtime Environment installed. The Java Runtime Environment translates the Java code into a language usable by the computer it is installed on and handles system tasks, such as interacting with hard drives. Java Runtime Environments are tested extensively before release, so it is unlikely that the Java Runtime Environments cause hard drive issues themselves.
Unfortunately, bugs in programs written in the Java language could conceivably damage data on a hard drive, such as if a program mistakenly erases files incorrectly or writes corrupted data to a disk. Older versions of Java have had a significant number of security issues, as reported by computer news website InfoWorld. Malicious software using Java accounted for 14 percent of successful attacks on computers in 2014. For optimal security, be sure to use the latest version of Java.