Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Classpath variable stored where?
Classpath variable stored where? [message #288034] Mon, 11 July 2005 16:23 Go to next message
Eclipse UserFriend
Originally posted by: nospam.nospam.com

Where does eclipse store the classpath variables?
--
-Gary
Re: Classpath variable stored where? [message #288045 is a reply to message #288034] Mon, 11 July 2005 20:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sjjsjq.hotmail.com

In property of your project, you could setup Java Build Path --> Liabraries.

For the whole workspace, you could setup
Java --> Build Path --> Classpath Variables
"Gary Udstrand" <nospam@nospam.com> wrote in message
news:lsmu9ts84lbu.dlg@digitalwind.net...
> Where does eclipse store the classpath variables?
> --
> -Gary
Re: Classpath variable stored where? [message #288049 is a reply to message #288034] Mon, 11 July 2005 22:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Gary Udstrand wrote:
> Where does eclipse store the classpath variables?

For Projects, the build classpath (as opposed to runtime classpath for
application launches) is stored in the .classpath file located in the
root directory of the Project.

For runtime classpath of launched applications, there are *.launch files
created that probably include the classpath. I don't remember off the
top of my head where they are stored by default, but if you configure
them as "Shared" then you can pick any location in your workspace to
store them in.

HTH,
Eric
Re: Classpath variable stored where? [message #296365 is a reply to message #288049] Wed, 21 December 2005 13:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thunderaxiom.gmail.com

Eric Rizzo wrote:
> Gary Udstrand wrote:
>
>> Where does eclipse store the classpath variables?
>
>
> For Projects, the build classpath (as opposed to runtime classpath for
> application launches) is stored in the .classpath file located in the
> root directory of the Project.

Do you happen to know where the defintion of a variable (like
MAVEN_REPO) is stored?

I tried looking for it, and couldn't find it.

(Eclipse 3.1 under XP).

--
Thorbjørn
Re: Classpath variable stored where? [message #296366 is a reply to message #296365] Wed, 21 December 2005 13:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Normally, when you're using Maven and Eclipse, you set up a variable in Eclipse using Preferences -> Java -> Classpath Variables (or Build Path -> Classpath Variables, depending on your Eclipse version). Then you set up the location of your maven repository there.

There's no way to access the contents of MAVEN_REPO directly (thanks to those brilliant people at Sun who modified System.getEnv() to throw an Error) so you have to define it in two places.

On the plus side, you can define any external references to your project in the build paths by 'extending' the MAVEN_REPO variable to point to the specific Jar you want under the repository tree. If you then need to move/use a different repository, you can simply update the classpath variable and recompile.

However, if you've not put it there then don't expect MAVEN_REPO to be there -- you have to put it there yourself first.

Alex.
Re: Classpath variable stored where? [message #296573 is a reply to message #296366] Tue, 27 December 2005 12:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thunderaxiom.gmail.com

Alex Blewitt wrote:
> Normally, when you're using Maven and Eclipse, you set up a variable in Eclipse using Preferences -> Java -> Classpath Variables (or Build Path -> Classpath Variables, depending on your Eclipse version). Then you set up the location of your maven repository there.

Perhaps I was not clear enough in saying that I was wanting to know
where Eclipse stores the classpath variable definitions. I cannot
localize the file containing the defintions by searching for MAVEN_REPO
in either the workspace or the eclipse installation tree (and yes, it is
defined :) ), so I was wondering if somebody else knew this.

Thanks in advance.

Thorbjørn
Re: Classpath variable stored where? [message #296589 is a reply to message #296573] Tue, 27 December 2005 19:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

If you're asking where Eclipse stores the values you put in the classpath preferences page, then it's under the .metadata directory, probably in the plugins/org.eclipse.jdt.core/settings.xml (or something like that).

If you're askign where Eclipse stores the values on a per-project basis, the answer is in the .classpath file. This contains entries either of the form 'lib' or 'var', in which case, the first part of the path is treated as a variable defined in the Eclipse preferences dialog.

Hope either of those answers are the ones you're looking for.

Alex.
Re: Classpath variable stored where? [message #296624 is a reply to message #296589] Wed, 28 December 2005 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thunderaxiom.gmail.com

Alex Blewitt wrote:
> If you're asking where Eclipse stores the values you put in the classpath preferences page, then it's under the .metadata directory, probably in the plugins/org.eclipse.jdt.core/settings.xml (or something like that).

This is the one I am looking for. It appears to be stored in
variablesAndContainers.dat (whee) which is a binary file (sigh).

Is there anybody who knows whether there is any particular reason that
this is not an XML file?

--
Thorbjørn
Re: Classpath variable stored where? [message #296640 is a reply to message #296624] Wed, 28 December 2005 22:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Probably because it was implemented in an agile manner; that is, get something that works quickly. It's being proposed to change it during the 3.2 lifecycle:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=103839

It might be being stored as a Zip file or a compressed file (but if that were the case, I'd be surprised that you could find it by search alone). Try changing the extension to '.jar', '.zip', '.gz' and opening it in WinZip to see if it recognises it as a compressed file. It may be that there's one (or more) files stored in the .dat file, and it's being used as a pseudo container.

Can't answer why it is implemented the way that it is though.

Alex.
Re: Classpath variable stored where? [message #296641 is a reply to message #296640] Wed, 28 December 2005 22:15 Go to previous message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Just as a follow up, it looks like it's being written with a DataOutputStream and DataInputStream, courtesy of JavaModelManager

http://jsourcery.com/output/eclipse/3.1/org/eclipse/jdt/inte rnal/core/JavaModelManager.source.html

It might be that because Eclipse defaults to reading platform-specific encodings (instead of adopting a more sensible UTF-8 approach) that they used the DataInput/Output to explicitly write UTF-8 strings.

I'd agree that an XML file would probably be more sensible, but alas it doesn't appear to be that way.

Alex.
Previous Topic:FormToolkit.adapt() failure
Next Topic:launching a webpage from a link?
Goto Forum:
  


Current Time: Mon Jul 22 20:32:25 GMT 2024

Powered by FUDForum. Page generated in 0.04728 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top