Eclipse plugin manifest problem - empty package inconsistency between mac and PC

By : Uri
Source: Stackoverflow.com
Question!

I am developing a collection of plugins on Eclipse 3.4 (official) on both mac and a PC.

At present (I'm aware it is not the best practice) some of my common plugins export all of their packages.

The problem is this: many of the listed packages are empty because subpackages are not, for example: prefix.core may be empty while prefix.core.model may not be.

Even though I use the same manifest file, having the empty packages listed on one platform raises an error in the manifest file on the other platform. If I omit the packages in that platform, then when I come to the other platform I'm told that the plugin does not export everything.

Any idea what is going on? I have no idea why there would be differences between the PC and the Mac on a non-UI related issue. The only significant difference is that the mac is running Java 5 (still not Eclipse for Java 6) while the PC is running Java 6, but the manifests should have nothing to do with it.

By : Uri


Answers

The problem could be the error/warning levels set in the preferences for Plug-In development. It could be that you have different settings in both machines, and that creates the problem.

Under Preferences -> Plug-in Development -> Compilers there are several options regarding error and warning levels for different issues, such as references to non-existent resources. Is there any differences that you might see?



It's usually a good practice to use the same version of the JVM if you're developing plugins across multiple machines and platforms.

If you are going to build the plugins on a PC and expect them to run on the Mac, you should standardize on Java 5. You can easily install and add additional JREs to Eclipse by going to Window->Preferences->Installed JREs. You can even configure which JRE each project and launch configuration uses, if you don't want the rest of your PC Java coding to use 5.

I wouldn't be surprised if this fixes your manifest problem, as well.

By : wsorenson


I have answered this question here: How to resize images proportionally / keeping the aspect ratio?. I am copying it here because I really think it is a very reliable method :)

/**
* Conserve aspect ratio of the orignal region. Useful when shrinking/enlarging
* images to fit into a certain area.
*
* @param {Number} srcWidth Source area width
* @param {Number} srcHeight Source area height
* @param {Number} maxWidth Fittable area maximum available width
* @param {Number} maxHeight Fittable area maximum available height
* @return {Object} { width, heigth }
*
*/
function calculateAspectRatioFit(srcWidth, srcHeight, maxWidth, maxHeight) {

    var ratio = [maxWidth / srcWidth, maxHeight / srcHeight ];
    ratio = Math.min(ratio[0], ratio[1]);

    return { width:srcWidth*ratio, height:srcHeight*ratio };
}


This video can help you solving your question :)
By: admin