Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Using Reflection to access a file not available while compiling Java class File

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on a project where I have a class say UsingReflection.java in package com.example.UsingReflection

and another class ObjectAccess.java in the package com.example.Objects

and my project compiles using ant build script is used.
In the ant script file i have the java packages compiled in the following order

com.example.UsingReflection
com.example.Objects

If i try to access and object of ObjectAccess in UsingReflection and run the ant script it fails. But using reflection I am able to run the compilation scripts successfully.

Can you please explain how my class UsingReflection is able to access the ObjectAccess object using reflection.

Thanks,
Ragini




Regards,
Ragini
 
Ranch Hand
Posts: 171
Hibernate Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are these ObjectAccess and UsingReflection java classes? please explain, probably paste the code here if it doesn't violate any rules/laws.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anurag Verma wrote:...please explain, probably paste the code here if it doesn't violate any rules/laws.


@nelom: And that basically means: post the code, not an image of it, or a link to an untrusted repository.

And before you do so, please read the UseCodeTags (←click) page, and use the 'Preview' button to check what it looks like before you post.

Thanks.

Winston
 
Marshal
Posts: 27378
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems to me your Ant script is just compiling the classes in the wrong order. If class A depends on class B then you should compile B before A, and that isn't what your script does.
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic