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.

265 questions
94
votes
7 answers

How can I compile a Java program in Eclipse without running it?

I would like to compile my Java program in Eclipse but not to run it. I can't understand how to do it. How can I compile a Java program to .class files in Eclipse without running it?
Jonas
  • 97,987
  • 90
  • 271
  • 355
59
votes
4 answers

Can Java class files use reserved keywords as names?

I'm aware that Java-the-compilable-programming-language is not one and the same as Java-the-bytecode-format-for-JVM-execution. There are examples of things that are valid in the .class format but not in the .java source code, such as…
Nayuki
  • 16,655
  • 5
  • 47
  • 75
37
votes
9 answers

How to change already compiled .class file without decompile?

I want to change .class file's method. I installed JD Eclipse Decompiler and opened the .class file. I added some codes and save .class file. But, .class file is not changing. I don't know how to use decompiler. And if is it possible, how to change…
Breed Hansen
  • 1,079
  • 3
  • 13
  • 21
34
votes
4 answers

Is there a java classfile / bytecode editor to edit instructions?

Is there a utility (or eclipse plugin) for editing java class files? I'd like to manipulate the bytecode of a java class file without recompiling it nor having a complete buildpath. E.g. to rename methods, add/delete instructions, change constants…
MRalwasser
  • 14,580
  • 14
  • 95
  • 134
25
votes
3 answers

What is the maximum size of a Java .class file?

A .class file is a rather well documented format that defines sections and size, and therefore maximum sizes as well. For instance, a .class file contains a magic number (4 bytes), a version (4 bytes), the constant pool (variable size), etc. But…
Olivier Grégoire
  • 28,397
  • 21
  • 84
  • 121
23
votes
4 answers

How do I run .class files on windows from command line?

I'm trying to run .class file from command line. It works when I manually move to the directory it's stored in, but when I try something like this: java C:\Peter\Michael\Lazarus\Main it says it can't find the main class. Is there any solution to…
AndrejaKo
  • 1,691
  • 5
  • 25
  • 40
22
votes
7 answers

Why Eclipse doesn't show local variables values when I debug class file from JDK?

I want to debug .class files. For example some from the JDK. I downloaded the sources and attached them. public File[] listFiles(FilenameFilter paramFilenameFilter) { String[] arrayOfString = list(); // now we here if (arrayOfString == null)…
gstackoverflow
  • 31,683
  • 83
  • 267
  • 574
19
votes
1 answer

Why does compiling a class containing static nested classes create a new .class file named "EnclosingClass$1"?

In the below code : class EnclosingClass { public static class BiNode extends Sub.IBiLink { } private static class Sub { private static class IBiLink { } } } On compiling along with other .class…
paidedly
  • 1,403
  • 1
  • 12
  • 21
19
votes
4 answers

Referencing a .class file in IntelliJ Java Project

I just started playing around with IntelliJ. I need to call a function from a class file I downloaded, so I need to reference a .class file in my project. Can't figure out how to add it to my project. Would appreciate it if someone could guide me.
DeveloperInToronto
  • 1,089
  • 2
  • 12
  • 29
15
votes
5 answers

Change string constant in a compiled class

I need to change a string constant in a deployed Java program, i.e. the value inside the compiled .class-files. It can be restarted, but not easily recompiled (though it's an inconvenient option if this question yields no answers). Is this…
Bart van Heukelom
  • 40,403
  • 57
  • 174
  • 291
12
votes
4 answers

How to programmatically generate .class files?

I would like to write a compiler for a toy-language for Java. I would like to generate runnable .class files. I was wondering what is the best library or tool available for doing this? I know I could learn the binary format for all the instructions…
Sled
  • 16,514
  • 22
  • 110
  • 148
11
votes
5 answers

Conversion of .class to jar and .class to exe

How do I convert: class file to jar file using cmd? class file to exe file? jar file to exe? Can I convert exe file to jar file?
Suhail Gupta
  • 19,563
  • 57
  • 170
  • 298
10
votes
1 answer

Should we use the ScalaSignature directly?

The ScalaSignature is an annotation. It contains meta informations. https://github.com/scala/scala/blob/v2.9.2/src/library/scala/reflect/ScalaSignature.java And then parser is provided. but scala-library.jar is not contains the parser. It seem…
Kenji Yoshida
  • 3,028
  • 22
  • 38
9
votes
2 answers

When is the JVM bytecode access modifier flag 0x1000 (hex) "synthetic" set?

For some Java byte code parser project I read the JVM spec and figured out that the bit mask values of the Java virtual machine class file format access modifier fields are ACC_PUBLIC = 0x0001 ACC_FINAL = 0x0010 ACC_SUPER = 0x0020 # old…
Peter Kofler
  • 8,820
  • 7
  • 48
  • 77
8
votes
6 answers

How to read the fully qualified name of a .class file

Hey, I think the title sums it, but still. I need to extract the fully qualified name of an object from its compiled .class file, could anyone point me in the right direction? Thanks, Adam.
TacB0sS
  • 9,456
  • 11
  • 66
  • 111
1
2 3
17 18