What i need to do is as follows:
I have a bigloo scheme program (*.scm), then using the bigloo frameworks jvm a class file is generated.
I want to use this .class file from a .java file. That is, i need to import this(.class) file as i want to use some functions defined in the scheme file which is now a .class file.
How do i do it in Eclipse? i have created two packages one for java and one for the .class file. Then i import the package containing the .class file. But i am not able to use the function in the .class file in the .java file. Are there any settings to be done?
Please let me know how this can be done.
You can import a specific class or the whole package. You place import statements at the top of your source files (but below any package statements). For example, you can import all classes in the java.
Click on Window > Preferences > Java > Decompiler to configure which default class decompiler to decompile Java class.
javap is the Java Disassembler tool which can be used to open a . class file in a readable format. javap is located in the /bin folder of the JDK installation directory. The Java Decomplier (javap) displays information about the package, protected and public fields, and methods of the classes passed to it.
You can add a folder containing compiled classes to your project by right clicking the project, then select Properties > Java build path, then "Add External Class Folder"
Or choose "Add Class Folder" if you have copied the class files into a sub directory of your project.
This will add the class files to the projects classpath and you can then import the class into your java file using an import statement:
import my.package.MyClass;
Note: The package structure should be maintained under the folder that you add as a class folder. So if you add folder "myclasses" as a class folder, the directory structure should be as follows for the example above:
myclasses/my/package/MyClass.class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With