Wednesday 27 August 2014

How to quickly make eclipse faster

Once we start working on eclipse, it gradually becomes slower. To improve the performance and make eclipse faster, there are certain ways which you can utilize and see noticeable differences. These effective method are listed below:
1) Clean up history and indexes
2) Remove structured text validation
3) Do not use subclipse plugin
4) Configure appropriate start-up arguments
Let’s understand them in detail one by one:

1) Clean up history and indexes

Cleaning up history and indexes reduce the load on RAM, and overall HDD usage as well. This result in very high impact on performance. To remove the indexes and history folders, please cleanup all files/folders inside these two folders:
For cleaning up indexes
{workspace path}\.metadata\.plugins\org.eclipse.jdt.core
For cleaning up history
{workspace path}\.metadata\.plugins\org.eclipse.core.resources\.history
Here {workspace path} is the path of eclipse workspace where you create all projects.

How to improve eclipse performance

1. Remove unwanted activation of some of the plugins at start-up by going to windows-->preference-->General-->Startup and shutdown.
Also make sure you don't use those plugins in any of your views


2. Eclipse is not a word processor. Better to disable the spell check. Disabling spell check will reduce the eclipse burden by going to Windows-->Preference-->General-->Editors
--> Text Editors-->Spelling

3. When eclipse builds the project, it will delete all output folders and rebuild classes built by other compilers. We can disable such features, as deleting the output folders and rebuilding will take sometime. Goto Windows-->Preference-->Java-->Compiler-->Building


4. Disabling label decorations which is of less use for you, will also help you to gain some performance . Goto Windows-->Preference-->General-->Appearance-->Label
Decorations


5. Close unwanted projects and use working set option to move from one group of
project to another smoothly.


7. You could also disable Eclipse automatic building, if it is not needed for you.
Goto Project-->Build Automatically (uncheck it)


8. Do not keep lot of tabs opened in the editor. Better to have around 20 tabs .
Regularly close the unused tabs. To open resource we can always use ctrl+shift+R and
ctrl+shift+T (java resource) instead of opening lot of tabs

9. Disable unwanted plugins. Full J2EE eclipse version has an option to disable/uninstall plugins. Goto Help-->Software Updates-->Manage Configuration. Right click on any installed plugin to get disable option. If this option is not available then enable Classic Update by going to Windows-->Preference-->Capabilty and check classic update. Now the manage configuration option should be available in help menu

improve performance of eclipse

I have seen many programmers who use Eclipse on variety of different languages and platforms.A lot of people do not know that Eclipse is a multi language general-purpose platform. Eclipse does much more than any Java IDE can do. It's also commonly used as an application framework, and as development platform for popular languages like PHP, C/C++, Perl, Ruby, Python and shell scripting.Eclipse has a large plugin repository with really powerful set of plugins. This ensures that your eclipse setup has minimum plugins required. For example:
  • Keep a separate eclipse install for all your android projects.
  • Keep a separate eclipse install for JEE Web Projects.
  • Keep a separate eclipse install for Google App Engine Projects.
  • Keep a separate eclipse install for Spring Tool Suite related projects
  • Keep a separate eclipse install for each of the different language projects e.g Ruby, Python etc
Eclipse.ini Tweaks

What is eclipse.ini ?

This file controls the eclipse startup options. You can change make many changes in this file based on your needs to apply settings on launch of eclipse. This is a plain text file containing many command-line options that are appended to the Eclipse startup command.

Backup eclipse.ini before editing it

Before you jump on to editing this file, please make sure to take a backup of the original file just to ensure that in case of any issues you may want to revert back to the original file.

Where can I find eclipse.ini file?

The location of eclipse.ini varies based on operating systems and is a followsOn Windows/Linux : eclipse.ini is located in your Eclipse installation directory. It should in the same directory as your eclipse.exe (on Windows) or eclipse binary (on Linux) is located.On Mac OS: Eclipse.app/Contents/MacOS (This may not show up on finder, so go on terminal and go inside the directory where you extracted eclipse zip file).

Increase The Heap Size Available To Eclipse

:As you may already know that eclipse is a java program and providing it more heap memory is going to help it cache and speed up. You can increase the heap size by updating the entry for option -Xmx to some higher number in eclipse.ini (e.g. -Xmx2048m)

Disable Java Class Verification:

Add -Xverify:none to your eclipse.ini. - It will reduce the eclipse startup time considerably. This option disables the class file validation while loading. This can be a real performance boost if you are having a large project with many .class files. Memory/Hardware Related Tweaks

 Upgrade your RAM 

Eclipse is a greedy application it can cache more if memory is available. The more RAM you will provide it the better it can perform. You can find a dozens of cheap 

RAM for your machine on AmazonUse RamDisc

Putting the JVM in RAM Disk may improve the performance. RAM Disk is a freely available option on linux systems, however for windows you may want to look for a commercial option ramdisk driver from Qsoft http://members.fortunecity.com/ramdisk/RAMDisk/ramdriv001.htm Make sure to allow additional space to the ramdisk that is 10-20% more than size of JVM.

Upgrade to Solid State Drive (SSD)

Eclipse deals with a lot of small files including source code, compiled files, metadata, local history, svn, etc. And, the type of hard disc you have will impact all the IO actions eclipse performs. You may see a significant performance enhancement if you 

upgrade to an SSD (Solid State Drive) Reboot/Restart your system often

I know this may sound funny. I have a really bad habit of never shutting down my system until it becomes unbearable. Doing occasional restarts within a week is going to keep your system faster. This is more of a general tip that may apply not only to eclipse but to any other software. I have seen my laptops getting really slow if I use the sleep/hibernate modes with them. After the restart everything works great. Disable Unwanted Features Per Project Needs

Close Unwanted Projects

Close any open projects which are not in current use. This may sound trivial, however at times some big projects can really slow down the performance. Closing unwanted projects makes sure that all caching is used for current working project.

Disable Auto Validation

Set all Validations (Preferences > Validation) to 'Manual' - For example, XML validation is one of a very common validations and may cause slowness if many XML files are present in project.

Disable Automatic Build

Automated build are real help doing quick development since its triggered when any file in project changes, however it may take long time based on the size of project. You can turn off this feature and always do the build manually as needed.

Disable Label Decorations

Another performance boost can be gained by disabling label decorations (Windows -> Preferences; General -> Appearance -> Label Decorations) and by disabling unused capabilities on startup (Windows -> Preferences; General -> Startup and Shutdown) JVM Specific Tweaks

Try A Different JVM

Sometime a specific vendor version of JVM may not be performing very well on your operative system. For example, Use Oracle JVM on Ubuntu for faster performance. The default JVM on Ubuntu makes eclipse slow for some reason, try to install the Oracle JVM and you may see a significant performance change.

Garbage Collection Tweaking

You may also get additional performance by choosing a different garbage collection strategy depending on your JVM. This may be used as a last option, however I do not really recommend it. You may want to really

 understand garbage collection tuning

 well before you can get some good results. Notthing Seems to Work?In case, you have tried all of these options and nothing seems to work you may want to make sure that your system is not affected with some kind of virus, malware or adware. Run some anti-virus and cleanup software to make sure.

Eclipse plugins for performance improve

Code Quality Plugins


FindBugs

FindBugs plug-in is used with eclipse IDE and it is the software used to find bugs in Java programs. It’s free software licensed under Lesser GNU Public License. This is one of the most popular eclipse plugins and also available on Maven, Netbeans and IntelliJ.

Checkstyle

Checkstyle plug-ins can be integrated to IDE Eclipse and it ensures the Java code follows the coding standards.


ECLemma

ECLemma is a free tool available through Eclipse Public License and it provides fast development and test cycles. You can use “launch” in the code coverage mode which works like actual run/debug mode. One can render the analysis of the code through coverage view, source highlighting, counters and sessions.


JDepend4Eclipse

JDepend4Eclipse helps to traverse file directories and assists in measuring the quality of design. It is an open source tool licensed under Eclipse Public License v1.0.


PMD

