Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Reading configuration from Mojo annotation of class

I've written a build tool. This build tool can generate jars that conform to the requirements of Maven plugins. A Maven plugin jar contains a file called plugin.xml which contains various pieces of ...
jurgen's user avatar
  • 325
0 votes
0 answers
58 views

Code Runner creates .class files along with the .java files in my src folder rather than bin (VS Code)

It works fine when I run it through the Java Extension Pack, though I would much prefer to use Code Runner for all my projects in all languages if that is at all possible. If anyone can help me I will ...
David's user avatar
  • 1
1 vote
2 answers
141 views

static java reflection - enum of fields of a class (pre-compilation)

is there a type of reflection in Java that provides simply an enum of the fields in a class? The information is, afterall, "precompilation-static". Why should it not be compiled into the ...
avertx's user avatar
  • 37
0 votes
2 answers
82 views

". java" files which are saved in "d" and "e" drives, Didn't get compiled (Files were run from the VScode)

My hard drive has 3 partitions as c, d and e. c drive is the main one. I'm running these following codes through the VScode.Not the CMD or PowerShell also I didn't used the terminal section of the ...
NV basnayaka's user avatar
0 votes
1 answer
348 views

Compile Java class files with external multiple jars using Javac

.java files are present in this folder exposeservices . I am trying to convert these .java files to .class files using the below command. These .java files have import statements so I have downloaded ...
oldcode's user avatar
  • 1,701
3 votes
2 answers
16k views

How to decompile Java Class file in VS Code

enter image description here So I'm a new java developer and VS code is currently the platform I use. To my understanding every time you create a new object in Java, a class file should be generated ...
subcoldmay's user avatar
0 votes
1 answer
409 views

what is the file encoding type for java class file?

What is the file encoding type used for Java class files? I am not referring to the file.encoding or Charset.defaultCharset() properties. When javac compiles a .java file to a .class file and saves ...
CodeBot's user avatar
  • 145
0 votes
1 answer
96 views

Why only one .class file is created in java & which is declared first?

In Java: class A{} class a{} after compilation : A.class class a{} class A{} after compilation : a.class Why only one class created? the first we declared only that .class file generated Please ...
user16796941's user avatar
-1 votes
1 answer
133 views

'package does not exist' using javac to convert .java class with google play services imports

I have a .java class which uses imports from google play services. I want to put this class in a .jar to package with my project, but using javac filename.java in the terminal gives me a bunch of ...
Alexander Jenkins's user avatar
0 votes
2 answers
432 views

How to implements interface from .class file in .java file?

I have homework that asks me to use a .class file for my project, but I don't know how to use those files in a .java file. This is the project structure agentes.class datos_confidenciales.class ...
dylanroman03's user avatar
1 vote
1 answer
528 views

how to map parameter annotations to corresponding method parameter in classfile using asm

As per the jvms-4.7.18 : The i'th entry in the parameter_annotations table may, but is not required to, correspond to the i'th parameter descriptor in the method descriptor (§4.3.3). For example, a ...
sify's user avatar
  • 717
1 vote
1 answer
144 views

how to show method parameter access_flags in java classfile

I tried to use javap -v on the classfile, but there is no information about method parameter's access_flags as defined in jvm-4.7.24 . Is there another tool or approach to show them?
sify's user avatar
  • 717
1 vote
0 answers
168 views

How to syntax highlight a hex dump of JVM classfile?

I'm studying binary file structure of JVM classfile. My current toolbox consists of $ xxd <classfile> and $ javap -v <classfile>. Sample outputs of these two tools are as follows: $ xxd ...
Takashi's user avatar
  • 31
1 vote
3 answers
62 views

why is the Java constant_pool memory allocation defined as having size constant_pool_count-1

