Query:What's the difference between executable file and binary file?

J

Jack Dowson

Hello Everybody:
I offen hear about executable file and binary file while learning java
,what's the difference between them?

Thanks in advance!

Dowson.
 
M

Mathias Mejborn

Jack said:
Hello Everybody:
I offen hear about executable file and binary file while learning java
,what's the difference between them?

Thanks in advance!

Dowson.
A executable file is a file that you can execute by double clicking on
it (i guess). A binary file is a file that the java compiler makes from
the java source code that you wrote (the .java file). The compiler
compiles the file into a .class file that is binary, it is the jvm (java
virtual machine) that then interprets the .class file.
 
C

christopher

binary generally means "not character" as in, there is no character
coding to take into account when reading the file. no line feeds, end
of line characters, no character sets, etc. I mean, all files are
'binary' information, as in 1's and 0's, but binary files the way you
are using it means essentially 'cannot be read in a text editor'.

executable, on the other hand, means different things to different
operating systems. on windows it means .exe (or .com) file extension
in a particular format that windows knows how to run and understand.
In some cases a .jar file can be executable in that windows sends it
to jar.exe and jar.exe knows how to run the java files inside, which
is probably what you are seeing. in no case (or exceedingly rare
cases) will you have a java program output an executable file.

executable in unix (or linux) means the 'executable' flag is set in
the directory. the shell reads the first line to see what if it is a
script file and if so what script engine to use (shell, perl, ???)
(not 100% clear on the details here).

apples and oranges here, like asking what's the difference between red
and hard?
 
J

Jack Dowson

I've installed RedHat Linux and windows only!So your answer will be
enough to me!
Thank you!

Dowson.
 
R

Roedy Green

I offen hear about executable file and binary file while learning java
,what's the difference between them?

"binary" just means not human readable. "Executable" files are a
subset of those, that will run a program when you click them. A class
file is binary, but not executable. A jar file is both if it has a
main-class entry and there is an association set up.
See http://mindprod.com/jgloss/associations.html
 
G

Greg R. Broderick

"binary" just means not human readable. "Executable" files are a
subset of those, that will run a program when you click them. A class
file is binary, but not executable. A jar file is both if it has a
main-class entry and there is an association set up.
See http://mindprod.com/jgloss/associations.html

Hi Roedy:

"Executable" files aren't a strict subset of "binary" files -- ".bat" files
are executable and are plain-text on Windows, shell and perl scripts are
likewise on *nix. The two categories seem to me to be orthagonal.

Cheers!

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top