?
Solved

using two versions of jgoodies forms at the same time

Posted on 2010-01-07
3
Medium Priority
?
433 Views
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?
0
Comment
Question by:longtree
2 Comments
 
LVL 4

Accepted Solution

by:
Frelling earned 500 total points
ID: 26206707
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. com.company.widget.SameClass). 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,

Frelling
0
 

Author Comment

by:longtree
ID: 29374153
thanks for your help.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Fluent Interface Design Pattern You can use the Fluent Interface (http://en.wikipedia.org/wiki/Fluent_interface) design pattern to make your PHP code easier to read and maintain.  "Fluent Interface" is an object-oriented design pattern that r…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

862 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