Archive

Archive for September, 2011

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.

Advertisements
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

Maven with Eclipse

Install Eclipse Plugin M2Eclipse

  • Go to “Help | Install New Software… | Add…” and paste:
Name: M2Eclipse
Location: http://m2eclipse.sonatype.org/sites/m2e
  • Choose the component listed under m2eclipse: “Maven Integration for Eclipse (Required)”.

Create Maven project

  • mvn archetype:generate -DinteractiveMode=false -DgroupId=org.mycompany.myproject -DartifactId=MvnHelloApp
  • cd MvnHelloApp
  • mvn package
  • java -cp target/MvnHelloApp-1.0-SNAPSHOT.jar org.mycompany.myproject.App

Create Eclipse project

  • cd MvnHelloApp
  • mvn eclipse:eclipse
  • import the project in Eclipse
  • right-click on your project in the eclipse package explorer and choose “Maven | Enable Dependency Management”.

Install Maven under Mac OS X

Maven is a Java tool, so you must have Java installed in order to proceed. More precisely, you need a Java Development Kit (JDK), the Java Runtime Environment (JRE) is not sufficient.

  • Download latest stable version here.
  • Extract the distribution archive, i.e. apache-maven-3.0.3-bin.zip to the directory you wish to install Maven 3.0.3. The subdirectory apache-maven-3.0.3 will be created from the archive. These instructions assume you chose /usr/local/apache-maven.
    sudo mkdir /usr/local/apache-maven/
    sudo unzip /Users/cduu/Downloads/apache-maven-3.0.3-bin.zip -d /usr/local/apache-maven/
  • In a command terminal, add the M2_HOME environment variable, e.g.
    export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.3
  • Add the M2 environment variable, e.g.
    export M2=$M2_HOME/bin
  • Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g.
    export MAVEN_OPTS="-Xms256m -Xmx512m"

    This environment variable can be used to supply extra options to Maven.

  • Add M2 environment variable to your path, e.g.
    export PATH=$PATH:$M2
  • Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=/Library/Java/Home/ and that $JAVA_HOME/bin is in your PATH environment variable.
  • Run mvn -v to verify that it is correctly installed.
Categories: Build-Management

Install Maven under Windows 7

September 27, 2011 1 comment

Maven is a Java tool, so you must have Java installed in order to proceed. More precisely, you need a Java Development Kit (JDK), the Java Runtime Environment (JRE) is not sufficient.

  1. Download latest stable version here.
  2. Extract the distribution archive, i.e. apache-maven-3.0.3-bin.zip to the directory you wish to install Maven 3.0.3. These instructions assume you chose C:\tools\apache-maven. The subdirectory apache-maven-3.0.3 will be created from the archive.
  3. Add the M2_HOME environment variable, e.g. M2_HOME=C:\tools\apache-maven\apache-maven-3.0.3.
  4. Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g.:
    set MAVEN_OPTS=-Xms256m -Xmx512m

    This environment variable can be used to supply extra options to Maven.

  5. Add M2_HOME environment variable to your path (not the system path variable), e.g.:
    %M2_HOME%\bin
  6. Make sure JAVA_HOME is set to the location of your JDK, e.g. :JAVA_HOME=C:\Program Files\Java\jdk1.6 and %JAVA_HOME%\bin is in your PATH environment variable.
  7. Run
    mvn -v

    to verify it is correctly installed.

There are two locations where a settings.xml file may live:

  • The Maven install: $M2_HOME/conf/settings.xml
  • A user’s install: ${user.home}/.m2/settings.xml
Categories: Build-Management