Questions tagged [.class-file]

Class files are the format used by the Java Virtual Machine.

Class files are the format used by the Java Virtual Machine. Java programs are typically compiled into class files, which may be bundled into a jar archive.

283 questions
1
vote
2 answers

Can't see Super () in .class file after decompiling

class p { p(){ System.out.println("1"); } } class Student extends p{ Student() { super(); System.out.println("2"); } public static void main(String[] args) { Student s = new Student(); …
saurabh kumar
  • 155
  • 5
  • 26
1
vote
5 answers

Class file parser

I have an assignment where i need to write a Java program that parses a .class file and retrieves things like : 1.name of the .java file 2.implemented interfaces 3.variables 4.constructors 5.methods I don't have any ideeas where to begin…
tudoricc
  • 709
  • 1
  • 12
  • 31
1
vote
1 answer

Java conditionals in class-file (on bytecode level)

I'm playing a bit with Java class files and bytecode. But I stuck at the conditions in the class file. In theory, I understand the concept, but I don't understand how the branching in the classfile is done. Here is a small example: public static…
1
vote
1 answer

Eclipse: Getting error when adding external class / jar files to build path: "XYZ Cannot be resolved to a type"

I am working with Java and Eclipse, which are both a bit out of my comfort zone (yup , this is an assignment...). I have 2 class files which I need to use in my project. So far I have tried: Attempt #1 I tried adding an external class folder: In…
Avi Turner
  • 10,234
  • 7
  • 48
  • 75
1
vote
1 answer

Method signatures and descriptors in class file constant pool (javap)

I am trying to figure out the following two entries under the constant pool section in the class file: int foo(int x) { return x; } #11 = Utf8 foo #12 = Utf8 (I)I // 1 #13 = Utf8 x #14 = Utf8 …
gudge
  • 1,053
  • 4
  • 18
  • 33
1
vote
3 answers

How to find out the dependent classes from a raw class file?

When I look at a binary class file can I easily find out what other classes need to be loaded in order to use this class? As a sort of "directory" I can only see the Constant Pool Table with Class entries. The 1st and 2nd entry has a specific…
towi
  • 21,587
  • 28
  • 106
  • 187
1
vote
1 answer

Gradle reports BUILD SUCCESSFUL, however I can not locate any .class files

I am attempting to use Gradle (for the first time) for a multiproject java build. I have created a settings.gradle file with all the project names. I have also create a very basic build.gradle file. To my surprise when I run gradle build. It returns…
user1464251
  • 333
  • 1
  • 2
  • 16
1
vote
2 answers

It is only able to refer the class files inside App_Code folder in a file in ASP .NET website application

Only the class files inside App_Code folder is able to refer in a file in ASP .NET website application. Why its so?
Sudha
  • 2,078
  • 6
  • 28
  • 53
1
vote
1 answer

java -setting the location of manually compiled class files

I have created a class to manually compile my .java files into .class files. This program works successfully . But, .class files are created in the same directory as my .java files. But, I want them to be created in some custom directory. What can I…
star95
  • 111
  • 3
  • 16
1
vote
3 answers

how to manually read the java bytecode for understanding purposes only?

I was reading this wiki article on how some code is translated to Java bytecode. I came across this example: Consider the following Java code: outer: for (int i = 2; i < 1000; i++) { for (int j = 2; j < i; j++) { if (i % j ==…
brain storm
  • 30,124
  • 69
  • 225
  • 393
1
vote
0 answers

symbol not found: static method in abstract class (BCEL)

I'm a bit stuck on this. I can't compile because java claims not to find the method setRepository(), which is defined for the abstract class Repository in the follow code: public abstract class Repository { private static…
bcr
  • 1,328
  • 11
  • 27
1
vote
2 answers

getting error while importing .class files in a project in eclipse

I made a java project. It has dependencies. I have the class files. So what i did i made a classes folder and put all the class files in that folder and then add that folder to my project. All the dependencies have been removed. But i think class…
Basit
  • 8,426
  • 46
  • 116
  • 196
1
vote
0 answers

Jython compiler is not working

I am using Jythonc to compile *.py files into *.class files. However, whenever I try to compile the files from the command line, it gives this error : Required packages: java.lang Creating adapters: Creating .java files: StringParser module …
JavaNewbie_M107
  • 2,007
  • 3
  • 21
  • 36
1
vote
1 answer

Reading .class file

I'm trying to learn how to read a Java class file using C++. Can anyone help me figure out why AccessFlag prints 0? The lowest value it can print is 0x00001. So I think I'm reading the constant pool table wrong but I'm not sure what is wrong with…
Brandon
  • 22,723
  • 11
  • 93
  • 186
1
vote
1 answer

Cannot start Java class

I seem to be following instructions in the book I'm using as well as in Oracle's Java SE docs but cannot overcome the following error: Error: Could not find or load main class com.practicalJava.lesson25.StartServer I'm using the following command…
PM 77-1
  • 12,933
  • 21
  • 68
  • 111