Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: How To Refresh Referenced Libraries In Eclipse ?

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy How To Refresh Referenced Libraries In Eclipse ?

    Hello All,

    I Am New To Java Migrating From .Net To Java

    I Have 1 Problem Regarding Jar Files.. Ie

    1.) I Created a Project Name " Second "
    2.) Created A Package Name "UsingPackages"
    3.) In That Package I Created A New Class Name As "SecondClass"

    I Have Written A Method "Add " In That Class;

    And I Exported That One to a Jar File Name As " Second.jar"


    OK Then

    1.) Created Another Project Name "UsingPackage"
    2.) Added The Jar into This Project
    3.) I Called that Add Function in This It Works Perfectly...

    And My Problem Is If Write Sub Method in My First Project, And I Am Trying To Access it from Second Project It Won't Works

    Hope U Understand the Situation

    I Am Using Eclipse, , , Please Give Me A Solution How To Refresh The Referenced Libraries !!!!

    Thanks And Regards
    Rajeev


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,097
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    If both projects are in the same workspace, you shouldn't have to rely on exporting the jar (which necessitate an export after every update), rather in the build path add the project under the project tab (as opposed to an external jar library)

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    Hi Copeg. Thank You For Your Reply.

    My 2 Projects Are in Same Workspace. But Each and Every time when i update the code i need to Remove Jar file and again i need to add that jar file..

    Please help me

    Thanks

  4. #4
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,097
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    Read my post above, which contains the solution: don't have your project depend upon a jar at all, but upon the other project.

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    Ya Copeg But I Need To Depend on Jar File.... Because i wanna hide my Code to users

  6. #6
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,097
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    Quote Originally Posted by rajeev.sjsu View Post
    Ya Copeg But I Need To Depend on Jar File.... Because i wanna hide my Code to users
    What I suggested allows you to develop the two projects in parallel, which is what it seems like you are doing (otherwise for what you ask you will need to rejar every time a change is made so your other project can access those changes). When you deploy to the user, you jar up both projects.

  7. #7
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    Yeah Copeg I Am Developing two projects in parallelly, But I Am Not Getting !!!

  8. #8
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,097
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    In eclipse, right click the project that depends upon the other project, go to Properties. Select 'Java Build Path' and click on the Projects tab. Click "add" then select the project you wish to add to the classpath. Now that project is on the classpath - no need to jar it until you deploy. If the need be, remove the old jar from the jar dependency. That's about as explicit as I can get on how to accomplish what you want.

  9. The Following User Says Thank You to copeg For This Useful Post:

    rajeev.sjsu (September 11th, 2011)

  10. #9
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: How To Refresh Referenced Libraries In Eclipse ?

    Yeah.. Copeg Thank you it's Working Now....

    After Completion of my program do i need to give both projects ?

Similar Threads

  1. How to add JSF libraries to eclipse?
    By tien1504 in forum Java IDEs
    Replies: 5
    Last Post: October 24th, 2012, 04:32 PM
  2. Javatip Dec 18, 2010 - Eclipse User Libraries
    By helloworld922 in forum Java JDK & IDE Tutorials
    Replies: 6
    Last Post: February 20th, 2012, 12:41 PM
  3. [SOLVED] cannot referenced <instance data member> before super type constructr has been called
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 14
    Last Post: August 8th, 2011, 11:26 AM
  4. Javatip Dec 18, 2010 - Eclipse User Libraries
    By helloworld922 in forum Java Code Snippets and Tutorials
    Replies: 5
    Last Post: May 31st, 2011, 01:40 AM
  5. GUI - refresh problem
    By Shnkc in forum AWT / Java Swing
    Replies: 5
    Last Post: April 2nd, 2010, 06:11 AM

Tags for this Thread