473,473 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

The difference between Java and JavaScript

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
9 4233
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
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
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
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
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
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steven Green | last post by:
I have a java app at work I used when I had Windows 98 and never had a problem. I did a clean install of Windows XP and of course Java was not included. I went to Sun, download Java 2 Runtime...
2
by: Kkiely | last post by:
what is the difference?
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
7
by: Oleg Konovalov | last post by:
Hi, I am trying to pass a bunch of checked checkboxes (Javascript array) from page1 to the Java action class on subsequent web page (page2). (on page 1 I have a bunch of DB rows with a checkbox,...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
4
by: Khan | last post by:
hi, i'm writing java code inside <body> tag of java script file. all the java code is executing at frame startup. how can i call that java code only when i click on a button. I can call jscript...
9
by: misdst23 | last post by:
Hi, I know I can call a static java method within javascript by using the <% ... %tags. But how can pass a javascript variable ? function thefunction() { var = javascriptvariable ;
2
by: Navodit | last post by:
Hi I am new to Javascript and am not sure what is the difference between the following two statements: <script type="text/javascript"> ..... </script>
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.