The java class definition (docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html) looks like: ClassFile { u4 magic; u2 minor_version; u2 major_version; ...
shodz's user avatar
  • 384
0 votes
2 answers
423 views

Get java compiler version of a class file using xxd

I need to get the version of java that was used to compile a class file from a linux machine that doesn't have java. I have learned from a comment on this post that this is possible using xxd. ...
Jack J's user avatar
  • 1,634
0 votes
0 answers
399 views

.class file too large

I have a kotlin file with a function that returns a list of strings with 10,000 elements, but when compiling it generates an error, saying that the .class file is too large. What I can do? return ...
chrrissoft's user avatar
3 votes
1 answer
496 views

How do inner class access enclosing class' private members in higher versions of Java?

I have been trying to understand the mechanism of nested classes in java. Consider the following code: public class OuterClass { private String privateOuterField = "Private Outer Field"; ...
Mrunal Deole's user avatar
0 votes
0 answers
19 views

How to decompile java class files? [duplicate]

I am working on a static analysis tool for java applications. In one of the tasks I need to present the security analysis of a method and the corresponding method from the source code. In the case of ...
Jimmy the King's user avatar
0 votes
1 answer
77 views

Java runs in eclipse and will compile, but wont execute on cmd, but still runs in eclipse. How can I get it to execute in cmd?

So I have a basic hello world set up in eclipse and I can compile it using cmd easily (I have set all the necessary paths), however when I then try to use the java command to execute the hello world, ...
PythonSux's user avatar
0 votes
0 answers
3k views

I Can't Change the Read-Only Status of .class Files in intellij

Image I downloaded a .class file and opened it in Intellij, I pressed the lock button in bottom right corner and File>Make File Writable but I still can't edit the .class file. I own the file and ...
Tepedibi's user avatar
0 votes
0 answers
642 views

Authors in two columns for IEEEcsmag.cls

In IEEEcsmag.cls template for an IEEE magazine, authors can be added as follows (default). \documentclass{IEEEcsmag} \usepackage{hyperref} \usepackage{upmath} \begin{document} \title{Title:...} \...
Mt.Guchi's user avatar
1 vote
1 answer
2k views

How to easily edit a .class file

I have a .jar file WHICH I DID NOT CREATE with many class files inside. I need to edit one specific class file. I have jd-gui. The unedited code of this class file, as shown by JD is: package net; ...
Matt S's user avatar
  • 21
0 votes
1 answer
133 views

Can I assume the capacity of a Java data structure is proportional to the memory taken by then data structure instance when the program is executed?

My intention is to analyze the bytecode of a Java program and collect the data about the data structures that have been used. That data includes the initial capacity and how the particular data ...
Janitha Nawarathna's user avatar
0 votes
2 answers
176 views

What format of file does linker produce after linking .class files produced by compiler in JAVA

While working with JAVA when compiler compiles are .java classes. It produces .class files and after compilation, the linker links all .class files to create one single file. My question is that what ...
Umair's user avatar
  • 675
1 vote
2 answers
298 views

How does the JVM know how many values to pop into a new frame when invoking a method via invokevirtual?

When a method is called via invokevirtual, the calling method pops off the values to pass to the called method along with the objectref and places them in the new stack frame. How does it know which ...
platypusguy's user avatar
2 votes
3 answers
604 views

Java .class file disappeares as soon as I run the project

I've been on a project where I build tetris that has multiplayer, and it's been working for a couple of days with no problem, but now suddenly there's this exception: Exception in thread "main&...
itay amit's user avatar
1 vote
1 answer
1k views

"VerifyError: StackMapTable error: bad offset" at the first instruction of a method in instrumented class

I used ASM to instrument a class file, and the instrumented class throws VerifyError. The error message is like: java.lang.VerifyError: StackMapTable error: bad offset Exception Details: Location: ...
Instein's user avatar
  • 3,504
-1 votes
1 answer
3k views

How do I fix UnsupportedClassVersionError when running in Eclipse? [duplicate]

I am trying to run a Java Application in Eclipse. I ran it about a month ago and it worked, and I can't think of what has changed. When I try to run it now, I get this error: java.lang....
Summer Hopkins's user avatar
3 votes
1 answer
681 views

How to add/replace the SourceFile attribute in a .class file

I want to add/replace the SourceFile attribute in a compiled Java .class file. I have not noticed any obscure command-line options to the Java compiler to override the default value of SourceFile. ...
Ciaran McHale's user avatar
1 vote
1 answer
99 views

How to avoid storing duplicates in a Set if the objects type comes from a compiled .class file?

I am trying to store objects in a Set to avoid duplicates. As this topic explains I need to @Override two methods: hashCode() and equals(Object obj). The objects type that I am trying to store in the ...
Robert's user avatar
  • 316
-1 votes
1 answer
1k views

Vscode create java project only two folders lib and bin

When I create a java project, there are only two folders lib and src, and not files such as .classpath or .project, I know that is integrated into the terminal of vscode enter image description here ...
chiwa Ando's user avatar
1 vote
1 answer
2k views

Usage of 0xcafebabe in Java class file to identify byte order?

Is 0xcafebabe of the Java class file being used to identify the byte order e.g. in a network class loader? A java class could be serialized and sent over the network to another machine to be remote ...
mon's user avatar
  • 22k
0 votes
1 answer
742 views

.class file not being created in Sublime Text: Java

I am starting to learn Java and decided to use sublime text. I prepared a build system that would allow me to both compile and run the program. When I created my first file, it gave an error: Error: ...
Sam_Pam's user avatar
  • 37
0 votes
0 answers
55 views

Why are my bin directories not getting filled with .class files?

Im practicing java, and I noticed that in my older projects, my bin directories have "mirror images" of "something.java" files. But now they just dont seem to appear, no matter ...
user avatar
0 votes
2 answers
186 views

Is there a meaningful difference between running .class or .java?

I'm starting Java, and was reading the "Hello World!" for Microsoft Windows guide from Oracle. In the guide, it tells you to use javac to compile into a .class, then run with java -cp . ...
TheUltimateGuide's user avatar
0 votes
3 answers
944 views

Does a .jar file need all of the classes installed on a machine to run?

Does a .jar file need all of the classes installed on a machine to run? For example: if I ever distribute a program as a .jar file, will I also need to install all my .class files on the user's ...
Serket's user avatar
  • 4,425
9 votes
2 answers
13k views

VSCode java how do I set the path for the compiled .class files to go?

I'm using the Java Test Runner extension in VScode, and I want it to compile my classes to a specific folder. I found the setting to change the -cp when actually running the compiled .class files, but ...
Matthew Bennett's user avatar
0 votes
1 answer
157 views

Why dont I have run icon next to class in intellij? [closed]

I can run java classes on intellij only by right clicking. I dont have run icon on left side of the class and @Test. My java class files are also not .class but .java files all the time, even when I ...
chicka's user avatar
  • 61
3 votes
0 answers
797 views

Open .class file with Java Decompiler - incoherent errors

I am an Ubuntu user, I have a lot of .class files in which ground truth information about a dataset I'm using is stored. I want to access this information (not modify it) and export it to .csv files ...
AndroDev's user avatar
1 vote
3 answers
3k views

How can I get class files from Maven dependency into the target\classes folder

Is there any sort of Maven plugin that allows me to copy the class files for a dependency into the target\classes folder for my project? Currently I have to manually open the jar file that has the ...
JackEsson's user avatar
0 votes
1 answer
166 views

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 ...
ROBlackSnail's user avatar
0 votes
1 answer
13k views

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

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 ...
Sweta Jain's user avatar
  • 4,214
0 votes
2 answers
471 views

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 ...
Frank's user avatar
  • 31k
-1 votes
2 answers
115 views

Why is the attribute_name_index in JVM Classfile an index?

This page https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7 says For all attributes, the attribute_name_index must be a valid unsigned 16-bit index into the constant pool of ...
knium_'s user avatar
  • 103
0 votes
0 answers
130 views

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 ...
Florian Weimer's user avatar
0 votes
1 answer
510 views

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 ...
user avatar
0 votes
3 answers
75 views

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 ...
vhpcorp's user avatar
  • 89
1 vote
1 answer
583 views

How much information of the source code does the compiled class file keep in Java?

When a class file from another project of my own was decompiled by IntelliJ (by Fernflower de-compiler), I was marveled at the closeness of the decompiled code compared to the source code, even the ...
Yulin's user avatar
  • 1,283
1 vote
0 answers
3k views

module-info.class file is different in the module jar file and compiled module-info.class

I have a simple module I'm building with maven and have a question about the resulting module jar. Here is the plugin section of my pom.xml: <properties> <java.version>11</java....
St.Antario's user avatar
  • 27.3k
1 vote
2 answers
241 views

How can I extend JVM bytecode?

I want to create a programming language that compiles to its own bytecode format and a VM that interprets it. But I want the bytecode to be compatible with JVM. I've searched for any way to insert ...
Nick's user avatar
  • 168

1
2 3 4 5 6