Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 134570 - libary path best be relative instead of absolute
libary path best be relative instead of absolute
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Project
6.x
PC Windows XP
: P2 (vote)
: 6.x
Assigned To: David Konecny
issues@java
61fixes2-fixed
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-06 09:18 UTC by yizhan
Modified: 2008-07-10 15:19 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
proposed patch (7.21 KB, text/plain)
2008-05-13 08:31 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yizhan 2008-05-06 09:18:41 UTC
Hello,

When i add a jar to my classpath, netbeans will always save the absolute path of the jar file.

Guess i have a jar file in the same project folder. If i move or copy this project to another path or another computer,
the link will break.

I am really tired of resolve reference problem or changing the property files manually for all my projects. 
Please improve!

Thanks!
Yi Zhan
Comment 1 Milan Kubec 2008-05-06 10:23:20 UTC
Please check out Library Folder functionality of NetBeans projects in version 6.1. This is exactly the functionality you
are looking for. Take a look at http://www.netbeans.org/community/articles/netbeans61.html topic: Sharability of
Projects (aka Sharable Libraries).
Comment 2 yizhan 2008-05-07 02:45:03 UTC
I am using version 6.1. Library path is still absolute.
I am running under Windows XP. Is this a bug?
Comment 3 Milan Kubec 2008-05-07 06:56:37 UTC
Did you set the project to use shared library folder? Please describe exactly how you set up the project. Thanks.
Comment 4 yizhan 2008-05-07 13:01:08 UTC
I see, I need to select a library folder.

Thanks!
Comment 5 David Konecny 2008-05-13 08:27:19 UTC
NetBeans 6.1 added 'sharable libraries' feature which solves problems of project sharability. There is though
considerable regression which lot of users seems to experience (this issue or e.g.
http://www.nabble.com/absolute-paths-in-jar-dependencies---regression-in-6.1--td17088241.html#a17088241 ): adding a jar
to non-sharable project (ie. project without dedicated libraries folder) is always referenced via absolute path stored
in project.properties. In NB6.0 the path was relative due to collocation query. For sharable projects this is not an
issue as custom file chooser is shown letting user decide whether path should be absolute or relative.

After discussion with Milos Kleint we've agreed to fix this by showing custom file chooser even in non-sharable projects
and therefore letting user decide how the file will be referenced.
Comment 6 David Konecny 2008-05-13 08:31:11 UTC
Created attachment 61309 [details]
proposed patch
Comment 7 Milos Kleint 2008-05-13 08:42:07 UTC
patch looks good. I think you got al the relevant places.


one thing needs to be mentioned though. The fix will only allow to reference new jars with relative path. The existing
ones (from 6.0) will preserve the relative+absolute referencing and will appear as absolute path in project customizer.
to get rid of that, either delete the nbproject/private/private.properties file or remove the relevant entries from there.
Comment 9 Quality Engineering 2008-05-14 16:04:27 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #195 build
Changeset: http://hg.netbeans.org/main/rev/730087737c66
User: David Konecny <dkonecny@netbeans.org>
Log: #134570 - libary path best be relative instead of absolute
Comment 10 pslechta 2008-05-14 16:09:43 UTC
As recommended by Petr Blaha, marking this fix as candidate for NB 6.1 patch 2.
Comment 11 Jiri Prox 2008-06-03 09:44:01 UTC
verified
Comment 12 pgebauer 2008-06-03 20:59:18 UTC
The fix has been ported into the release61_fixes branch:

http://hg.netbeans.org/release61_fixes/04b270241e4a


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo