Archive for the ‘long tweets’ Category
(long tweet) Error injecting: org.codehaus.groovy.eclipse.compiler.GroovyEclipseCompiler
Case
On building a Groovy project with Maven, I got the following error:
Error injecting: org.codehaus.groovy.eclipse.compiler.GroovyEclipseCompiler java.lang.NoClassDefFoundError: org/codehaus/plexus/compiler/CompilerResult
Quick fix
Downgrade maven-compiler-plugin
to version 3.0
instead of branch 2.3.X
.
How to know which versions of Xerces and Xalan are run in the JDK?
Run this command:
java com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck
(long tweet) How to make ChromeOS work in VirtualBox without Wifi?
Case
How to make ChromeOS work in VirtualBox without Wifi, ie on an ethernet/wired local network, or even offline?
Quick Fix
Shutdown the VM > Select it > Settings > Network > Advanced > Adapter Type > select “Paravirtualized Network (virtio-net)”
(long tweet) Virtual Box / PAE processor
Case
On booting ChromeOS Vanilla within Virtual Box, I got the following error:
This kernel requires the following features not present on the CPU: pae Unable to boot - please use a kernel appropriate for your CPU.
(Actually, the problem occured with ChromeOS but may have appened with another system)
Quick Fix
In Virtual Box, select the VM > Settings > Processor > check “Enable PAE/NX”.
(long tweet) A story of return in try/catch/finally
A short reminder: in a try/catch/finally
section, the block in the finally is always executed. “Always” means “even if a return
statement is reached in the try
or catch
“.
A short piece of code shows more than a long speech. The following JUnit test ends with no error:
package com.stepinfo.poc.cartography; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; /** * Created with IntelliJ IDEA 12 "Leda" CE * User: Jonathan LALOU * Date: 08/Apr/13 * Time: 22:41 */ public class TestTryCatchFinally { public static final String TRY = "try"; public static final String CATCH = "catch"; public static final String FINALLY = "finally"; private String tryVersusFinally() { try { return TRY; } catch (Exception e) { return CATCH; } finally { return FINALLY; } } private String catchVersusFinally() { try { throw new RuntimeException(); } catch (Exception e) { return CATCH; } finally { return FINALLY; } } @Test public void testTryFinally() { assertNotSame(TRY, tryVersusFinally()); assertEquals(FINALLY, tryVersusFinally()); } @Test public void testCatchFinally() { assertNotSame(CATCH, tryVersusFinally()); assertEquals(FINALLY, catchVersusFinally()); } }