Showing posts with label IDE. Show all posts
Showing posts with label IDE. Show all posts

Friday, 19 August 2011

Another way to be portable - part II

So, NetBeans stack (with servers) portable through DropBox - sounds quite possible. After all PortableApps can be used this way. But what's to consider first? Here's the list (it's not long at all):
  • Will the free account's box size suffice? Yes, it will, even for a full install (with the two app servers). And I guess there'll be a little bit more space for some small projects, etc.
  • What if utilize multiple platforms (Windows at work, Linux at home, and Mac on the move)? Well fortunately the IDE still has the "OS independent Zip" on the download page, but as you can see there, this option comes without the servers. The servers are completely different story, for another post.
  • And should I put the JDK also in the DropBox? If so, should it also be platform independent? Hm, friend, this is Java you know! And I think, we've already been through this :)
Maybe these are all of the preliminary considerations, so I dive in ....

Downloaded the OS independent ZIP for the latest (currently 7.0.1) version (242 MB archived, and around 470 MB extracted to a DropBox sub-folder). With my connection, it uploaded to the central server for around half an hour.
For further examinations lets name the path to the DropBox folder as DB. So if the IDE is extracted to DB/netbeans, the adventure starts from the DB/netbeans/bin folder (I believe you can easily figure out the corresponding Windows paths). In this folder there are only two files - the executables for the two major platforms. Since the IDE is configured by default to search for the java installation existing on the system, if such exists, the IDE will run. If only JRE is installed, it might run, but it surely won't compile your projects and it will complain about it. Of course, the access to a java installation can be configured, but I don't think there is a point in repeating myself. Everything said in that post still applies.
I would only add that if you use a portable JDK, you might tweak it, to make it slimmer. This means that bin, jre and lib folders will suffice. Another detail is that you might have to gather the executable files from different platforms in their corresponding sub-folders in order to be fully portable. Actually it is all a matter of taste and context. All environments that I have DropBox on are Linux, so I don't need portable JDK. In that case I only have to take care that on every environment I use compatible JDKs. For example if on Env1 I have installed JDK 1.7, the Env2 which has by default (from repositories) JDK 1.6 the projects might become in conflicted state. This might not happen for different updates of the same version of the JDK, but for a different versions of used application servers the conflict is certain. So the journey continues.

I don't know how close, but this installment looks to me similar to an IDE on the cloud. I accept every suggestion that might reduce the distance between the reality and the idea.

Sunday, 24 July 2011

Enterprise Java 6 with NetBeans 7 narrated

I already published two almost identical reviews at Developer Zone and Amazon. I feel it is clear what are the purpose and the structure of Java EE 6 Development with NetBeans 7. The reasons for why I like it are not just that I needed such reference for a long time and it finally showed up. I liked it because it is straight to the point. Promptly teaches you what you need to do, with further details where possible and reveals the technology gradually and remarkably fully for the given small amount of pages.
So in the sake of diversity, completeness and to give the book the coverage it deserves, I'll pay a bit more attention to its contents.

The introductory chapters
The first three chapters might be considered as legacy. I mean, they are there in favor of the complete beginners. On the other hand most of the functions represented here can be found in the same or similar form through the previous versions of the IDE. Those are the features that define the NetBeans way - the keys for simplicity, speed and robustness during your development process.
First we're introduced with the IDE. From installing it to adding and managing application and database servers - it is all a fundamental knowledge. Even if you only create desktop applications the chances are rather small, that you'll never have to work with database. This knowledge is just a must precondition.
After that a similar thing is done for Java EE and how it is backed by the IDE. If the reader is not a bit more familiar with Servlets, JSPs, configuring the security, etc. this introduction can't be enough. Here you'll see presented the ready templates and configuration-tweaking editors that require such basic knowledge.
Finally we're given the tag palettes. They are organised around the forms in the applications' pages. NetBeans gives us automation for the HTML tags that require most effort when written by hand, and for some of the JSTL tags.
The nicest example I found here is a small tutorial on how to create custom JSP tags - sometimes the wide JSTL extension over HTML still might not be enough functional or flexible.

The basics of the Enterprise Java
In the following two chapters we meet the newer wave in the Java EE history - the Java Sever Faces (JSF) framework over the core Servelt and JSP APIs and a complementary component library - PrimeFaces.
Since every chapter in the book can be taken as a separate tutorial for creating a certain technology-centered throw-away application, these two chapters are visually oriented. In terms of the MVC design pattern here we're shown how to create the View. The JSF API is backed up by lots of wizards - managed beans, facelets, components, etc. Do you think this is enough? Well, NetBeans don't. They provide the PrimeFaces components integration, so with the help of fast code-completion very decently looking pages can be built that could have tabbed layout, or to behave like wizards. Of course I wish there was at least a plugin that could bring the tags in their own palette, but I guess this integration is in an early stage.

The core innovations to Java EE 6
In the previous version of the SDK, the Enterprise Java Beans (EJB) API consisted of three types of Enterprise Beans - entity beans, session beans and message-driven beans. With the API's evolution, the first ones were extracted to their own specification comprising the Java Persistence API (JPA). Another new feature covered is the Contexts and Dependency Injection (CDI) - long awaited, after all it is one of the things that made the Spring framework so famous.
To the Enterprise Beans and CDI's integration are dedicated the next four chapters of the book. The one for JPA is my favorite tutorial, because it shows not only the power of the IDE to automate the creation of data components. It gives a whole MVC application - JSF application extracted from the paired database. The rest of these chapters concentrate on the business tire in an enterprise application. We see how easily can be created modules and clients, message resources, qualifiers and stereotypes. Everything is there after a few clicks in the file wizard, smartly coded templates ready for customization.

Java EE 6 and the Open Web
The web services are left for the last two chapters. The classic SOAP services, using heavy XML for data transfer versus the modern RESTful services that utilize the lighter JSON data format. Both are equally and very well covered. To the point that NetBeans has a nice graphical editor for configuring the parameters of a service.
As examples we can see a SOAP web service created from existing EJB module and from ready WSDL file, and RESTful web service created from existing database. The last one also has a client created for it.

The Appendixes
I cannot imagine developing some application without debugging some of its trickier methods at a point. Doing it for an enterprise application is generally a bit more difficult, regarding the external execution environment - the server. NetBeans proves such difficulty does not exist.
I must admit that the Profiler is the NetBeans's prominent performance tool that I never had a chance to use in working conditions. Yet having it in the IDE for such a long time (if memory doesn't fool me, after version 5.5 it became integrated, instead of being a separate plugin) is a persuasive argument towards its quality.

