Note that there are some explanatory texts on larger screens.

plurals
  1. POReading .class file in java
    primarykey
    data
    text
    <p>Hi can anyone guide me in this problem ?</p> <p>I am reading a .class file using <strong>Java reflection</strong> and that class contain some other class Reference (External References).But when i try to access/read its information using Java reflection then it will gave </p> <blockquote> <p><strong>Cannot Find Symbol</strong> compile time error?</p> </blockquote> <p>Is there any way of getting the Custom data Type(means Class A got ref of Class B) of a class using Java reflection in case of reading .class file?</p> <ol> <li>I am reading a .class file using <strong>ClassLoader</strong> </li> <li>then i am reading the file and then transfer it into <strong>byte array</strong> and using <strong>defineCalss()</strong> method i will get the Class Object.</li> <li>After i will get information i.e. all fields of the class i use <strong>getDeclaredFields()</strong> method.</li> </ol> <p>When i try to compile a .java file having external reference then it gave "Symbol not found error" &amp; when i compile it using some IDE i.e eclipse And then try to open its .class file to read it then it gave these errors </p> <p>Exception in thread "main" java.lang.NoClassDefFoundError: LTeacherClass; at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Unknown Source) at java.lang.Class.getDeclaredFields(Unknown Source) at ClassExtractManager.classInfoExtracter(ClassExtractManager.java:158) at MainClass.main(MainClass.java:36) Caused by: java.lang.ClassNotFoundException: TeacherClass at java.lang.ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 5 more</p> <p>If there still problem then i will post the code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload