Skip to content

Java agent to reload .class files; it uses file watch API available in Java 7+

License

Notifications You must be signed in to change notification settings

xitrum-framework/agent7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent7 aims to be simple, for use by standalone JVM programs to reload .class files in development mode. It only reloads .class files in classpath when they are changed.

"7" in "Agent7" is because Agent7 uses file watch API available in Java 7+. You need to use Java 7+.

Usage

Download agent7.jar.

java -javaagent:path/to/agent7.jar [other options] <YourMainClass>

Whenever a .class file in the current working directory (or its subdirectories) changes, Agent7 will reload the corresponding class in all class loaders.

DCEVM

Agent7 can run with normal Java. But it is intended for use together with DCEVM.

The Dynamic Code Evolution Virtual Machine (DCE VM) is a modification of the Java HotSpot(TM) VM that allows unlimited redefinition of loaded classes at runtime. The current hotswapping mechanism of the HotSpot(TM) VM allows only changing method bodies. Our enhanced VM allows adding and removing fields and methods as well as changes to the super types of a class.

Although DCEVM supports advanced class changes, it itself doesn't reload classes. You need a javaagent like Agent7 (IDEs like Eclipse and InteliJ act as javaagent, they can reload classes).

You can install DCEVM in 2 ways:

  • Patch your existing Java installation.
  • Or install prebuilt version.

See DCEVM - A JRebel free alternative for more info.

Alternatives

If you have more complex programs, you can use:

Also see AgentSmith.

About

Java agent to reload .class files; it uses file watch API available in Java 7+

Resources

License

Stars

Watchers

Forks

Packages