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

Could not find main class : Program will exit

I was messing with the JRE setup on Eclipse. Originally the project was set to 1.6 and when set to 1.7, my program started showing a lot of errors. So when i switched back to 1.6, all the compile time errors vanished but i have a new problem…
theIronGiant
  • 135
  • 5
  • 14
1
vote
1 answer

Generating interface with ASM is not working

I need to generate an interface at runtime. This interface will be used in a dynamic proxy. At first, I found this article from Google, but then I found I could just use ASM instead. Here is my code that gets the bytecode of the interface: private…
user837703
1
vote
4 answers

Can c++ code read java .class files?

I have been working in java for a while now, and want to learn how c++ works when it comes to compilation and executed. I was wondering if there is a way to convert compiled c++ class into .class files in java and vice versa. I am interested in a…
Galaxin
  • 474
  • 2
  • 9
  • 21
1
vote
3 answers

How to debug the error "Class file needed by X is missing. reference value Y of package Z refers to nonexisting symbol" in Scala?

I am just getting started with Scala since last week and I am having this problem that is driving me crazy. I have some code that I want to migrate fully from Java to Scala (except libraries) but I have hit a block where I can't now proceed because…
user95947
1
vote
3 answers

Validate Java Classes Inside Jar

Java class files inside jars can be easily replaced and modified. For instance, the following command can be used to replace a compiled class file within a jar: jar uf JarFile.jar com\something\Class.class If the class file was replaced with a…
Eugenio De Hoyos
  • 1,755
  • 16
  • 22
1
vote
2 answers

instantiate an object given a .class file in a blackberry application

I am writing a blackberry application - after the application has started I need to get a .class file(or maybe something else like a .COD file?) from a database(I will probably have to create a web page from which to get the file) and then…
abiNerd
  • 1,976
  • 1
  • 18
  • 22
1
vote
1 answer

How does one add source to a .class file on eclipse?

I am trying to add a date.class file to my eclipse project, but it returns Source Not Found. How do I create/ add a source file from a class file?
Quizzical
  • 153
  • 4
0
votes
2 answers

how convert a particular .java to .class with coding?

I have an issue for my application. I want to convert selected .java file to .class file at same path. for that i am using: File directoryPath = new File("."); String command ="cmd.exe /C "+ directoryPath.getCanonicalPath()+"\\javac…
Siten
  • 4,515
  • 9
  • 39
  • 64
0
votes
1 answer

How programmatically to export additional .class files with my JAR

I need the .class files (not related to the source files in the project) located in one of the folder inside the project to be exported with JAR too. If I do export my project with "Deployable plug-ins and fragments" and specify the elements I need…
JackBauer
  • 135
  • 1
  • 3
  • 10
0
votes
1 answer

Make File to run on Linux/ MAC OS to compile .Java Files to an exe form

I am a beginner in Java. I made my Java program using NetBeans. Now I have my .jar file. But I would like to know how to write commands to compile .Java classes to .Class and then build a jar using those .Class files. Does any one have an idea how…
Basmah
  • 829
  • 3
  • 13
  • 25
0
votes
3 answers

How can I test if my jar file has any unresolved dependencies?

I'm writing a custom tool to build jar files from our build tree. We like to build "minimal" jar files that contain only the .class files actually referenced from the "root" class (where main() lives) -- and so on, recursively following…
Greg Ward
  • 1,604
  • 1
  • 13
  • 13
0
votes
2 answers

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 the resulting file on disk, what file encoding type…
CodeBot
  • 33
  • 5
0
votes
1 answer

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 explain the reason in detail.
0
votes
2 answers

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 II_Parcial_2007_1.doc Main.java numeros.class I mean,…
dylanroman03
  • 13
  • 1
  • 5
0
votes
2 answers

why is the Java constant_pool memort 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; u2 constant_pool_count; …
shodz
  • 344
  • 3
  • 13