Configure Intellij to use default Eclipse Java import layout

Eclipse and Intellij use different default layouts of Java imports. If used on the same project, Eclipse’s “Organize Imports” will compete with Intellij’s “Optimize Imports“.

To avoid distracting back-and-forth code changes, Intellij can be configured to match the default Eclipse behavior:

Go to File – Settings – Editor – Code Style – Java – Imports tab

Prevent on-demand imports (i.e. wildcards) by settings high count limits:
intellij-java-imports-no-wildcards

Define the imports layout (i.e. grouping and order) like this:
intellij-java-imports-layout

Fix Eclipse installation after Cygwin unzip

I used Cygwin’s unzip on Windows 7 to unpack freshly downloaded Eclipse zip packages. When trying to start eclipse.exe, I was getting weird error messages:

For Luna (4.4):

eclipse-luna-error-after-cygwin-unzip

For Mars (4.5):

eclipse-mars-error-after-cygwin-unzip

It turned out that after unzipping, the executable permission was not set on ‘exe’ and ‘dll’ files, so I had to fix it like this:

find eclipse \( -name '*.dll' -or -name '*.exe' \) -exec chmod +x {} \;

Java software engineering – reference resources

Official Java and JEE

Java Technology Reference

Java Standard Edition (JSE)

Java Enterprise Edition (JEE)

The official Java tutorials

The official JEE 7 tutorial

JEE 7 Technologies index

Java language spec and JVM spec

Java community

Oracle Java community

OpenJDK

Java Community Process (JCP)

Apache Commons

Apache.org Java projects

JBoss.org

Spring

Google Guava

Trending Java projects on github

JEE and Java web servers

Apache Tomcat

JBoss Wildfly

Glassfish

Build and test automation

Sonatype Maven books

Jenkins documentation (wiki)

JUnit reference documentation

Source and version control

The SVN reference book

Git reference documentation

Java IDEs

Intellij IDEA documentation

Eclipse documentation

Netbeans knowledge base

Vim configuration for Java coding

My standard tools on a Windows workstation

If I have to work on a Windows machine, these are the tools I usually install and use:

Free/Libre/Open Source

Free/Libre/Open Source software (“FLOSS”) with OSI certified Open Source license

Cross-platform:

  • Latest JDK
  • Intellij (Community Edition)
  • 7zip
  • Eclipse (Platform Runtime Binary + plugins required for my work)
  • Apache Tomcat
  • Apache Maven
  • Git (from git-scm.org)
  • Cygwin (with openssh, wget, nano)
  • Firefox (with Adblock, Secure Login, Firebug, Uppity)
  • Filezilla
  • LibreOffice
  • Pidgin
  • Gimp
  • Gvim
  • Wireshark
  • OpenVPN

Windows-only:

  • Notepad++
  • PdfCreator
  • Infrarecorder
  • CamStudio
  • Link Shell Extension

Closed source

Binaries currently available for download without license fees:

  • Adobe Reader
  • Sysinternals
  • Deskpins
  • MWSnap

JRuby on Rails 3.2

I currently have to work on an application using JRuby on Rails 3.2. My background is 12+ years of Java centric web development using Eclipse or IntelliJ.

There are a few things that I love about working with Java in Eclipse or IntelliJ that I miss when working with Rails:

  • Java’s backwards compatibility
  • Java’s cross-platform consistency
  • That Java has a static type system and is a compiled language
  • The relatively rigid syntax of Java that prevents idiosyncratic DSLs
  • Being able to control mutability, extensibility and visibility at compile-time (private, final)
  • Java’s distinction of interfaces vs implementation classes
  • Powerful auto-completion and Refactoring in the IDE
  • Powerful code inspections and quickfixes in the IDE
  • IDE and compiler feedback about mistakes and design flaws in my code
  • The powerful and rich ORM features of JPA and Hibernate

Dynamic language fans might cringe at some of the points listed above. Feel free to provide constructive feedback or well-reasoned criticism.

There are however a couple of things that I like about Ruby on Rails 3.2:

  • Dependency management using gems and bundler
  • A very standardized project layout (directory structure and conventions)
  • Code generation (as a convenient way to quickly create sample code)
  • Out-of the box integration and support for JQuery, CoffeeScript, SASS
  • Cool gems like colorbox-rails for turning a regular view into a modal dialog
  • The asset pipeline

I am still in the early phase of my Rails experience and I will try to post more about it as things evolve.

Java DSL for object-oriented type-safe CSS styling

I am looking for something like this Java-CSS-Library, to implement server-generated CSS stylesheets backed by a type-safe object-oriented model of CSS classes and rule sets.

This is part of my ongoing quest for the perfect “pure Java” web development framework that would allow me to

  • Focus on my strongest area of expertise: Elegant Java code
  • Use refactorings and other advanced Java tooling in Eclipse or IntelliJ Community Edition
  • Ignore the HTML/HTTP vs JVM objects impedance mismatch as much as possible

Maven integration (m2e) for Eclipse 3.7.x (Indigo)

Sonatype’s Maven integration for Eclipse (m2e) has been migrated to eclipse.org and is now available from the default update site for Indigo.

This means that you no longer have to add any Sonatype update sites as mentioned on the old (now outdated) m2eclipse site.

In particular, this also means that the old “m2e-extras” update site is obsolete for Eclipse 3.7.x and later. Things like WTP integration or Subclipse integration are now available as “m2e connectors” through Window – Preferences – Maven – Discovery.

All of this is very poorly (or not at all) documented on the new m2e home page and some people had problems with these changes.

Lightweight Eclipse package for web development

Update 14/Aug/2018: I no longer maintain the package mentioned and the download links below are most likely broken.

I uploaded a lightweight Eclipse package (based on Helios 3.6.1) for web development (includes Maven, SVN and basic Spring integration, JEE / web tools plugins, but no Mylyn or other non-essential stuff) … This is currently only for Windows. It requires a JDK and is completely free / open source software.

See the txt file for quick installation steps.