Invalid MIT-MAGIC-COOKIE-1 key

Recently I couldn’t start the x server and I got a mysterious Invalid MIT-MAGIC-COOKIE-1 key error. I deleted the .Xauthority files in my home directory which fixed my problem.

rm ~/.Xauthority*
DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Install the java plugin in firefox

To install the Next-Generation Java plugin in firefox follow the instructions below which is a summary of this article. If you have been using the classic plugin, see the Notes for further information.

  1. Check if you’re using the 32-bit firefox. Select the menu item Help -> About Mozilla Firefox. At the bottom of the window is a version string line that contains either “Linux i686″ (32-bit) or “Linux x86_64″ (64-bit). If you use the 64-bit version have a look at this blog post else continue.
  2. Exit Firefox.
  3. Change to ~/.mozilla/plugins or to another firefox plugins directory.
  4. Remove all symlinks (or move them to another directory).
  5. Create a symlink for the 32-bit plugin. Execute one of the following lines
    ln -s ${JRE_HOME}/lib/i386/libnpjp2.so
    ln -s ${JAVA_HOME}/jre/lib/i386/libnpjp2.so

    depending on what environment variable you have set. If you don’t know where your java is located find it out with which java or locate java

  6. Start firefox.
  7. Type about:plugins in your location bar to confirm that the java plugin is loaded.
DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Run a JavaFX application

Oracle claims that

JavaFX applications will run on any desktop and browser that runs the Java Runtime Environment …

but if I try to run it with my jre I get this error:

java de.slopjong.App
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/javafx/runtime/FXObject
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.runtime.FXObject
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 12 more
Could not find the main class: de.slopjong.App.  Program will exit.

If I’m not wrong this means that a JavaFX application requires more than just the Java Runtime Environment. Somewhere else in the JavaFX documentation I read that it’s compiled into java byte-code but this seems to be not the whole story. I understood this as you can run a JavaFX application with your standard jre.

Why should I use JavaFX for graphical user interfaces if the users must have the JavaFX libraries on their computer? I don’t want to force them to install one more piece of junk!

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Maven, the better quickstart

I read a lot of Maven documentation and at the end the most interesting question “How do I run an application with its dependencies?” wasn’t answered. Instead I was flooded with many xml configuration sections without showing a simple and complete configuration file. That’s why I wrote this howto but first a little story.

I came across Ivy and Maven a couple of days ago, both of which make it very easy to add a list of libraries to your Java project and add them to the classpath.

Basically both look for a project configuration file including your dependency list and they download the libraries from the internet and install them in the local repository ~/.ivy2 for Ivy and ~/.m2/repository for Maven which are then shared with your Ivy/Maven projects.

While Ivy is only a dependency manager which is integrated with the most popular build management system for Java projects (Ant), Maven is more than just such a manager. With Maven you have a build system and a dependency manager in one tool.

I focused on Maven and it took me a while to find out that a feature I was looking for wasn’t there natively. I assumed it would have a similar behaviour than Ivy but it hasn’t and works completely different.

I was missing a clear Maven howto which shows in 5 minutes how your project is created, compiled, packaged and especially how your standard java application is run afterwards.

I assume that Maven is already installed and that you are familiar with using a shell as I won’t use m2eclipse, the Maven integration for Eclipse. Maybe I’ll update this post later and give you a little introduction but for now let’s concentrate on using it in a shell.

I don’t guarantee that everything is 100% correct because I don’t use Maven that long. Post a comment if something is wrong.

Continue reading »

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

What’s Erviz?

Note
I’m in the process of forking Erviz. The fork is almost done. The Linux packages are prepared and almost ready to be submitted. (27. Sep 03:47 UTC)
————————

Erviz, written by Mitsuru Kono, is a tool that makes it easy to create entity-relation models and the best thing it’s free!

You can run it on Windows, Linux and Mac but for the latter a patch is required which will be discussed later on this page.

Creating the entity-relation diagram

Only these two steps have to be followed:

  1. Create a text file and define all your entities and relationships. The syntax is simple as example shows:

    # Using Erviz 1.0.6
    {title: "Syn2Stock ERD V3"; title-size: 20}
    
    # Entities
    
    [Item] {color:red}
     *Item ID
      Type
      SimpleItem
      Bar Code
      Name
      Amount
      Owner
      Comment
      Attachments
      Sources
      Source ID*
      Location ID*
      Lending ID*
    
    [Source]
     *Source ID
      Price
      Homepage
      Manufacturer
    
    [Location]
     *Location ID
      GPS Coordinates
      Name
      Room
      Locker
    
    [Lending]
     *Lending ID
      Borrowed by
      Borrowed on
      Returned on
      Reminder ID*
    
    [Reminder]
     *Reminder ID
      Start Date
      Repeat Interval
      End Date
      Active
      Action
      Email
      Phone
      Message
      Item ID*
      Lending ID*
    
    [Event]
      *Event ID
      Event Type
      Date
      User
      Item ID*
    
    [Attachment]
     *Attachment ID
      File
      External URL
      Private
    
    [Electronic Part] {color:orange}
     *Electronic Part ID
      Value
      Item ID*
    
    [Book] {color:orange}
     *Book ID
      Subtitle
      Author
      Publisher
      Paperback
      Language
      Review
      Summary
      About the Author
      Item ID*
    
    # Relationships
    [Item] *--* [Source]
    [Item] 1--1 [Location]
    [Item] 1--* [Lending]
    [Item] *--* [Attachment]
    [Reminder] ---- [Item]
    [Event] *--1 [Item] <contains ->
    [Electronic Part] ---- [Item] <is a->
    [Book] ---- [Item] </is><is a->
    </is></contains>
    
  2. Then turn the text file into the ERD image by calling the convert-files script.

Continue reading »

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare