JavaRebel

From Lift

Jump to: navigation, search

Contents

JavaRebel

Download JavaRebel

  • Download JavaRebel
  • place javarebel.jar in your home directory
  • If you are using the demo license, i.e. no license, it will expire after 21 days - if you want to continue using JavaRebel with your Scala projects, get the free JavaRebel for Scala license and put it into the directory which contains javarebel.jar.

Jetty

You can also use JavaRebel with Jetty.

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. Jetty's internal reloading won't keep your session after reloading changed classes. <scanIntervalSeconds>0</scanIntervalSeconds>

Start jetty with the maven jetty plugin and the MAVEN_OPTS parameter set

MAVEN_OPTS="-noverify -javaagent:~/javarebel.jar" mvn jetty:run

Run mvn compile in another terminal and JavaRebel will reload your changed classes.

Tomcat

One can develop lift applications using JavaRebel and Tomcat.

  • Create your lift project
  • Do mvn install
  • cd src/main/webapp/WEB-INF/lib/
  • cp ../../../../../target/myapp-0.1.0/WEB-INF/lib/*.jar .
  • cd ../classes/
  • ln -s ../../../../../target/classes/bootstrap bootstrap
  • ln -s ../../../../../target/classes/com com
  • in tomcat/conf/Catalina/localhost create a file named projname.xml with the following contents:

<Context docBase="absolute_path_to_project/src/main/webapp" path="/projname" reloadable="false" allowLinking="true"/>

  • place the following script called rebelrun.sh in your tomcat/bin directory:
#!/bin/sh

export JAVA_OPTS="-noverify -javaagent:~/javarebel.jar $JAVA_OPTS"
./startup.sh

  • This can be done easier "mvn war:exploded", all others steps are similar
  • For windows tomcat service copy javarebel.jar to tomcat/shared/lib and specify in Tomcat Service Launcher\Java these properties "-Xverify:none -javaagent:shared\lib\javarebel.jar"
Personal tools