Skip to content

Java and Eclipse News - Lars Vogel
Syndicate content
Tips around Java, Eclipse and Web programming
Updated: 2 hours 28 min ago

Eclipse 4.0 Application Platform – Tutorial Updated

Wed, 07/28/2010 - 23:25

As you know the Eclipse 4.0 SDK is out.

It also appears in discussions that some people don’t think Eclipse e4 is a good idea.

Other people seem to like it.

To help you to decide yourself I updated my Eclipse e4 Tutorial to Eclipse 4.0 Application Platform – Tutorial.

Together with Tom Schindls Tutorial you should be able to have a good start with Eclipse 4.0 SDK.

Please remember that the target of the core e4 Project is to improve the programming model of Eclipse and to provide an improved way of influencing the UI. The standard plugins are still the same and behave the same way.

My Tutorial also needs improvements, unfortunately it is not as far and deep as I like, but I hope that is will give you a good start. If you find issues, problems with my tutorial please let me know. The “more to come” section of my tutorial lists my future plans.

 
Categories: Blogs

Speak like a native – How to use native code (Windows DLL) in OSGi

Tue, 07/27/2010 - 10:43

As you know the OSGi Framework enforces strong modularity. This also applies to native library code, e.g. a Windows DLL.

To make your DLL available in the context of OSGi you have to use the Bundle-NativeCode section in MANIFEST.MF.

For example if your DLL is called “sapjco3.dll” and is in the main path of you bundle you can use.


Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Jco
Bundle-SymbolicName: com.sap.conn.jco
Bundle-Version: 1.0.0
Bundle-ClassPath: sapjco3.jar
Bundle-NativeCode: /sapjco3.dll; osname=win32; processor=x86
Export-Package: com.sap.conn.jco,

Many thanks to Matthias Heinrich for the tip.

 
Categories: Blogs

Eclipse e4 git mirror

Tue, 07/20/2010 - 14:05

After some time and effort mainly by Denis Roy and Bernhard Merkle the e4 git mirrors are working.

You find the e4 repos listed Eclipes Git overview.

EGit is also kind enough to be able to import all the projects from the different levels of the projects.

So give it a try via EGit and check out the e4 source code, e.g. the e4 UI projects via git://dev.eclipse.org/org.eclipse.e4/org.eclipse.e4.ui.git or if you want to use http via http://dev.eclipse.org/git/org.eclipse.e4/org.eclipse.e4.ui.git.

 
Categories: Blogs

Eclipse e4 @ Java Forum Stuttgart – Impressions

Fri, 07/16/2010 - 18:09

I had the pleasure to present Eclipse e4 on the Java Forum Stuttgart on the 1 of July. It was really nice to have lots of people showing interest.


I also quite happy that the audience gave good feedback regarding the session. The e4 talk was ranked within the top 10 presentations (rank 6).

Thanks everybody to attending the talk and giving such a good feedback.

 
Categories: Blogs

Shiny new world? – new Eclipse 4.0 Splash

Wed, 07/14/2010 - 07:23

Susan F. McCourt created a new splash screen for Eclipse 4.0 via Bug report.

I quite happy to see this change, after almost a decade of watching the old one it is refreshing to see something new.

What do you think about this new splash?

 
Categories: Blogs

NPE in e4 – ds missing in action

Mon, 07/12/2010 - 10:37

I saw this question asked several times, therefore I think a short blog entry might help in solving a common e4 launch problem.

If you run e4 you need to include the declaritive service implementation into your launch config. If you don’t you currently receive the following NPE:


java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.E4CommandProcessor.processCommands(E4CommandProcessor.java:52)

If you face such an error, make sure org.eclipse.equinox.ds and org.eclipse.equinox.util are included in the launch config.

I hope that at some point a better error message will be issued. Please see Bug 318821 for details.

 
Categories: Blogs

All the postal codes you ever wanted

Fri, 07/09/2010 - 11:54

If you looking for a list of cities and postal codes for certain countries have a look at http://www.geonames.org/. They also allow to download lists of postal codes.

Thanks to Andrea Antonello for the tip via Twitter.

 
Categories: Blogs

Reading resources from a Eclipse plugin

Tue, 07/06/2010 - 01:16

Frequenty you want to store static files in your bundle and load them from your bundle. For this you can use the following code, of course replace the bundle id with your version:


Bundle bundle = Platform.getBundle("de.vogella.example.readfile");
URL fileURL = bundle.getEntry("files/test.txt");
File file = null;
try {
	file = new File(FileLocator.resolve(fileURL).toURI());
} catch (URISyntaxException e1) {
	e1.printStackTrace();
} catch (IOException e1) {
	e1.printStackTrace();
}

Alternatively you can also use URL directly. I have to thank Paul Webster for this tip.


URL url;
try {
        url = new URL("platform:/plugin/de.vogella.rcp.plugin.filereader/files/test.txt");
	InputStream inputStream = url.openConnection().getInputStream();
	BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
	String inputLine;

	while ((inputLine = in.readLine()) != null) {
		System.out.println(inputLine);
	}

	in.close();

} catch (IOException e) {
	e.printStackTrace();
}

I believe the second option is the better one, as you avoid a dependency to the class Platform.

 
Categories: Blogs

July Challenge and Retrospective – Tux Time

Sat, 07/03/2010 - 09:00

This month my challenge will be to use Ubuntu on my new home machine “Angelus”. I have been a heavy Linux user in the past, but evil corporations ;-) have forced me to use Windows over the last years.

While vogella.de runs on Ubuntu the server and does not require frequent changes and therefore my Linux bash skills are getting a bit rusty. I also want to make use of find, grep, awk and the like and cywin it just not the same thing.

Also all the cool things (Git, compile OpenJDK, compile Android, …) runs easily on Ubuntu. So lets see if I manage to go back to the real thing. :-)

Retrospective:

Regarding my last months challenge Updating Tutorial to Eclipse 3.6 I think I did pretty good. I updated around 10 tutorials (I believe). There are still lots of tutorial which requires updates, I hope that I will find time in the future to do so.

 
Categories: Blogs

Eclipse e4 Presentation @ Java Forum Stuttgart

Tue, 06/29/2010 - 21:47

If you are joining the Java Forum Stuttgart on the 01. July, I will be talking about Eclipse e4. While the slides will be in English my talk will be in German.

Hope to see you there.

 
Categories: Blogs

The next e4 killer feature? JDT on the move

Mon, 06/21/2010 - 21:56

Some people say that the Eclipse support for alternative JVM based languages is not best in class. Therefore I think it is great news that Olivier Thomann from the JDT team indicated that might open up JDT to better support Java like languages.

I think this would be great and definitely a mayor step for the Eclipse IDE. As far as I understood the Scala IDE and the Groovy support could be heavily improved if the JDT could allow these environments to leverage the JDT infrastructure.

I believe these are great news for the interested people and the Eclipse ecosystem.

 
Categories: Blogs

Eclipse RCP Tutorial updated to Helios

Mon, 06/21/2010 - 11:17

I’m happy to announce that I updated the Eclipse RCP Tutorial to Helios. Looking at the revision history I was (again) surprised that I maintain this tutorial since Sep. 2007.

This time I made a full cycle; I tried not only to adjust the tutorial to the minor UI changes in Eclipse Helios but also to re-structure the tutorial and the text to improve it’s readability. I added more pictures which hopefully make the Plugin concept easier to understand.

Please note that the URL has changed to http://www.vogella.de/articles/EclipseRCP/article.html so in case you have saved this link I encourage you to update this to the new URL. But URL forwarding is setup so don’t worry to much.

I hope this tutorial continue to help new RCP developers to find their way into the fascinating world of plugin and RCP development.

Have fun hacking Eclipse RCP! :-)

 
Categories: Blogs

Eclipse 3.6 styling with CSS and the ThemeManager

Tue, 06/15/2010 - 19:58

Tom Schindl and Kai Tödter already blogged about the new Eclipse e4 ThemeManager. If you want to use the Eclipse ThemeManager and CSS Styling in Eclipse 3.6 you find an adjusted example “org.eclipse.e4.ui.examples.css.rcp” in the e4 repository. This example demonstrates the usage of the ThemeManager and Theme switching during runtime in Eclipse 3.6.

This is the colorful example. In case you are impressed with the design I would like to mention that I designed it myself. ;-)

For the German Eclipse fans their will be an article in an upcoming Eclipse Magazin describing in detail how to set this up.

 
Categories: Blogs

Eclipse Democamp Mannheim – Impressions

Fri, 06/11/2010 - 16:19

Yesterday we had the Eclipse Democamp Mannheim organized by the JUG Mannheim.

Despite having a temperature of more then 30 Celsius approx. 60 people showed up and enjoyed the talks about RAP, EGit, Eclipse Memory Analyser, redView, UML Lab, Eclipse e4 and Usus (a code checker tool). We also had several visitors which traveled quite a bit (for example from Dortmund, Saarbruecken and Kassel) to join the event.

Here a very photos about the event.

The room was packed.

Benjamin Muskalla about the news in Eclipse 3.6 RAP.

Jens Baumgart demonstrating EGit.

Markus Kohler showing Eclipse MAT:

Ekkehard Gentz delivering an overview of redView:

Manuel Bork with the UML Labs tools.

Nicole Rauch and Marc Philipp presenting their code checker tool USUS.

I demonstrated Eclipse e4 but have no photos to prove that. ;-)

Many thanks to the presenters Benjamin Muskalla, Jens Baumgart, Markus Kohler, Ekkehard Gentz, Manuel Bork and Nicole Rauch and Marc Philipp and to everyone who joined the event.

In case you joined the event, please leave a comment letting us know what you think about the first JUG Mannheim Eclipse Democamp.

 
Categories: Blogs

Eclipse projects – The nature of things

Tue, 06/08/2010 - 11:01

Did you ever wounder what defines if a project is “pure” Java project or a Plugin project?

Have a look at the “.project” file. This file contains the description of your project. It contains a XML tag “natures” where the nature of the project is described. A plugin project has the nature “org.eclipse.pde.PluginNature” and a java project has the nature “org.eclipse.jdt.core.javanature”.

