JRebel vs IntelliJ - hot swap - java

I'm looking at getting JRebel licenses for my company.
However I just found out that IntelliJ already has a built in functionality to hot deploy classes.
At the moment we are using Netbeans and Eclispse and I'm wondering instead of buying JRebel licenses if we should just buy IntelliJ.
I tried a trial of IntelliJ (13.0.1) and the hot swap features seems to work fine (using JBoss AS 7.1.1). Only small details it seems that you have to manually compile the class that has been modified for IntelliJ to replace it on the server. JRebel does that automatically.
Now my question is for experienced user of IntelliJ and/or JRebel.
Is it really useful to have JRebel if I already have IntelliJ? Is JRebel better if I'm mostly interested in hot-replacing my classes?
All feedback/experience/advice welcomed.

For an environment like you described (mostly java EE 6 on JBoss 7 or later. Frameworks: JSF, Primefaces) the way to go is definitely JRebel.
Hotswap is capability of JVM, you can find comparison of this with JRebel on their website (http://zeroturnaround.com/software/jrebel/features/comparison-matrix/). So you can use this independently on your IDE.
The main advantage of JRebel is support for various frameworks and their lifecycles - e.g. when you change a bean class jrebel will reinitialize spring bean and all beans which depend on it - with hotswap you would need to redeploy because constructor/initialize method was already run.
I am a happy jrebel and intellij user (also used jrebel with netbeans successfully), no relationship with zero turnaround, angry at them for removing personal dev licenses.

IntelliJ does not have better hot swap than Netbeans or Eclipse, it is simply a matter of JVM. You can try DCEVM integration plugin, which have really good hot swap, in some cases even better than JRebel. But if you need support for frameworks like Spring, JRebel is the way to go. I recommend trying both before buying anything.

Related

What does the support of JRebel for an app (non-IDE) mean?

I have an Eclipse plugin that works as a light host and it is possible to run applications on it. I am trying to improve the development process and thought about using JRebel.
According to what I am reading in the FAQ, the JVM runs happily with JRebel jar as a plugin and any class declared for JRebel is reloaded at change, while the appropriate application jar is running.
So, I "simply" launch the Eclipse or IntelliJ with JRebel plugin for IDE, launch the host in it with JRebel plugin for JVM, install applications in host, launching their jars again with JRebel plugin for JVM, and I happily see the lines of code connected with running jars and classes reloaded at change.
But... Reading JRebel https://zeroturnaround.com/software/jrebel/download/ , along the bottom of the page I can see servers and other applications supported by JRebel.
I understand the need of support for IDEs, for JRebel must connect the lines of the source code, as I see them in IDE with the byte code, running in JVM. OK.
But what does it mean - server or other app supported by JRebel? If any jar can be run in JVM using JRebel jar as a plugin, as they explain in FAQ, where is the need for some special support? In other words, in what sense an application can be unsupported? In yet other words, our plugin and applications are not supported?
The core of JRebel enables classes to be reloaded so you see results as if you restarted the application. This includes accessing class info via reflection and other JDK tools that operate on class metadata.
As this hints, the main problem with only doing class reloading is that almost everything is caching intermediate results and computing some information only at the start of the application. Assuming a class or framework configuration file does not change at runtime is usually a good one.
For this reason, JRebel must provide additional integration to preserve the illusion of class reloading as most applications these days depend on a large number of libraries, application servers and frameworks. For example, a spring application would scan for components and do wiring of beans only on startup. A simple class reload isn't enough and the additional integration must therefore re-scan and re-wire beans if needed.
However there are also a lot of libraries that don't need additional support. The term supported means that a specific server or framework has the required integration and has integration tests running daily. If any library or framework is not listed, it means it's untested or requires no additional integration.
As a side note, JRebel works on compiled class files so an IDE doesn't need support aside from the debugger. Anyone can develop java with vim and use JRebel just fine for example.

How can i hot-deploy my Java project?

I work in a team of Java developers. We write the code in Eclipse, and then we use maven to build the war. Afterwards we deploy the war in Tomcat.
Is there a free way to autodeploy files on save ?
Thanks.
JRebel gives you exactly that: auto-deploy files on save, using Eclipse AND Tomcat, but you do have to pay for it.
I recommend JRebel, but a quick glance around for free alternatives brings up this SO question, where someone suggested the Dynamic Code Evolution VM as a similar product.
There is a good article on the different ways to hot-deploy Java web apps here, which also details some of the other approaches already mentioned.
If you want to deploy for testing purpose on your developer machine, you should use the Tomcat Maven Plugin or, better the Maven Jetty Plugin (it's better because it's lighter and faster).
If you want to deploy it on a remote server, say at every commit on your SCM you must use Contiuous Integration tools like, for example, Jenkins or Apache Continuum.
If you have your class files, you could put them in WEB-INF/classes. Is that what you were looking for?
You can use the maven jetty plugin
Don't build with maven, use exploded deployment, so that static UI files and JSPs could be picked up automatically by the container. For reloading changes to classfiles, you can run the application in debug session and use hotswap (which allows you only the changes to method bodies) or overcome your demand for free software and buy yourself a JRebel license, which can be used for free on non-commercial projects (http://social.jrebel.com)

Eclipse plugins for Seam Development

i just wanna ask what plugins for Eclips etc people use when they develop a Seam Application.
The once we use are:
JRebel (Couldn't live without it, extreamly nice)
Subclips
M2
JAutoDoc
JbossTools
//Trind
I've used "plain" Eclipse with the JBossTools plugin, and I've also used JBoss Developer Studio. Pretty much the same experience either way.

What is the current state of tooling for Scala?

Over the past year, I've heard an increasing amount of hype regarding the Scala language. I know that there are several existing projects that have plans to integrate Scala support with IDEs; however, it isn't always clear how good the integration really is.
Do they currently support Intellisense as well as Eclipse and Netbeans do for the Java language? Do they support instant verification as well?
I can't personally speak to the stability of the IntelliJ or NetBeans plugins (though I have heard good things), but the Scala IDE for Eclipse just recently made a new release with Scala 2.7.4. Architecturally, this release is quite different from the previous ones in that it uses Equinox Aspects, the officially supported mechanism for extending JDT (and other cross-plugin extensions). Whereas before the Scala plugin had to literally hack into the JDT internals using private APIs and reflection to trick the system into behaving properly, now it is able to simply declare its extension points and let the system do the rest. It's hard to even describe how much more stable this makes things. I'm not saying that it's all sunshine and roses yet, but if you've tried and rejected the plugin in the past (as I had), it's time to give it another look.
As for how it stacks up feature-wise, SDT doesn't have any refactoring support (IntelliJ has some basic stuff like "Rename"), nor does the editor do some things like "Mark Occurrences". However, it has a significantly better Outline than NetBeans, better compiler support than IDEA, and very good semantic highlighting. All three plugins support content assist (or "intellisense", as Microsoft calls it), but none of them are particularly reliable in this area just yet. The Scala IDE for Eclipse is the only one to support incremental compilation (alla Eclipse's Java tooling).
My advice: shop around. Try all three and see which one works the best for you. From what I've been hearing, the Scala IDE for Eclipse has leap-frogged the competition with its latest release, but the others have shown such consistent stability and steady advancement that you can't count them out just yet.
Here's a similar question:
Which is the best IDE for Scala development?
In my very short experience with the Scala IDE for Eclipse and the Scala Plugin for Netbeans, it seemed like the Netbeans plug-in was a little more solid than the Eclipse one.
With the Scala IDE for Eclipse I was having problems with running a Hello World-type Scala object, and sometimes the syntax highlighting would start acting up. Then, I tried out the Netbeans plug-in, and it seemed to be more functional than the Eclipse one.
I haven't used either Scala IDE plug-in much in-depth, so I can't speak out of a lot of experience, but just from my initial impression, the Netbeans plug-in seemed a little bit more stable than the Eclipse one.
Currently, all three main IDEs are at roughly the same level of support.
IntelliJ - the plugin has fits of not working at all, but is otherwise quite good. The underlying platform is sluggish (at least in linux) since v8.
Eclipse - the plugin is receiving a lot of support and is under very active development.
NetBeans - IMHO, the plugin works a little better than the Eclipse one, but not being able to run arbitrary files is a major downer.
All of the above suffer from being unable to parse the AST in all contexts. It is quite easy to confuse them by mixing in traits with implicit defs, for example. No IDE can be trusted when it advises of a syntax error. Fall back to the compiler to be certain.
I'm quite happy using IntelliJ IDEA 8.1 and its Scala plugin and can recommend it. It even has a roadmap that you can influence by voting your favorite missing features :) I don't have experience with the Scala support of the other IDE's, unfortunately.
I'm using the Eclipse Scala plugin. Its pretty good but not at the same level as the Java tooling.
AS for intelliJ, no idea.
But between Eclipse and Netbeans, I must say Netbeans especially if you are not willing trade maven for sbt and you want an IDE that does not get in the way of maven.
Netbeans maven support is just way too good.
The Netbeans scala editor seems to work quite nicely as well.
I care not for the integrated scala development kit in netbeans or the compiler plugin, or any such helpers. From netbeans I expect only tthree things:
(a) Do not get in the way of maven and let maven run my build
(b) Give me a decent editor
(c) Let me drill down from my .scala files into the source code of the libraries referred by my maven dependencies.
And Netebeans is able to deliver all three quite well, I belive, even if at times it feels a bit too slow.
What I can say is that
(1) You do not run into any compilation issues since the task is up to maven.
The maven compiler plugin is a bit too slow. But compiling scala vs java is always like that, painful. Still if you've tried GWT compiling java to javascript is more painful even.
(2) Netbeans figures out the source code to you maven dependencies flawlessly and you can drill in into the most obscure sacala operators, such as the CSS mappers of lift.
As for eclipse, eclipse maven integration has always been nasty.
Netbeans maven integration can turn very sour if you have a big project with too many dependencies and modules. Then the check for external changes done by netbeans is just horribly slow. That is the downside of netbeans.
However, if you are and SBT fan ... well, maybe then answer might be something else.
But for me, since maven has become the thing it is today, I never want to go back again to those "web application project", "library project" etc... wizard like options that you have when you create a new project in the IDE.
I simply want "maven project", and please figure out what my output artefact is by reading the pom.

What do I need to write Java-based web applications and test them on my personal computer?

I currently have Apache HTTP Server, but I'm guessing I'll need Tomcat (and then have to configure it in a way that makes it not open to the public), a Java JDK (which I already have, but should probably update), and an IDE (I have Eclipse). But what else should I have or know before starting?
Lets see... you'll need:
A JDK. Preferably the Standard Edition, unless you plan on using GlassFish as a J2EE server. If you do use the standard edition, you need to include the jars from your servlet container/J2EE stack to access J2EE libraries.
A Servlet container. Apache Tomcat is a popular one, and Eclipse already has integration support for it. Keep in mind that Tomcat is not a complete J2EE stack... you need something like JBoss Application Server or Apache Geronimo for that.
(Semi-Optional) A web server. Apache Web Server surprisingly works well with Apache Tomcat or Apache Geronimo... it's almost like they were made by the same people! Eclipse has built-in support for Tomcat and doesn't appear to require a web server because of it. I could be wrong, though.
(Optional) An IDE. If you use Eclipse, get the version for Java EE Developers.
(Optional) A Database. MySQL and HSQLDB are popular ones for Java, at least for small to medium applications. Keep in mind that you also need to download the JDBC drivers for your database.
(Optional) A revision control system. Even on a single-developer project, a revision control system can save your hide if you accidentally remove code or a file that you shouldn't. There are several choices here; Subversion is my personal choice, along with an Eclipse plugin for it, such as Subclipse.
I'd recommend having a database server installed as well- you can go pretty far with the various pure Java implementations, but anything significant will probably benefit from having a copy of MySQL around.
I'd also get some sort of version control going- tortoiseSVN works really well for windows. Even if you're just goofing around for yourself, getting in the habit of using it will save time and heartache down the road.
If you're trying to stay pretty simple you have everything you need; a servlet container.
The IDE of course helps.
I would recommend Eclipse's Web tools project as it will allow you to code, and then hit a button that will put that code on tomcat all from the IDE.
http://www.eclipse.org/webtools/
As Bogdan mentioned maven is a dependency management tool but depending on your level of comfort I'm not sure if you want to muddy the water with that yet.
Another project that uses Maven is appfuse (http://appfuse.org/display/APF/Home) and will help you get off the ground quickly for generating a webapp. It will give you a webapp, a database, unit tests, dependency management, and a good skeleton to structure your project off of.
So, if you're just wanting to play around with some .jsps and a servlet or two I would stick with the IDE, but if you're comfortable with web applications, MVC, and build tools I'd recommend appfuse.
That's all you need from the tools.
Then, you need to google some tutorial on using servlets and jsp pages. Even documentation bundled with tomcat is good enough.
You'll probably also want a database like MySQL or HSQLDB. You could replace Tomcat with Jetty which is often easier to get class changes to reload without restarting the server.
You can do everything from within NetBeans if you're willing to switch IDEs (it's a relatively painless switch, but you might be able to create a similar setup in Eclipse). There's a Tomcat plugin for NetBeans that allows you to create, edit, run, and debug servlet and JSP web apps all from within NetBeans. There's a starter tutorial here. When you install the Tomcat plugin, you get lots of good example servlets and JSPs as a bonus.
I would go for maven.
It will give you a quick start in configuring your project (by using archetypes) and it will manage your dependencies.
Install it and run the archetype command to create your project.
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp
After that just use the maven eclipse plugin to configure your eclipse environment for that project (http://maven.apache.org/plugins/maven-eclipse-plugin/).
I currently have Apache HTTP Server, but I'm guessing I'll need Tomcat (and then have to configure it in a way that makes it not open to the public)
For simple Java based web applications, you need not have Apache installed unless you are too concerned about performance and want to gain by letting Apache serve static resources.
But what else should I have or know before starting?
A good IDE is most recommended, otherwise the development will become painful. Use a simple database as people have already suggested. I would go with MySQL because its neither too complex for a webapp nor too trivial.
Instead of Tomcat I recommend Jetty, that is also a Servlet-Container. In my experience it's easier to setup and maintain. Good enough to test your application.
Other than that you need a JDK (naturally). A database is optional, but if your web-app wants to save data it's the best option.
Step 1:you need to have J2EE installed in your system if not download it from http://www.oracle.com/technetwork/java/javaee/downloads/index.html here.
Step 2: Should have Apache TomCat server to run your web project on your system locally(local Server).
installation steps https://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html go to this website.
Step 3:set Class path for java JRE.

Categories