Like I said in the external reviews, code templates customization and the possibility for adding custom palettes, deserved at least another appendix, but after all this is a Java-EE-6-centric book, and NetBeans is just the tool. Anyway, I personally like very much the way this book gives credit to the IDE, to its grade of integration with the SDK. The plethora of examples might comprise only to throw-away applications, but they are so technology-aware that throwing-away option easily might be transformed to merging-and-extending option. Have fun!


Saturday, 22 March 2008

Portable NetBeans

The hype of portability is still fresh and as the pile of available applications grows bigger and bigger providing you with a digital personality on an USB disk just in your pocket, a question arises:
"If I can carry anywhere my own browser, my office suite and my data, is it possible to make my flash drive a development environment?"
Of course you can. It is extremely easy. There are some limitations, mostly concerning performance (the transfer speed of a flash memory sometimes is an issue) or system privileges on public computers, but such obstacles are negligible.


In case your favorite development tool is NetBeans and you still haven't figured out how to put it on your portable disk, read on. For the environment will be needed at least 1 GB big drive for a standard installation. Two downloads are required - the latest JDK and the latest NetBeans IDE.

1. Prepare the environment
There are two ways to make the standard Java Development Kit from SUN Microsystems (the latest version as of the time of writing is JDK 1.6.0 Update 3) available from the portable device - to copy it from installation directory or to make a fresh install. Both cases are equally easy:
  • Copying the JDK folder (usually stored on C:\Program Files\Java\ in Windows) somewhere on the USB file system takes only minute or two. Of course, if there are defined some system variables (such as JAVA_HOME, JRE_HOME, etc.) they won't be useful anymore (on other PC).
  • Installing the development kit from scratch is a good decision. Just point the installer a path on your USB ('X:\tools\' for example).
All additional packages you might use (JavaDB, SwingX, etc.) can be installed the same way.

2. The IDE
The latest stable version of NetBeans is 6.0.1 and there is a Beta 1 version available for testing of the newest release 6.1. We'll point out some of the cool new features of the IDE a bit later. As for the installation - there is no difference which version you choose. From version 6 NetBeans has very nice and comfortable new installer. Customizing what to have in the IDE is a matter of personal choice and needs. If you bought a fast drive with good access speed, then you might try to install even the application server (Glassfish) an run it from the USB (with the quite bearable maximum of 480 Mbit/s for the hi-speed mode of the 2.0 standard). That would be quite an adventure on a bit older architecture - the 1.1 USB standard provides up to 12 Mbit/s speeds.
Anyway, running portable NetBeans on top of portable Java (even the fast 1.6 version) will generally appear slower than the natively installed ones on the host system. But actually that's the worst news about this (may I call it) portable platform. Portability itself is an enormous advantage.
So let's go through the installer of the latest beta version - I'll use the variant with all packs.
The first page of the wizard gives you the opportunity to customize your IDE. Let's see what's in there:
  • Base IDE (requires 58.3 MB) - only this choice isn't really optional. This is the absolute minimum installation and actually it is the platform.
  • Java SE (takes up to 112.6 MB) - this is the essence of the standard Java IDE.
  • Web and Java EE (takes up to 214.5 MB - it requires not only the Base IDE but also the Java SE module) - this module completes NetBeans as an Enterprise Java development tool.
  • Mobility (takes up to 209.5 MB - it also requires the Java SE module) - this module contains the Wireless tollkits of the mobile edition of Java.
  • UML (takes up to 147.6 MB - it also requires the Java SE module) - this module makes NetBeans very powerful application for UML modeling and reverse engineering of source code.
  • SOA (it requires the large amount of 339.7 MB because it depends not only on the Web & Java EE package but also on the both GlassFish end OpenESB runtimes) - the addition for Service Oriented Architecture is an extension of the Web & Enterprise edition of Java.
  • Ruby (occupies 90.2 MB) - a module that gives the Ruby developers a powerful tool for their needs.
  • C/C++ (fills 69.9 MB on the drive) - this module makes the IDE suitable for programming in the powerful languages from the C family. But it does not include the compilers, linkers, etc. - you still have to install your preferred ones on your own as is explained here.
There are three additional runtimes that are a must for some of the development purposes. They might be installed on their own and don't need the Base IDE package:
  • GalssFish V2 UR1 (requires 83.5 MB) - the Open Source variant of the SUN Microsystem's application server (the former SUN Application Server).
  • Apache Tomcat 6.0.16 (a thin application server that takes only 10.4 MB on the drive) - a lightweight web application server from the Apache Software Foundation.
  • Open ESB V2 Preview 4 (takes up to 101.9 MB) - only this runtime cannot be installed on its own because it runs in the context of the GlassFish application server. This is an implementation of an architecture for easier web services integration.
As you may noticed there can be installed several different development environments for various needs. There are Java and Java Web/Enterprise IDE, IDE for mobile Java development, application for UML modelling, Ruby IDE and C/C++ IDE.
A full installation requires about 530 MB and that's without the JDK.
If you choose to install everything after you accept the terms of the License Agreement three screens follow that let you:
  • Provide folder where the application will be installed (that should be on your portable drive) and the folder where the Java Runtime is (where we put it on the previous step).
  • Provide the information for the installation of the GlassFish application server - folder, administrative account, etc.
  • Provide folder where the Apache Tomcat server you want to be installed.
A confirmation page with choices made and Install button follows. Just press it and few minutes later you'll be able to import your projects and libraries and start code on whatever Windows system chance takes you.

Tuesday, 19 February 2008

At last iReport for/in NetBeans!

Two of my favorite Open Source projects finally met.
Few years ago JasperReports became de facto number one open source reports engine according to its popularity. Of course JarperReports wouldn't get such wide-spread acceptance without the
graphical designer iReport (an independent project at first; later they became one joined by JasperSoft). Although a powerful tool for quickly setting professionally looking reports, iReport lacked some robustness in the user interface. Sometimes using it for few hours, building heavy reports with lots of fields, text boxes, etc. made it slow and even unresponsive. As we can see now a decision for that issue had been sought. And what is better than a proven IDE platform?
The guys from JasperForge have been playing around with the most popular IDE platforms (at least for two I know - eclipse and NetBeans) and made a choice. Now there are plug-ins for the both of the platforms (the one for eclipse was the first one and instructions for installing it in the eclipse IDE are packed within the installation bundle). Nevertheless the final decision
was in favor of NetBeans. Not only there is a plug-in (an NBM file) for the platform, and not only there is a preview version of iReport built upon the platform, but there is the road-map.
It says that the project is moving completely. Two or three weeks ago JasperSoft were the presented featured partner on the NetBeans site.

The wait still continues. The new project is in a little more than a preview state. It is stable enough and reports can be made easily (the NetBeans style - something a bit odd for people who are used to iReport's way of doing things) but still there are some important functionalities that are missing (the chart tool for example). The current version is 0.9 and they promise that in the summer there gonna be a rejoin between the version numbers (now the old-fashioned iReport's version replies to the JasperReport's one).

So, big thumbs up for that pleasant and powerful union and hope the result will deserve the applause.