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
0
votes
1 answer

Java - Compile using .class file

I have the following java class: public class ExampleClass{ public static void main(String[] args){ Operation op1 = new Operation(); } } And then in another location I have this class: public class Operation{ public int…
ROBlackSnail
  • 501
  • 1
  • 5
  • 20
0
votes
1 answer

java.lang.UnsupportedClassVersionError: how to run code with a newer version of Java Runtime

While compiling from the command line, an error occurs, how do I get the required version of Java Runtime? java.lang.UnsupportedClassVersionError: hello has been compiled by a more recent version of the Java Runtime (class file version 57.0), …
Sweta Jain
  • 3,248
  • 6
  • 30
  • 50
0
votes
2 answers

With Android how to get the last modified timestamp of a file in Java?

In my Android app I need to display last modified time stamp of the program, so if I have 3 class files in an app, I want to get the last modified timestamp of each, and use the latest one as the time stamp for the app, so I don't have to manually…
Frank
  • 30,590
  • 58
  • 161
  • 244
0
votes
0 answers

Canonical way to map SourceFile class attribute to actual file system path

The SourceFile attribute only contains the file name, not a full or relative path. This is not much information to go with because javac will place the .class file in a potentially unrelated directory (relative to the -d argument), based on the…
Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
0
votes
1 answer

How compile a java file to .class who use others .class. (if it's possible)

I get lib webrtc in a .aar, and I need to modify one file of this lib. We can call this file tomtom.class for this example So I unzip this .aar to get many .jar and in those .jar there the file tomtom.class who need to be replaced. I have the new…
user12149293
0
votes
3 answers

how to create check NetworkConnectionStatus in class file and use in mainactivity

add that in .class file and use in MainActivity.java how to create check NetworkConnectionStatus in class file and use in mainactivity Private void checkNetworkConnectionStatus() { boolean wifiConnected; boolean mobileConnected; …
vhpcorp
  • 89
  • 1
  • 10
0
votes
0 answers

Count the frequency of bytecode instructions from .class file

I'm trying to count the instructions and their frequency from a bytecode .class file. I came across this SO post and this one but they don't seem to give me an answer. I also read about ASM, and I still don't know how it can be used. javap lists the…
Self
  • 147
  • 2
  • 16
0
votes
1 answer

How to comment lines of a .class file?

I want to comment out a few lines of a .class file. I do not have the source file, but when I decompiled that file, I found that it is trying to import non-existing classes and this leads to errors and exception. So, I wanted to comment out those…
Donia Zaela
  • 317
  • 1
  • 4
  • 15
0
votes
2 answers

Whenever i edit in java file , i have to restart apache server for apply those changes in class file

Whenever I make any changes in java file, I have to restart server again and again for even small changes it. changes do not publish to server. It is really time taken process. how can I apply those changes in server without restarting server ? I…
Ravi
  • 21
  • 1
  • 9
0
votes
1 answer

Why are CONSTANT_Long_info and CONSTANT_Double_info still 2 entires?

When the JVM was originally drawn up, the designers had the CONSTANT_Long_info and CONSTANT_Double_info structures in the constant pool take up 2 entries (supposedly because that way you could index the constant pool by 4-byte alignment or something…
GoogleBen
  • 28
  • 4
0
votes
0 answers

Import jar files while rebuilding an entire project in Eclipse with .jar files only

I need to rebuild an entire project into Eclipse. I just have .jar files which contain only .class files. There are plenty of .jar files located in a lot of directories, how can I do that easily?
IvyMike
  • 1
  • 1
0
votes
2 answers

Determine path of class file that failed to load

We get an UnsupportedClassVersionError but have problems identifying the location of the offending file (>15 JARs in the classpath, several of which may contain the particular class). We suspect that the same class may be in the class path multiple…
Raphael
  • 9,779
  • 5
  • 63
  • 94
0
votes
1 answer

issue with importing user-defined package in java

I want to import the .class files in a package into another file. The directory structure is as shown below. |-lib-(contains some jar files) | |-XYZ-| | |-CT-(package that contains some .class files) | | | |-B.java | |-A.java How can…
0
votes
1 answer

How can I distinguish attribute_info in JVM ClassFile?

I'm digging into The ClassFile Structure. According to the document mentioned above, attribute_info can be appeared in various position. My question is how can I distinguish the type of attribute_infos? I know I can distinguish constant_infos by…
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184
0
votes
1 answer

Is it possible to write a java class file and then run it

Something like this: import java.io.File; import java.io.FileWriter; import java.io.IOException; public class WriteClassFile { public static void main(String args[]) throws IOException { File file = new File("ClassFile.class"); …
Nateguana
  • 59
  • 1
  • 6