Tag Archives: eclipse

Automatically start JavaDB process in Eclipse

In my previous post I’ve mentioned that NetBeans IDE starts a background process with Derby every time when it is required during Glassfish startup. You can have a similar thing in Eclipse. After installing Glassfish AS Adapter for Eclipse, go to Window>Preferences>GlassFish preferences (or type “glass” in filter box), check “Start the JavaDB database process when Starting GlassFish server” and voila!

24 easy steps to JEE 6 development with Eclipse

As some of you probably know I have a privilege to teach Java related stuff at Poznań University of Technology. During the lab sessions which I am leading we were going through configuration of Eclipse IDE to work with JEE 6. I am using Eclipse since I started to write in Java, some things are obvious for me. We wanted to work with Glassfish, Apache Maven and Subversion which are quite common tools, so it should be quite simple to force Eclipse to work with this setup. Let’s start.

  1. Download Eclipse IDE for Java EE Developers
  2. Unpack and run
  3. Now, I will have to install m2eclipse, I would like to use Eclipse Marketplace because it does not require knowledge about update sites for plugins. So, I choose “Help” and than “Eclipse Marketplace”.
  4. I am searching for m2eclipse… ok, there is something with Install button here [click].
  5. Accept the license agreement
  6. Confirm that I want to install unsigned jars
  7. Installation was sucessful, Eclipse is asking if I want to restart IDE – “ok, if you have to”.
  8. I know that I need also m2eclipse-extras for integration with Eclipse Web Tools Platform.
  9. I am choosing Eclipse Marketplace and searching for m2eclipse-extras – without luck.
  10. It seems that I need an update site for this. From Help menu I am choosing “Install new software”
  11. Starting to work with new Update Site for m2eclipse-extras
  12. I need to choose out of 4 bundles from that site. I cannot click “select all” because I don’t have Sublipse plugin installed, anyway who is using SVN nowadays? 😉
  13. After choosing right bundles it is time to accept license agreement
  14. Once again I need to confirm that I want to install unsigned jars
  15. Installation was sucessful, Eclipse is asking if I want to restart IDE – “ok, if you have to”.
  16. It is high time to import my project into workspace, choose File>Import>Import existing Maven project (but who knows maybe “Import existing project” would also work ;-))
  17. At this stage m2eclipse shows warning that my Eclipse is running on JRE not JDK and this may cause some problems
  18. To correct this I have to edit eclipse.ini and add “-vm” parameter with path to JDK (in separate lines – but everyone knows how .ini file works)
  19. Ok, now it is time for Glassfish, I choose Window>Preferences>Server Runtime and click on Add button
  20. There is no Glassfish here, so I choose to download additional server adapters.
  21. Ok, now I can choose out of four different Glassfish types (finally I will choose appropriate).
  22. During creation of new server runtime, I have to remember to point to glassfish-3.1/glassfish, (base glassfish-3.1 directory is not enough).
  23. After creation of new adapter, it should be possible to run imported application using Glassfish. It should be but…
  24. Eclipse says that in order to run Glassfish I need JDK – what the heck, I’ve just changed my eclipse.ini. Someone told me that I have to define new “Installed JRE” which is pointing to my JDK installation.

Only 24 easy steps – great!  😉

I’m not a huge fan of NetBeans but please take a look how NetBeans IDE deals with this issue.

  1. Download NetBeans (with Glassfish)
  2. Run NetBeans and Glassfish installer
  3. Run NetBeans IDE
  4. From File menu choose Open project
  5. From Tools menu choose Servers, ensure that Glassfish is in place. (This step is unfortunately necessary :(, without this NetBeans claims that there is no Glassfish defined – you just have to open dialog window, nothing more).
  6. Run Project

NetBeans will even launch Derby network server on its own if you use this DB in your project. I do not have nothing against Eclipse puzzles but it seems that it simply works!

I know why all this have to be done with Eclipse, but the question is who will bother with this if he can just launch Visual Studio 😉. In fact it is just a matter of reasonable defaults, is it really so hard? Maybe JEE is too new to get proper support in Eclipse?