By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

The difference between Java and JavaScript

P: n/a
TWJava and JavaScript are two different animals. ;-)

DHLOK Tom.
DHL>
DHLDefine the two.
DHL>
DHLTo me Java is the software that interprets and executes
DHLJavaScripts and Java Applets. [...]

It's a common conflation, but Java and JavaScript are two entirely
different programming languages. The language that you refer to, the
machine-independent language that runs in a virtual machine (using a
compiled bytecode) and that can be used standalone as well as to
provide applets in web browsers, is Java, for which one uses the Sun
Java Virtual Machine (or someone else's JVM). The other language,
JavaScript, is a script language that is only of real use in web
browsers and that cannot be used for standalone programs. Java was
invented by Sun. JavaScript was invented by Netscape.

I'm sure that there's a Frequently Given Answer on this subject
somewhere ...

.... ah, yes. Here you go:

<URL:http://dannyg.com./ref/javavsjavascript.html>
<URL:http://wdvl.internet.com./WDVL/FAQ/WWW.html>
<URL:http://developer.irt.org/script/477.htm>
<URL:http://www.cacs.louisiana.edu./~mgr/404/burks/language/java/index.htm>
<URL:http://ftp.ggi-project.org./javafaq/javafaq.html#xtocid90007>
<URL:http://www.herts.ac.uk./ltdu/technology/what_is_javascript.html>
<URL:http://clarionmag.com/cmag/v1/v1n8understandingjava.html>

Jul 11 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Hi Everyone,
Java Virtual Machine (or someone else's JVM). The other language,
JavaScript, is a script language that is only of real use in web
browsers and that cannot be used for standalone programs. Java was
invented by Sun. JavaScript was invented by Netscape.
XUL uses JavaScript for its applications. Most Mozilla application are
written in XUL, thus use JavaScript. This also includes its mailer and
calendar applications. Its also used as a server-side language. So,
JavaScript is used outside the browser, though its mainly known for use
in the browser.

Vincent
Jul 11 '06 #2

P: n/a
J de Boyne Pollard wrote:
The other language,
JavaScript, is a script language that is only of real use in web
browsers and that cannot be used for standalone programs.
As I'm sure others will point out while ridiculing you, this is of course
not true.
Javascript can be used as a server-side language, as a scripting language
component of any app one wishes to write, and even for stand-alone programs
using WSH, for example.

However its most common use, by far, is in scripting web pages in browsers.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jul 11 '06 #3

P: n/a
Matt Kruse wrote:
J de Boyne Pollard wrote:
>The other language,
JavaScript, is a script language that is only of real use in web
browsers and that cannot be used for standalone programs.

As I'm sure others will point out while ridiculing you, this is of course
not true.
Javascript can be used as a server-side language, as a scripting
language component of any app one wishes to write,
Indeed it is probably the scripting language of choice for anyone
wanting to add a scripting facility to any application as interpreters
are available as open source code (and commercially), leaving only the
task of integrating them with the application code, and you can
leverage existing understanding of the javascript language (with the
probable alternative being to invent your own script language and for
all the users (who want to script the application) to learn it).
and even for stand-alone programs
using WSH, for example.
<snip>

That would probably depend on what you classed as "stand-alone". I
would say that JScript in WSH will not result in a stand alone program
as the script language is still scripting a host and that host is
providing all the file access and any UI/GUI (if possibly indirectly
through ActiveX components).

The ability to directly launch a 'program' written with JScript using
WSH from a windows desktop is not quite enough for me to call the
result 'stand-alone'.

Richard.

Jul 11 '06 #4

P: n/a
Richard Cornford wrote:
>and even for stand-alone programs
using WSH, for example.
That would probably depend on what you classed as "stand-alone". I
would say that JScript in WSH will not result in a stand alone program
as the script language is still scripting a host and that host is
providing all the file access and any UI/GUI (if possibly indirectly
through ActiveX components).
The ability to directly launch a 'program' written with JScript using
WSH from a windows desktop is not quite enough for me to call the
result 'stand-alone'.
"Stand-alone" is a relative/vague term. But are Perl scripts or Java apps
"stand-alone"? They both require an interpreter.

For that matter, what about .exe files which require DLL's to be installed
on the windows computer? Are they stand-alone? How about .exe files with
everything self-contained? They still make requests to the OS for file
services, etc, and would be worthless without the correct underlying OS.

I suppose if you want to get technical, the only truly "stand-alone" code is
op codes stored in memory for a specific chip. But even that relies on
hardware to transfer the instructions to the chip!

I think it would be fair to say that running javascript in "stand-alone"
mode requires an interpretter, much like most other scripting languages, and
that interpretter is commonly found on most computers these days.

But beyond that, I get bored with semantics ;)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jul 11 '06 #5

P: n/a
From: "J de Boyne Pollard" <j.**************@tesco.net>

TW>Java and JavaScript are two different animals. ;-)
|
DHL>OK Tom.
DHL>>
DHL>Define the two.
DHL>>
DHL>To me Java is the software that interprets and executes
DHL>JavaScripts and Java Applets. [...]
|
| It's a common conflation, but Java and JavaScript are two entirely
| different programming languages. The language that you refer to, the
| machine-independent language that runs in a virtual machine (using a
| compiled bytecode) and that can be used standalone as well as to
| provide applets in web browsers, is Java, for which one uses the Sun
| Java Virtual Machine (or someone else's JVM). The other language,
| JavaScript, is a script language that is only of real use in web
| browsers and that cannot be used for standalone programs. Java was
| invented by Sun. JavaScript was invented by Netscape.
|
| I'm sure that there's a Frequently Given Answer on this subject
| somewhere ...
|
| ... ah, yes. Here you go:
|
| <URL:http://dannyg.com./ref/javavsjavascript.html>
| <URL:http://wdvl.internet.com./WDVL/FAQ/WWW.html>
| <URL:http://developer.irt.org/script/477.htm>
| <URL:http://www.cacs.louisiana.edu./~mgr/404/burks/language/java/index.htm>
| <URL:http://ftp.ggi-project.org./javafaq/javafaq.html#xtocid90007>
| <URL:http://www.herts.ac.uk./ltdu/technology/what_is_javascript.html>
| <URL:http://clarionmag.com/cmag/v1/v1n8understandingjava.html>

Thanx all for the information concernming the differences and similarity in the two
languages. I can only hope to soak in tghe information the next time such a discussion
comes my way. :-)

