IntelliJ IDEA Working Directory

When you’re switching from one IDE to another, even if the codebase is the same, some differences might occur. This happens e.g. when using relative paths. Assume you have a multi-module Maven project with a structure somewhat like below: +—myApp | \—myApp.component | \—myApp.component.business Trying to execute in IDE the following code present in the myApp.component.business: private final String POM_PATH = "pom.xml"; // ... PomEquippedResolveStage Maven.configureResolver() .workOffline() .loadPomFromFile( POM_PATH ); In Eclipse, by default, it will load the pom....

September 26, 2014 · 1 min

Content Assist With Static Imports in Eclipse

If you’re using Eclipse and working with a class with a lot of static members, you might be affected by the problem of lack of content assist and automatic import for such members. Let’s say you’re using a Hamcrest matchers; you need a is(), notNullValue(), hasEntry() and so on (there are plenty of those). You don’t want to type Matchers.hasEntry() every time you use it in your code. Hey, that’s not why the fluent API was invented in the first place!...

April 26, 2012 · 2 min

Git and empty directories

I’m currently under the process of moving all my workplace repositories from SVN to Git (configured to work with Gerrit). As a side not, I already found it to be a great tool for code review, line-precise commenting of the artifacts and for reviewing new employees code before pushing the changes to the repository. But, back to my point. Recently I’ve stumbled upon a problem with committing an empty directory in Git....

April 21, 2012 · 2 min

Override differences in Java 5 and Java 6

Sometimes you might be struggling with such error shown, e.g. in Eclipse: The method … must override a superclass method. If this error is shown in the line when you have your interface method implementation with @Override annotation, it most probably means that you’re using JDK 5 instead of JDK 6. In Java 5, the @Override annotation might be applied only to the methods overriding superclass ones. Since Java 6 you can use the @Override annotation also with the methods that implements the interface ones....

February 28, 2012 · 1 min

Eclipse Go to... interface method implementation

In Eclipse you can open a method definition if you point the method name (its invocation), and hit ctrl + LMB. You can also achieve the same if you select the method call and hit F3, and probably in few other ways. Try to use this feature on the interface type… What’s annoying is that when you use this shortcut on a method which uses an interface type rather than the implementing class, you are forwarded to the interface method declaration....

January 31, 2011 · 1 min

Executing SSH commands from ANT

Sometimes, when building an application, there is a need for some SSH command execution on the remote server. An example of such command could be: Redeployment of an application, Server restart, Temporary files removal, Custom script execution. Have no fear – SSHExec is here! You can easily achieve remote command invocation, using an ANT Task sshexec. An example of its usage could be this snippet (note that remote.* variables are taken from the *....

January 31, 2011 · 1 min

Eclipse PDT and gray file comparison window

Today I’ve bumped into some weird problem with PHP files comparison using Eclipse PDT and Subclipse (SVN). When a file was selected and “Compare with… Latest from Repository” option was chosen, the comparison window become gray, no code source was displayed and no error message was shown. It was just the same if you tried to compare a file with your local history or two separate files with each other....

January 17, 2011 · 1 min

Eclipse with Axis2 facets error (no Axis2 runtime)

If you wonder why Eclipse is still throwing following exception during WSDL generation: Exception occurred while reading or writing file {0}The Axis2 facets cannot be installed since the Axis2 runtime location has not been set. Go to the Web Services preference page and set the Axis2 runtime location under Axis2 Preferences. despite that you already configured the Axis2 location in Eclipse, you could try to create clean Web Project (a dummy one, just for the “cleaning the pipe” effect ;-)....

December 19, 2009 · 1 min