using two versions of jgoodies forms at the same time

Posted on 2010-01-07
Last Modified: 2016-03-02
Matlab has a very nice interface to java, which allows you to write your own java code and integrate it into matlab transparently. I'm having a problem doing this though. Apparently matlab, for its UI, is using a version of JGoodies from 2006. The code that I wrote up uses a newer version of this library. When I try to integrate the classpath with the two libraries there is a conflict as the new version is not backwards compatible. I'm not sure how to resolve this effectively. The only thing I can think of is to recompile and repackage the forms library under a new path. Are there other better solutions?
Question by:longtree
    LVL 4

    Accepted Solution

    Dear longtree:

    While the solution is easy to state, it is a little harder to implement. The problem you have encountered is due to the classloader not being able to load multiple versions of the same class. The solution is to write your own classloading component. This is a bit more complex but this article should give you a basic introduction to the process.

    Another approach for a quick fix, though not recommended for production releases, would be to download the latest JGoodies source and change the root package name of it to something else. This way you can include older and newer versions having the same class name by using their fully qualified class names (e.g. Keep the older version as it is, as MatLab uses it, and use the renamed library for your own purposes.

    I strongly suggest the classloader approach, but the latter hack has worked in a pinch.

    Best regards,


    Author Comment

    thanks for your help.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    MaxSpan challenge 9 51
    json example 39 81
    wordmultiple challenge 12 64
    Eclipse IDE - Cannot copy/paste from console output 8 15
    Introduction This article discusses the Chain of Responsibility pattern, explaining What it is;Why it is; andHow it is At the end of this article, I hope you will be able to describe the use and benefits of Chain of Responsibility.  Backgrou…
    Introduction This question got me thinking... ( Why shouldn't we use Globals? This is a simple question without a simple answer.  How do you explain these concepts to a programmer w…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now