--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm
Jul 11 '06 #6

P: n/a
JdeBPThe other language, JavaScript, is a script language that is
JdeBPonly of real use in web browsers and that cannot be used
JdeBPfor standalone programs.

MKAs I'm sure others will point out while ridiculing you,
MKthis is of course not true.

I doubt it. Others will have actually read the 7 articles that I
linked to in my original message and noticed that they all say this, in
one way or another. The very first one even says it, pretty much word
for word, in boldface, so even speed-readers would find it hard to
miss.

MKJavascript can be used as [...] a scripting languagecomponent

Which does not equate to "standalone", nor to "real use".

MK>[...] for stand-alone programs using WSH, for example.

That's stretching the concept of "standalone" a long way.

Jul 11 '06 #7

P: n/a
MKJavascript can be used [...]as a scripting language
MKcomponent of any app one wishes to write, [...]

RCIndeed it is probably the scripting language of choice for anyone
RCwanting to add a scripting facility to any application [...]

In actuality, though, it isn't. In my experience, the scripting
languages of choice, that people incorporate into applications by
linking the script interpreters in, are REXX and Tcl.

RCthe probable alternative being to invent your own script
RClanguage and for all the users (who want to script the
RCapplication) to learn it

In actuality, the alternative is to use other scripting languages whose
interpreters have APIs, such as REXX and Tcl, which are also already
widely understood by users.

Jul 11 '06 #8

P: n/a
"J de Boyne Pollard" <j.**************@tesco.netwrites:
JdeBPThe other language, JavaScript, is a script language that is
JdeBPonly of real use in web browsers and that cannot be used
JdeBPfor standalone programs.

MKAs I'm sure others will point out while ridiculing you,
MKthis is of course not true.

I doubt it. Others will have actually read the 7 articles that I
linked to in my original message and noticed that they all say this, in
one way or another. The very first one even says it, pretty much word
for word, in boldface, so even speed-readers would find it hard to
miss.
Even JavaScript (the language created by Netscape Corp and currently
being developed by the Mozilla people) was originally also used in
Netscape's web server as a scripting language, so it's definitly
of real use in other than web browsers.

If we include a compatible language like JScript, then it's of use in
many places through the Windows Scripting Host. This also allows
for stand-alone JScript programs using the wscript executable, which
makes JScript scripts as standalone as Perl programs.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 12 '06 #9

P: n/a
JRS: In article <11**********************@m73g2000cwd.googlegroups .com>
, dated Tue, 11 Jul 2006 05:12:04 remote, seen in
news:comp.lang.javascript, J de Boyne Pollard
<j.**************@tesco.netposted :
...
The other language,
JavaScript, is a script language that is only of real use in web
browsers and that cannot be used for standalone programs.
Javascript can be written and executed by a batch file running in a
Win32 MS-DOS Prompt, if the machine has WSH installed which is at least
usual. It has features which VBScript lacks.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98.
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm- also batprogs.htm.
Jul 12 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.