Java Eclipse project development on 32-bit and 64-bit Linux systems

I have a number of related projects that I hosted under Git (all of these projects are in the same workspace, which is the top level of the Git repository) and cloned from my desktop (32 bit) to my laptop (64 bit) so that I could work on them everywhere. The .metadata workspace .metadata excluded, but all project folders are tracked.

When I opened the cloned workspace on the laptop, I was met by an error:

 Project 'project' is missing required library: '/usr/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_3.5.2.v3557f.jar' 

Obviously, there are no 32-bit libraries in a 64-bit eclipse, but I'm curious how this should be allowed.

This library has been added as part of the SWT / JFace Window Builder project template. There is org.eclipse.swt_3.5.2.v3557f.jar eclipse plugins folder, but changing the path to it for searching does not work (SWT does not look strange). Looking through the rest of the .classpath file for SWT / JFace projects, this particular library is the only one that is so platform specific.

I put both versions of the library in .classpath , and this allows me to create / run the code, although I have to ignore the build path error, and this error will propagate back to my desktop when I pull the laptop changes back.

Can I just symbolize a 64-bit can on a laptop up to a 32-bit name so that the classpath can find the library? Is there any other, better solution?

UPDATE : It seems that this type of project should depend on a particular SWT fragment, so until there is a better solution, I am going to symbolize these fragments on both machines in order to direct the compiler to the correct fragment. Building / launching projects on other machines (and especially on Windows) will be! but I will build this bridge when I get there.

+4
source share
4 answers

What exactly do you keep in your initial control?

It is best practice to save only manually written source files in the source repository. Non-binary files, as well as generated files or IDE parameters.

I think you have a problem with the IDE settings for your 64-bit Eclipse, not working with 32-bit.

Just delete the .metadata directory in your workspace and reimport all projects in this Eclipse.

+1
source

Do not do this with the entire work area. Just do it with individual projects. It works well here.

+1
source

What type of project are you developing? Java project or plugin?

If you are developing a plug-in project, your project should not directly depend on a particular swt fragment (for example, swt.gtk, swt.win32). It should depend on the host module "org.eclipse.swt" that the actual implementation of swt is different fragments on different platforms.

If you are developing a java project that requires swt as a third-party requirement. You can install the eclipse delta package for both 32-bit and 64-bit eclipses.

+1
source

To avoid platform issues, you can also consider Maven. Using Maven 2 or 3, with an additional combination of problems with the platform of profiles, can be easily solved. Using several Maven plugins for Eclipse, Maven projects can be imported directly into Eclipse.

0
source

All Articles