Difference between Java and Java Script?

Joined
Sep 3, 2009
Messages
132
Reaction score
3
Points
18
Location
Houston, Texas
Your Mac's Specs
MacBook Pro.
Can someone tell me, and for the benefits of others, what the difference is between Java and Java script. Please don't tell me it's like the difference between a Ford and a BMW. Has no meaning to me. And how I can tell what the heck I've got on my machine? Also how I can upgrade to the latest - whatever - so my machine doesn't get all nasty.

While many on this site bad mouth Flash and Java, I don't think ANYONE, not one swing richard, can do without both of these programs. Just too many sites use it. I, and so would others, would be dead in the water without them. So I'm going to have to make do and have them installed. I don't care what anyone says. No way our web experience would be the same without them. Until something better come along,that's a fact.

So what's the best way to do so. Be gentle for my sake and others. Hold us by our hand and leads us gently through the maze.

2012 Jan. Mac Pro Book w/Mountain Lion. i5 intel CPU, 4 RAM.
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Not a rumor or report subject. Moved here to the correct forum.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,734
Reaction score
2,059
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Java is a object oriented programming language that gets compiled to an intermediary state and then machine compiled of the target it's executing on. Java applications need the Java VM own the target to run. JavaScript is a scripting language used, primarily, in browsers. Java can be used within browsers for full applications as well, but it can be run on any device.

For example, Andorid is a Java framework that runs within a VM on a Linux host.

Visit Adobe.com/flash to upgrade to the latest version of Flash and only install/enable Java if to have a site that is asking for it.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
No way our web experience would be the same without them. Until something better come along,that's a fact.
I, and many others, beg to differ. Until a recent project came up, I hadn't used a Java plugin in months (possibly years). It is entirely possible to avoid it. Flash on the other hand is a little harder to elude especially if you watch streaming video since it is the simplest way to ensure cross platform compatibility.

So, the differences between JS and Java. Raz0r covered the technical details well so I won't dwell on those. Simply put - they differ in just about every way imaginable from the perspective of an end user (for coders, there are syntactic similarities). Java is a runtime that lets you run Java applications which themselves can run as a client application or as an applet (a "mini" application that runs in the browser). In short, you can think of Java as a translator for applications written in Java, translating the code into applications that accomplish something on your machine.

Javascript, despite sharing "java," is an entirely different beast. It runs only in the browser and can only manipulate web content (and only content on the same domain). The browser acts as the security framework and runtime environment for it and from a security standpoint (to the best of my knowledge), is considerably better (though not perfect) than Java is.
 

bobtomay

,
Retired Staff
Joined
Dec 22, 2006
Messages
26,561
Reaction score
677
Points
113
Location
Texas, where else?
Your Mac's Specs
15" MBP '06 2.33 C2D 4GB 10.7; 13" MBA '14 1.8 i7 8GB 10.11; 21" iMac '13 2.9 i5 8GB 10.11; 6S
Now that that's clear as mud to us non-programming geeks...

Guess the main thing I got here is that a Java app can run an application in the OS and can do pretty much anything on your system you've allowed it to do (or not allowed), whereas a Javascript can only run in the browser - hence, can not affect your local machine outside the browser?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Guess the main thing I got here is that a Java app can run an application in the OS and can do pretty much anything on your system you've allowed it to do (or not allowed), whereas a Javascript can only run in the browser - hence, can not affect your local machine outside the browser?
You got it. Java applications can act like any other desktop applications. You can use Java text editors, games, chat clients, etc. However, unlike other apps that contain native (machine) code, Java apps require the Java runtime installed. Why would you want to run something just to run an app? Well, from a developers perspective, this is a very attractive option. Let's look at an example. If you write the next best game and you want to support Windows, OS X and Linux, you'd have to write it and then subsequently compile it on each platform, ensuring that the code works on each. That can be a time consuming and tedious process. Java removes this difficulty. If one were to write this game in Java, they can compile it on any supported platform and it will run, without any change whatsoever, on the others. So, if I write a Java app entirely on my Mac, I know for a fact that it will run on a Windows machine without any changes. If I went the "native" route, I'd have to get access to a Windows machine, compile it there and hope for the best. In short, the Java runtime does all the complicated and tedious work for me.

Javascript is a web browser specific language. You can only use it in a browser and it can only interact with content on the web (and in many cases, only content on the same domain). You cannot create desktop applications since the only things that can run Javascript are browsers.
 
C

chas_m

Guest
Lots of people -- including every one of the 100 million plus iOS users -- get along without either Java or Flash just fine.

I haven't used either on my Mac for months, though I keep both up to date "just in case."
 
Joined
May 19, 2009
Messages
8,428
Reaction score
295
Points
83
Location
Waiting for a mate . . .
Your Mac's Specs
21" iMac 2.9Ghz 16GB RAM - 10.11.3, iPhone6s & iPad Air 2 - iOS 9.2.1, ATV 4Th Gen tvOS, ATV3
Lots of people -- including every one of the 100 million plus iOS users -- get along without either Java or Flash just fine.

Not particulary here. The latest 2 Keynotes that where streamed i havnt been in a situation where i had my MBP with me, only iPhone, and for good half hour i looked everywhere to see how i could run Flash on my iPhone, and i now have the excellent little browser called Skyfire that will help others looking to play Flash on your iPhone.
With 17 000 000 downloads, and im guessing so they cpould use it to watch flash, that will drop you guesstimate Chas to 83 000 000ish users ;)
 
C

chas_m

Guest
Gave Skyfire a spin. Unacceptably slow and just does what the web site itself ought to be doing -- providing an HTML5 or other alternative.

I'm sure there are some websites out there that are so dependent on Flash that they won't work otherwise -- but unless their name is starting with Adobe, they're committing commercial suicide if you ask me.

Still, this is getting off track. The question was about JavaScript and Java, not really Flash. Bottom line is that JS isn't perfect but its generally safe to use. Java can be (and automatically is) disabled if you don't happen to run across any sites that use it after a while, so again not much of a concern.

If you DO need Java for your web browsing or standalone applications, update to the latest version and cross your fingers that this time they have in fact fixed the security holes.
 
Joined
Jul 30, 2009
Messages
7,294
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
If I'm not mistaken, both Java and Javascript run in the background. So, the only way you know they're not in use is if you have them disabled. Otherwise, you can assume they are in use, but you don't ever see that on your screen. Is that correct?

I know I can disable Javascript in my Safari preferences. I'm not sure how to disable Java.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Not quite. Javascript runs "behind the scenes" so to speak in that it's part of the normal render process but Java is very much "in your face" if it's being used as an applet.

Java can be disabled by unchecking the checkbox above the disable Javascript one. ;)
 
C

chas_m

Guest
Please note that disabling JavaScript will *drastically* change your ability to use most websites. I really can't recommend that you do that.
 
Joined
Jul 30, 2009
Messages
7,294
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
Not quite. Javascript runs "behind the scenes" so to speak in that it's part of the normal render process but Java is very much "in your face" if it's being used as an applet.

Ok, but I don't ever see a Java logo on the screen or icon in my Dock. How then is it "in my face"?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
"In my face" was used because, at the time, I lacked a better description.

Java will actually show itself in a user friendly fashion and appear as a viewable object. Try this - create a word cloud using that and then you'll see a Java applet load. This is what I mean by "in your face" - it's present and obvious. This is different from Javascript which, although present on 95% of webpages, never really seems to differentiate itself from the banal routines of browsing - it's "just there."
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top