|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
Registered: July 2009
This question is quite specific to the Java Development Tools support so probably best asked on the JDT forum:|
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.,
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.
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
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.
Powered by FUDForum
. Page generated in 0.31001 seconds