These tags will also steer some behavior of the development environment, e.g. a project with PluginNature will update the java class path if you change the dependency information in a plugin project. For example if you add the “org.eclipse.pde.PluginNature” to an existing Java project you get the PDE menu for your project.

 
Categories: Blogs

A week in the life using EGit

Thu, 06/03/2010 - 13:31

I decided to give EGit a try and use it for one of my pet projects for a week. As most of you know EGit is the Eclipse plugin for Git, the distributed version control system (DVCS) invented by Linus Torvalds.

My overall impression of EGit is good.

In the process of testing EGit I created a bunch of bug reports, some of them real bugs, others feature requests and others most likely misunderstandings on my side. I collected my bugs reports in this list; in case someone is interested.

That I really like about Egit is that you can Add and commit at the same time. It is also great that as of a few days “fast forward” merge in EGit works. Now lets hope for the true merge. :-) See git-merge for the differences.

I think the UI need some more simplification so that normal users will be able to use it. See Fetch/Push dialog needs to be grossly simplified.
For me personally I think the Synchronization Feature is really critical; fortunately this is already covered by a GSoC project. Also I find the missing keybindings distracting.

Would I recommend using EGit for production projets at this stage? Difficult question….

I personally will definitely use it for some of my personal projects in the hope that my testing helps the EGit project. I think it would be benefical for the Eclipse eco-system if Eclipse has strong support for Git.

To get started with Git and EGit I created / updated the following tutorials:

Git Tutorial
EGit Tutorial

 
Categories: Blogs

Junes Challenge – Updating Tutorials to Eclipse 3.6

Tue, 06/01/2010 - 12:17

Keep my tutorials up with the Eclipse release flow is a time-consuming activity. As Eclipse 3.6 is approaching this month challenge is to update (some) of my Eclipse tutorials to Eclipse 3.6.

In my experience it is important to give users access a relatively actual information and by the user feedback I receive I can conclude that my tutorial are helpful.

I definitely will try to update Eclipse RCP Tutorial, Eclipse Commands Tutorial and Eclipse IDE Tutorial but hope to update more.

 
Categories: Blogs

Eclipse Democamp Mannheim around the corner

Mon, 05/31/2010 - 12:23

You may remember that Benjamin Muskalla did announce the EclipseDemo Camp Mannheim.

Therefore this is just a quick reminder that on the 10 of June you have the chance to see a lot of amazing Eclipse technology compressed in 15 minutes demos. You may also see a few slides but I hope this will be the exception. :-)

The program is also very impressive:

  • Oliver Gierke- Roo beyond the obvious (Hackathon with Spring Roo using Eclipse integration)
  • Benjamin Muskalla – Eclipse RAP / EclipseRT
  • Matthias Sohn et al. (SAP) – Eclipse EGit
  • Markus Kohler – Memory usage analysis on the Android platform
  • ekke (Ekkehard Gentz), Independent Software Architect, Thema: Modeling meets Runtime redView
  • Optional Oliver Gierke – What’s new in Mylyn 3.4?
  • Manuel Bork – Eclipse modeling and programming with UML Lab
  • Lars Vogel – Eclipse 4.0

There is also another topic Usus but we are not sure if it will fit in the time window.

Please register at Wiki Page for Mannheim Democamp. Unfortunately this event is not sponsored. But we still can have frosty beverages in a close by bar (FlicFlac) afterwards where we made a reservation.

A great oppertunity for networking and social drinking.

We encourage you to use the #majug hashtag for tweeting about the EclipseDemo Camp in Mannheim. If you are in the area check also the Majug Website for other events.

 
Categories: Blogs

Retroperspective on Aprils challenge – Speaking spanish at home

Thu, 05/27/2010 - 11:53

In April I started the challenge of the month. The idea is that every now and then I do something different for a month and see if I like it.

My first challenge was to speak only spanish with my family to finally learn it. I think we managed to speak spanish 70-80% of the time (sometimes we were just to tired to do so). To my surprise I was dead tired in this time, seems to be that my brain had a real challenge to manage. :-)

I think it was a success, at least I’m not that uncomfortable anymore to speak spanish.

 
Categories: Blogs

Friends of yours? Using x-friends in Equinox to loosen the API restrictions for some plugins

Tue, 05/25/2010 - 08:19

In Defining provisional API in Equinox I discussed how to mark your API as internal / provisional. But what if your plugin has a close friend which should be allowed to use this API without restrictions? Even in the plugin world some plugins are sometimes closer to each other.

This can be achived by the x-friends directive. Which can be added via the some editor which added the x-internal flag.

This should result in the following MANIFEST.MF.


Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Provider
Bundle-SymbolicName: de.vogella.osgi.xinternal.provider
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: de.vogella.osgi.xinternal.provider;x-friends:="de.vogella.osgi.xinternal.consumer"

By this setting the package de.vogella.osgi.xinternal.provider can be used by the plugin “de.vogella.osgi.xinternal.consumer” without restrictions but is mark as “x-internal” for all other plugins.

Choose your friends wisely. ;-)

 
Categories: Blogs