|
Re: Eclipse build path parameters suitable for 2 computers [message #1823222 is a reply to message #1823203] |
Mon, 23 March 2020 06:12 |
Ed Merks Messages: 33257 Registered: July 2009 |
Senior Member |
|
|
This question is quite specific to the Java Development Tools support so probably best asked on the JDT forum:
https://www.eclipse.org/forums/index.php/f/13/
I'm not sure what advice they'll give but here's the general idea. The information about the classpath is stored in a file that is generally hidden by default. I.e., each Java project will have a .classpath file. To view such files directly, you can use the Package Explorer view menu to disable the ".* resources" filter. In general this file (and hence the project) is only portable across machines if there are no classpath entries with absolute paths that are specific to the machine. Generally the paths related to the JRE use (and should use), symbolic entries, e.g., <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> This ensures that the actual path is resolved using the JRE configured in the preferences, i.e., Window -> Preferences -> Java -> Installed JREs. If you need to add additional jars, it's best to put them in a Java Project and export them to make them available in other Java projects.
In addition, you should assume that a workspace folder is not portable . Assume that you cannot copy it from one place on a computer to another or from one computer to another. There's all kinds of "stuff" in the workspace's .metadata folder and some of that stuff contains absolute paths that will not work in another location or relative paths that will not work on another location even on the same machine. To "share" projects, it's best export them to a zip file and import them into a workspace. Or better yet, share them in a Git repository and push/pull the changes.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04864 seconds