PMD is a source code analyzer which helps to detect used variables and bad codes. (Update URL -http://pmd.sourceforge.net/eclipse/)


SourceHelper

SourceHelper helps to code and debug, and it also aids in providing clarity to the written code.


Structure101

Structure101 helps to influence architecture when the code is edited, which means you can change the architecture without disrupting the code.

Text Editor Plugins


AnyEdit Tools

The plug-in helps to add new editor to output consoles, toolbar, and it also help to import and export data. It is licensed under Eclipse Public License v1.0.


Eclim

Eclim helps to bring Eclipse functionality to one of the best editors - Vim, wherein development can be done in various languages and it also provides bug fixing provisions. It is released under GPLV3.


Eclipse-rbe

Eclipse-rbe is used for editing Java resources and its features include warnings for missing values, sorted keys, conversion from/to Unicode etc. It is licensed under GNU library or LGPL.

Dependency Management


Apache IvyDE

Apache IvyDE is an Eclipse plug-in which helps to integrate Apache Ivy’s feature of dependency management to Eclipse. Additionally, it helps to manage dependencies in ‘ivy.xml’. It can be used with plug-in WTP and Ant.


M2eclipse (Maven Plugin)

M2eclipse helps to manage both simple and multi module projects, and Maven integration for Eclipse (M2eclipise) helps to launch maven from Eclipse. It provides features such as dependency management and automatic downloading. You may also want to checkout Some Best Free Maven Plug-ins for Developers

Version Control Integration Plugins


Subclipse

Subclipse is a SVN plug-in which offers support for subversion of Eclipse IDE and it is licensed under EPL 1.0. Subeclipse 1.6.x supports ColabNet Merge Client. Subclipse provides easy interface to use the features.


EGit

EGit plug-in provides support, synchronizes view, reading for .git/ exclude files, provides rebasing and has streamlined commands for pulling and pushing.


MercurialEclipse

MercurialEclipse is one of the active Version Control System which gives you access on registration. It is a reliable plug-in which provides cloning repositories, push-pull synchronization and enables easy rollback.


P4Eclipse

P4Eclipse seamlessly integrates the strengths of Perforce's version management system with Eclipse's. P4Eclipse provides a developer-oriented set of features from within the Eclipse Team framework that support a wide range of Agile and traditional development workflows.

Framework Development


Spring Tool Suite

Spring Tool Suite provides development environment and tools such as XML file wizards and graphical spring configuration editor, which can be used for easy development.


Spring IDE

Spring IDE helps in developing Spring Application and provides interface to use the graphical editing framework. What’s more, Spring IDE display graphs of relationships and beans using configuration files. (Update site - http://springide.org/updatesite


Hibernator

Hibernator helps to create or update schema, run hibernate queries and create mapping documents. The user can synchronize a Java class to a related mapped file.


JbossTools

JbossTools 3.2x support JBoss, Hibernate, Drools, XHTML, Seam etc. (Update site - http://download.jboss.org/jbosstools/updates/JBossTools-2.1.2.GA)

Continuous Integration Related Plugins


Hudson Status

Hudson Status is a simple plug-in that displays the status (red/green) of a application on Hudson build server. Hudson is a very powerful continuous integration server, that is used in many large software development projects.


Sonar Plugin

Sonar Plug-in for Eclipse provides powerful integration of Sonar with Eclipse. It highlights code quality problems as we browse the code. Since the code quality standards definition is centralized on Sonar server, it ensures all developers are following same quality standards. Sonar is a open source platform used for centrally controlling the source code quality of software projects.

Other Utility Plugins


ASM - Bytecode Outline plugin

ASM Bytecode Outline plugin shows disassembled bytecode of current Java editor or class file, allows bytecode compare for Java/class files and shows ASMifier code for current bytecode. You can install ASM from Eclipse Update Manager. It allows bytecode comparison to Java class. (Update site -http://download.forge.objectweb.org/eclipse-update/)


Mylyn - Task Management

Mylyn has a task focused interface and it provides a task management tool to the developers. Moreover, it helps to integrate rich editing tools and monitor activities.


Eclipse Launcher

Eclipse launcher is written in Delphi 6 and it helps to launch Eclipse IDE with configuration.


FileSync

FileSync is licensed under Eclipse Public License v1.0 and it is a file synchronization tool used for creating, deleting and mapping files.


Log4E

Log4E helps to use logger easily without getting bound to a special logging framework. Also, you can define your own preferences for logging templates.

Tuesday 26 August 2014

The 2014 Leaderboard of Java Tools & Technologies

  • JUnit – 82.5%* - Top testing framework used by developers
  • Jenkins – 70%º - Most used CI server in the industry
  • Git – 69%* - #1 version control technology out there
  • Hibernate – 67.5%*/º - The top ORM framework used
  • Java 7 – 65% - The industry leader for SE development
  • Maven – 64% - Most used build tool in Java
  • Nexus – 64%º - The main repository used by developers
  • MongoDB – 56%º - The NoSQL technology of choice
  • FindBugs – 55%*/º - Most-used static code analysis tool in Java
  • Tomcat – 50%º - The most popular application server on the market
  • Java EE 6 – 49%º - Found in the most enterprise Java environments
  • Eclipse – 48% - The IDE used more than any other
  • Spring MVC – 40%*/º - The most commonly used web framework
  • MySQL – 32%º - The most popular SQL technology

Best framework in java



More than just looking at market share and usage in place, we wanted to extend this report on Java Web Frameworks to look deeper at these eight libraries, and find out about what is really important to developers, in addition to looking into how different frameworks make sense for different use cases.
This report is the first of two and will focus on a feature comparison across the following categories:
  1. Rapid application prototyping
  2. Framework Complexity
  3. Ease of Use
  4. Documentation & Community
  5. Framework Ecosystem
  6. Throughput/Scalability
  7. Code Maintenance/Updates
  8. UX, Look and feel
We’re going to compare and contrast each Web Framework in this report against each category above scoring and placing each of them based on our findings. The Java Web Frameworks (and versions) we will be discussing in this report are:
  • Spring MVC 3.2.3
  • Grails 2.2.2
  • Vaadin v7.1.1
  • GWT 2.5.0
  • Wicket 6.8
  • Play 2.1.2
  • Struts 2.3.15.1
  • JSF 2.2

List of Top tools in java

It’s as true for Java developers as it is for woodworkers: You can’t do the job right without the right tools. Fortunately, there are plenty of Java tools designed to make it significantly simpler to write good Java code — and help you make your Java code even better.
You’ll probably know many of the tools on this list of 18 choices, but others may be new to you. And odds are you haven’t tried them all yet!
  1. GradleBuild tool. Automates the building, testing, publishing, deployment, and more of software as well as generating static websites or documentation.
  2. EclipseOpen-source integrated development environment (IDE). If you could have just one tool for Java development, Eclipse would be a good choice.
  3. IntelliJIDE made by JetBrains, available in an Apache 2-licensed community edition and a commercial edition. IntelliJ provides similar features to Eclipse, with a smooth, developer-friendly experience.
  4. YourKitJava profiler. Combines powerful analysis capabilities, on-demand profiling during both development and production, free embedding into production, and seamless IDE and application server integration.
  5. Clover: Code coverage tool from Atlassian. Runs in your IDE or continuous integration system, and includes test optimization to make tests run faster and fail sooner.
  6. MockitoMock library. Open-source testing framework that enables the creation, verification, and stubbing of mocks.
  7. Jetty: Lightweight, embeddable app server.
  8. Hibernate: Object-relational mapper. Implements the Java persistence API.
  9. VisualVMJVM monitor. An all-in-one Java troubleshooting tool that comes with the JDK.
  10. JUnit: Unit test framework. Core tool of test-driven development that enables repeatable, white-box testing.
  11. Jenkins: Continuous integration tool. Customizable with more than 600 plugins.
  12. Spring Boot: Spring application development system. Works in your build system. Supports Gradle and Maven.
  13. Guice: Lightweight dependency injection/inversion of Control (IoC) framework, from Google.
  14. Guava: Utility library. Contains core libraries that Google relies on in Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth.
  15. FindBugs: Static code analyzer. Classifies potential errors in code as scariest, scary, troubling, or “of concern.” Available as a standalone GUI or as a plugin for Eclipse, NetBeans, IntelliJ, Gradle, Hudson, and Jenkins.
  16. Jackson: JSON parser. Aims to be fast, correct, lightweight, and ergonomic for developers.
  17. Snappy:Compression/decompression library from Google Code. A great resource when speed is a requirement.
  18. JD-GUI: Decompiler. Standalone graphic utility that displays source codes of “.class” files. Free for non-commercial use (i.e., can’t be included or embedded in commercial products).
Of course, don’t forget New Relic Java Monitoring,the best way to see everything in your Java applications. With New Relic, you can pinpoint code-level application performance issues quickly so you can fix them faster.

Monday 25 August 2014

Change icon folder open and close in tree on ZK 7.0.2

See here zkfiddle:

<zk>
 <style>
   .z-tree-icon .z-tree-open {
     background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA71JREFUeNqElW1oW1UYx//n5qZN0na7LlmzFzqauY198CUiShXUpoH6VR0iCFMQFPwgaxVhflEEPwh+aKofRMUJ4icFYeKm+NIXkc0hm6kV0W7SOdEma2dj0yZN7j33+D/n3qXtVvTCQ07O8zy/87ydewU2edTpdC9/jlD6Kdlr1EXKB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qeDH/5xMgMNpxFNd9Av4VYAAMPN6idWbbIwAAAABJRU5ErkJggg==);
   /*background-image: url('https://az545221.vo.msecnd.net/skype-faq-media/faq_content/skype/screenshots/fa12330/emoticons/yawning_20.png');*/
     background-size: cover;
     width: 100%;
   }
   .z-tree-icon .z-tree-close {
     background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAxBJREFUeNqcVc9PE0EU/mZ3S1OogUILxEgsiAonGr2IBwMcjCdP3jxr1MRADybeOEkwHgoxUYP/hQfDCYgH8aKBE2iAQvjZUqCRQi3t7PjtTuVn0xgmeTv75r33zZt935sVKDHUZEOYUy+lixI5ZZ6iTFCGRWdi8XSsOAP2tSEGq6oPdT1AsBvwNZ90yMaB1DiwNQYU9obE7US0JKD9JVRDbVwEbkbQ/BSwGoo7ZJ3Hkbvw6ddCAoi/h9r5PkVzt3FnM30IaI8FXTCEbkVEy2OueomRQdkh/PTJQS2MAJvfNGhPKm25SdiqXwTaI6LpLndew/+NTY3LGJVLR9TOTD/VqJCjtWFY3rjR8YipLvOorId9ACyOArvLOtZ/Sc+ZFT1faALC9wCjggmwLkYT7OmPfM81G0ravahpBQ5mgRyN+XVg6TMQegh0J7TUPdDyT3dsjo/j68Q4scRwsCwUVJeormf1ZotHYcDBNtTlKGoDAXdle2fHnY/rYm2YMTyB3OLKFkT1VahV1WUpqSKCmWMvxYfkB/XwCBJZ+6i2zjtwUq+kDwobzJIJwISoIiCxLEi6SRplXnvLVdolxMprzCd1ZmJpwJ0Pddpg5oA/qw5HtLgYCpYqENCWekEjsjDkc2IAvvVXRYpouvqSg1o3qHusYzFwMRwsZmhDZ2nwTIUjB4O6UYY10j7GSauIYcMg6pTa/c3FgHY6jzDWwXCwSBs1IRMksxk6PyBjHQwHS/wZ8YZhmHHvjU7SZaFYNeD+E4G1ZOnTXiTLPn0o1tzDnq9oQe7HpPMdm92vnX3niZm1wT7P9XZ2wzQ5wT6tbyvfeUnydp/97u9A/ucM5HZqyPcsH9WAb60akmzcrG+MeFrZNdl5ZpsoD1jBzHxXkJ+bg0xuTPFy6fY9L6QPr6/9mKlB64IRz7U22rl7jsQ9IOFVkR7CJFAQ8DbS1Y/8r1k2SsoFq4zKdMkLdv+NiMG0+syGRl6JjTD8/hN2O5PhVbjBInAzWRiqfKGiZW9sZ+wNIswUyv8CBIarXuLML+CvAAMASDyP6pmxxvMAAAAASUVORK5CYII=);
   /*background-image: url('https://az545221.vo.msecnd.net/skype-faq-media/faq_content/skype/screenshots/fa12330/emoticons/speechless_20.png');*/
     background-size: cover;
     width: 100%;
   }
   /*remove the font awesome icon*/
   .z-tree-icon .z-tree-open::before,
   .z-tree-icon .z-tree-close::before {
     content: '';
   }
  </style>
<tree id="tree" width="400px" rows="8">
<treecols sizable="true">
<treecol label="Name" />
<treecol label="Description" />
</treecols>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 1" />
<treecell label="Item 1 description" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2" />
<treecell label="Item 2 description" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2.1" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2.1.1" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2.1.2" />
</treerow>
</treeitem>
</treechildren>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2.2" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2.2.1" />
</treerow>
</treeitem>
</treechildren>
</treeitem>
</treechildren>
</treeitem>
<treeitem label="Item 3" />
</treechildren>
</tree></zk>