Results 1 to 12 of 12
  1. #1
    sylvpan's Avatar
    sylvpan is offline Member
    Join Date
    Mar 2008
    Location
    beijing,China
    Posts
    5
    Rep Power
    0

    Question How can I change a project's build directory?

    My English is poor,I will try my best to give a accurate description of this question!
    OS:Linux AS 4
    IDE: netbeans 5.5
    project folder : /javawork/webapp1
    build folder: /javawork/webapp1/build/
    I don't like build in build folder.How can I change build folder into project folder?
    "/javawork/webapp1/build/web ----> /javawork/webapp1/"

    Thank you very much!

  2. #2
    sylvpan's Avatar
    sylvpan is offline Member
    Join Date
    Mar 2008
    Location
    beijing,China
    Posts
    5
    Rep Power
    0

    Default nobody tell me!

    :confused:

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    I can't find such a setting can be change. An why don't you worried about the class files in build folder. In most of the cases you can use the project jar file in the dist folder.

  4. #4
    sylvpan's Avatar
    sylvpan is offline Member
    Join Date
    Mar 2008
    Location
    beijing,China
    Posts
    5
    Rep Power
    0

    Default

    Thanks for Eranga's answer!
    In my project there is an XML file in web/web-inf/.It contains this website name,database server's ip,database's account and password!
    Example:
    <root>
    <appName>desinged by sylvester</appName>
    <appUrl>http://localhost:8080/sylv/</appUrl>
    <appServerPath>file:///javawork/myWeb1/build/web/</appServerPath>
    <appUploadFilePath>file:///javawork/myWeb1/build/web/upfile/</appUploadFilePath>
    <appPageSize>20</appPageSize>
    <appDbConf>
    <dbHost>127.0.0.1</dbHost>
    <dbPort>3306</dbPort>
    <dbName>myapp</dbName>
    <dbUser>sylvester</dbUser>
    <dbPwd>sylv</dbPwd>
    </appDbConf>
    </root>

    I desined a class can get these parameters from this xml,and the class can update this xml file. So I need to know this file's absolute path in disk.When construct the class which can update xmlfile,I use "this.getClass().getResource()" get the path.So,the classs in build folder and the class src folder will get two different paths.It's a difficulty when I debug my project!
    That is all my mind!
    Maybe my mind is wrong?
    By the way ,can I add your name in buddy list??
    Last edited by sylvpan; 03-26-2008 at 02:21 AM. Reason: there some syntax error

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Why you need the class path for this. Wherever the class is, only you need the correct path of XML file. If I got your requirement correctly, just you want to read a XML file and update a XML file. Isn't it?

    Quote Originally Posted by sylvpan View Post
    By the way ,can I add your name in buddy list??
    :D It's up to you. But one day I'm in your ignore list ;)

  6. #6
    sylvpan's Avatar
    sylvpan is offline Member
    Join Date
    Mar 2008
    Location
    beijing,China
    Posts
    5
    Rep Power
    0

    Smile

    [QUOTE=Eranga;15439] If I got your requirement correctly, just you want to read a XML file and update a XML file. Isn't it?[/QUOTE=Eranga;15439]
    yes,you're right!I handled the problem.I think my desinged before is wrong!
    Last edited by sylvpan; 03-27-2008 at 02:14 AM. Reason: wrong pattern

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  8. #8
    pao
    pao is offline Member
    Join Date
    Jun 2008
    Posts
    43
    Rep Power
    0

    Default

    Hi, this is quite easy to fix!! I will try to explain as simply as I can:

    1) In netbeans press Ctrl-2 to bring up the files window;

    2) Expand the project you are interested in and open the folder "nbproject";

    3) Double click the file "project.properties";

    4) Edit this value: build.dir=c:/webapps/MyProject/WEB-INF (Obviously put the location you want your class files to go to!).

    And thats it, simple, I hope this helps you.

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Ya, quite simple way. But I don't think it's good idea to deal with such files, since have a good idea on them. Anyway, nice tip.

  10. #10
    pao
    pao is offline Member
    Join Date
    Jun 2008
    Posts
    43
    Rep Power
    0

    Default

    What do you mean? Not deal with such files? This xml file is your project properties file and it there for you to change, otherwise your classes will always build into the default directory.

    Quite often than is not what you want, especially if you are running a web app under tomcat for instance.

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    No, what I'm try to say, that is not a good idea to change default values on the properties file if you know what exactly doing. Lots of people are really newbie for NetBeans. Even on Java(even not affected to this.)

    I think it's clear now what I try to say.

  12. #12
    rajeshdontham is offline Member
    Join Date
    Feb 2011
    Posts
    1
    Rep Power
    0

    Smile pao

    Quote Originally Posted by pao View Post
    Hi, this is quite easy to fix!! I will try to explain as simply as I can:

    1) In netbeans press Ctrl-2 to bring up the files window;

    2) Expand the project you are interested in and open the folder "nbproject";

    3) Double click the file "project.properties";

    4) Edit this value: build.dir=c:/webapps/MyProject/WEB-INF (Obviously put the location you want your class files to go to!).

    And thats it, simple, I hope this helps you.

    this was a great solution....
    but can we do the same without we editing properties file,,
    that is: will netbeans provide any option to store the .class files in different location after compiling

Similar Threads

  1. Teamwork 3.2.1 build 1540
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-09-2007, 10:37 PM
  2. Teamwork 3.2.1 build 1540
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-08-2007, 04:22 PM
  3. Teamwork 3.2.1 build 1384
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-25-2007, 04:35 PM
  4. Teamwork 3.2.0 build 414
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-11-2007, 03:13 PM
  5. Stable Build: Eclipse 3.3M6
    By goldhouse in forum Java Software
    Replies: 0
    Last Post: 04-02-2007, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •