DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Tools
  4. Using JRebel with IntelliJ IDEA on OS X

Using JRebel with IntelliJ IDEA on OS X

Matt Raible user avatar by
Matt Raible
·
Feb. 03, 10 · Interview
Like (0)
Save
Tweet
Share
10.38K Views

Join the DZone community and get the full member experience.

Join For Free

yesterday afternoon, i figured out how to use jrebel with intellij idea. i wrote up some appfuse documentation for it at using jrebel with intellij idea and figured i'd repost it here for those developers using idea 9 and maven.

  1. download and install intellij idea 9 ultimate edition (in /applications on os x).
  2. download and install jrebel.
    1. java -jar jrebel-setup.jar
    2. install the jrebel plugin for idea . shortcut: file > settings > search for plugins and find jrebel.
  3. on os x, modify /etc/launchd.conf and add the following so m2_home is available to gui apps. you'll need to reboot after making this change.
    setenv m2_home /opt/tools/maven2

    more info on this setting is available on stack overflow .

  4. modify your project's pom.xml to include the jrebel maven plugin (for generating the configuration of which directories and files to watch for changes).
    <plugin>
    <groupid>org.zeroturnaround</groupid>
    <artifactid>javarebel-maven-plugin</artifactid>
    <version>1.0.5</version>
    <executions>
    <execution>
    <id>generate-rebel-xml</id>
    <phase>process-resources</phase>
    <goals>
    <goal>generate</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
  5. if you're using the maven jetty plugin , change your pom.xml so jetty doesn't reload the app when classes are compiled. specifically, change scanintervalseconds to 0. if you're not using this plugin, you should definitely check it out for java webapp development.
  6. use the jrebel icons to start jetty:run in your ide. jrebel with intellij idea
  7. command line integration: set a jrebel_home environment variable that points to your jrebel install (/applications/zeroturnaround/jrebel on os x) and set your maven_opts to use jrebel's settings. for example:
    export java_opts="-xmx512m -xx:permsize=256m -xx:maxpermsize=512m -djava.awt.headless=true"
    export jrebel_home=/applications/zeroturnaround/jrebel
    export maven_opts="$java_opts -noverify -javaagent:$jrebel_home/jrebel.jar"

after making these changes, you should able to compile classes in idea and refresh your browser. log messages like the following should show up in your console.

jrebel: reloading class 'org.appfuse.webapp.action.useraction'.

to simplify things further, you can map command+s to compile (instead of shift+f9). just look for keymaps in settings, rename the default one and search for compile to remap.

i'm assuming the steps to make things work on windows and linux are similar. please let me know if you have any issues with these instructions.

from http://raibledesigns.com/rd/entry/using_jrebel_with_intellij_idea

intellij

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Introduction to Spring Cloud Kubernetes
  • Solving the Kubernetes Security Puzzle
  • mTLS Everywere
  • Stop Using Spring Profiles Per Environment

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: