Hello everyone,
I know this question has been asked before but it is possible to write a keylogger in java? Before assumptions are made I'm not trying to hack anyone or do anything illegal. I simply have a team project in my data structures class and I am an aspiring computer forensic scientist. I'm not looking for the program to hide in Windows processes I just want to know if it is possible to get the basic functionality of a keylogger in this language.

... sounds like you have to attack a database, use dictionary, social engineering maybe, a lot of queries....

Java lacks the low level operating system hooks to do this, and that's by design.
You'd need to use JNI or JNA to do the actual sneaky stuff and pass that information to a Java process.

but it is possible to write a keylogger in java?

I haven't done it, but I have seen someone create a program that included one before. It is much more common with other languages as mentioned above.

yes it's possible

package keylogger;

import java.keylogger.*;

public class Keylogger 
  while (PC.windows.on.getState == true)
    if (keyPressed.equals("true"))

@homo would you care to provide link to java.keylogger library, because I cannot find it.