Archive

Archive for the ‘Misc’ Category

Maven Eclipse Compiler Error “No compiler is provided in this environment. …”

I got the following compilation error while running the Maven install command from Eclipse:

“No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?”

Go into Window > Preferences > Java > Installed JREs > and check your installed JREs. You should have an entry with a JDK there.

2013-03-08 10_37_19-Preferences

Go into Window > Preferences > Java > Installed JREs > Execution Environments

Select JavaSE-1.6, click the jdk checkbox on the right. Then use “update project configuration” from the maven menu.
2013-03-08 10_55_36-Preferences

For more informations about Maven and Eclipse have a look at the book of Sanjay Shah
here.
Maven-for-Eclipse

Eclipse Error: “Enabling Maven Dependency Management” has encountered a problem

February 17, 2013 7 comments

The following error apears if one imports a project which was created with Maven (mvn eclipse:eclipse) and tries the “Configure” -> “Convert to Maven Project” function:
An internal error occurred during: “Enabling Maven Dependency Management”. Unsupported IClasspathEntry kind=4

To fix this error open the project with Eclipse, run the “mvn eclipse:clean” command and try the “Configure” -> “Convert to Maven Project” function again.

Categories: Build-Management, Eclipse

Star Wars Ascii animation movie

You can watch an ASCII version of the Star Wars Episode IV movie here:
http://www.asciimation.co.nz/

There is also a version with sound here:
https://www.youtube.com/watch?v=h_GSRymSCt8

Categories: Misc

2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 43,000 views in 2012. If each view were a film, this blog would power 10 Film Festivals

Click here to see the complete report.

Categories: Misc

LibreOffice Basic escape characters

As Visual Basic doesn’t have an escape sequence LibreOffice Basic doesn’t have one neighter. So find out the Unicode code point for the character and use ChrW to convert it to the character. On Windows you can use charmap.exe to find out the  Unicode code point or have a look here.

For example, for the Copyright sign (U+00A9) you’d write:

Dim Copyright AS String
Copyright = Chr(&H00A9)
...
Cell.String = "Copyright sign: " & Copyright
..
Categories: LibreOffice, Misc

Notepad++ Column Mode

Use <Alt>+<Shift>+Arrow key or <Alt> + Mouse to select and edit text in column mode with Notepad++.

Categories: Misc

Change the default language for Eclipse User Interface

Start Eclipse with the -nl argument followed by the language en_US (for United States English) such as:
eclipse.exe -nl en_US

OR

Add the variable -Duser.language=en into the file eclipse.ini under the VMArgs section as shown below:

-vmargs
-Duser.language=en

Categories: Eclipse

Java line wrapping in Eclipse editor

Open preferences and search for “Format” or select Java->Code Style->Formatter from the left menu. The default profile is called “Eclipse [built-in]” and if you want to make changes to the Java Formatter you will need to copy it and create your own profile. This can be done with the “New” button right below the profile name.

Once you have created your own Java Formatter, make sure it’s selected and hit the edit button. Select the “Line Wrapping” tab. Under general settings you will see “Maximum line width:”. Set this to a numerical value  such as 180 characters. Save and apply that and return to your code.

Categories: Eclipse, Misc

Firmenname im XING Profil einstellen

Die Angaben, die oben im Profil neben Ihrem Bild und Namen angezeigt werden, richten sich zunächst nach der aktuell eingestellten Beschäftigungsart.

Haben Sie dort beispielsweise Absolvent/-in | Student/-in eingestellt, können Sie lediglich aus den Einträgen im Abschnitt Ausbildung auswählen. Hier müssen Sie also beispielsweise den Eintrag Angestellter auswählen. Anschließend klicken Sie im Bereich Berufserfahrung Ihres Profils beim aktuellsten Eintrag auf Bearbeiten und setzen das Häkchen bei der Option „Diese Tätigkeit neben meinem Namen und oben auf meiner Profilseite anzeigen“ und speichern Ihre Änderungen.

Categories: Misc

Restlet with Java SE

There are three ways to use Restlet within Eclipse IDE. The first one is to create a Java project and use the Restlet JARs as external libraries. Download the latest stable Java SE edition here and extract the archive, i.e. restlet-jse-2.0.9.zip. Add the library in the lib folder in your project properties.

The second way is to install Restlet JARs as Eclipse/OSGi bundles. All Restlet JARs including dependencies are valid OSGi bundles, so this is very convenient if you work in an Eclipse plug-in environment, such as an Eclipse RCP application. You then just need to create a plug-in project. Have a look at the FAQs here for more informations.

My prefered way is to use Maven. Install Maven and create an eclipse project. Then create a new java class MyServerResource and insert the following code:

import org.restlet.Server;
import org.restlet.data.Protocol;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

public class MyServerResource extends ServerResource {

	public static void main(String[] args) throws Exception {
		// Create the HTTP server and listen on port 8182
		new Server(Protocol.HTTP, 8182, MyServerResource.class).start();
	}

	@Get
	public String toString() {
		return "hello, world";
	}
}

Then add the Restlet repository to your pom.xml:

...
<repositories>
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.org</url>
</repository>
...
</repositories>
</project>

And the dependency:

...
<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
...

Then run your project and open http://localhost:8182 in your a Web browser.

Categories: REST/ROA