razm
razm

Reputation: 25

What is .j file? and how do I get .java file from .j file?

I am using an assembler to convert java files to class files but when I run the assembler it only accepts .j files not .java files

Upvotes: 0

Views: 1900

Answers (2)

Stephen C
Stephen C

Reputation: 718886

Q: What is .j file?

You say that you are using the Krakatau Bytecode Tools ...

A ".j" file is a file containing Krakatua's of JVM bytecode assembly language. This is a human-readable representation of bytecodes that can be turned back into a ".class" file using the Krakatua assembler.

The documentation that you linked to says this about Krakatua assembly language:

"The Krakatau assembler uses a syntax similar to Jasmin, but with many new features, most importantly the ability to directly specify constant poolreferences. For more information about the syntax look in the Documentation folder."


Q: How do I get .java file from .j file?

You should first assemble the ".j" file to a ".class" file, and then decompile the ".class" file to a ".java" file.

Note that you will not be able to recover the original Java source code, and you may find that the decompiled ".java" file you get by this procedure is:

  • not valid (i.e. compilable) Java source code, or
  • not a correct translation of the ".j" file / ".class" file into Java.

Upvotes: 2

Nipun Alahakoon
Nipun Alahakoon

Reputation: 2862

.j files are descriptions of Java classes, written in a simple assembler-like syntax using the Java Virtual Machine instruction set and Jasmin assembler converts them into binary Java class files, suitable for loading by a Java runtime system.

So for your question . You have to get different compiler to compile java applications.

Upvotes: 2

Related Questions