Java Agents are used to replace code when the application is running. When you are debugging with IntelliJ, Eclipse etc. and you saving / rebuilding your code, an agent will be loaded to do it.
The environment has to be a Java Development Kit (not a Java Runtime Enviroment) to inject
the code at runtime. If you want to apply the agent with -javaagent:<agent-jar>
it will work
for both.
Furthermore the agent can only add classes and change method contents at runtime.