Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Functional differences between .class, .jar and .java (class) file in eclipse? [closed]

Tags:

java

class

jar

What are the functional differences between a .class file, a .jar file, and a .java file that defines a class structure in eclipse and when is it appropriate to use each file type?

like image 311
Radix Avatar asked May 26 '14 13:05

Radix


People also ask

What is the difference between .Java and .JAR files?

java files are the source-code, and . jar files contain the compressed and packaged compiled .

What is the difference between a .java file and a .class file?

A . java file contains your Java source code while a . class file contains the Java bytecode produced by the Java compiler.

What is difference between JAR file and class file?

You can use JAR files to store class files. The class file does not target a specific hardware platform, but instead targets the Java virtual machine architecture. You can use JAR as a general archiving tool and also to distribute Java programs of all types, including applets.

What is the difference between JAR and executable JAR?

FYI: In simple terms, the difference between a JAR file and a Runnable JAR is that while a JAR file is a Java application which requires a command line to run, a runnable JAR file can be directly executed by double clicking it.


1 Answers

A .java file contains Java code.

A .class file is the .java file compiled

A .jar file is an executable java package.

Eclipse compiles .java files to create .class files and you can package them in an executable .jar file.

like image 123
Marta Rodriguez Avatar answered Oct 15 '22 06:10

Marta Rodriguez