Java Newbie: Cross-platform compatibility?

Baker

Solid State Member
Messages
19
Location
USA
Hi guys,

So I've been studying on Java for a few days now. I'm a newbie. The only other work I've ever done with programming is Lua, which is probably considered a low to mid level program language, but the knowledge has helped me alot despite the languages being completely different.
I already understand the concept of conditional statements, subroutines (called functions in Lua) loops, variables, etc. So basically, I understand some concepts, which is helpful, but not any actual Java... yet.

There is just one thing that I want to get a little bit of extra understanding of: Java compatibility with other computers.


Okay, cutting to the chase.

I have several questions:

1.) How do java apps, like online Java video games for example, work on anybodies computer? Is there some sort of compiler built in, or is it an interpretor? (Some specific examples are RuneScape, Minecraft, etc)


2.) The guide I am reading says that this is because every type of computer has it's own machine language, and Java has to be compiled differently for each. Where do computer machine languages vary? Is it dependant upon it's operating system, brand, or each individual computer?


Thank you for your time in reading this thread. I hope somebody can help me. If you can only answer one of my questions, this is perfectly fine.
 
First off, I'd like to point out that if by guide you mean a website, please do yourself a favor and stop right now. :D Online tutorials are awesome for a lot of things, and are one of the reasons why the internet is such a beautiful resource. However, when it comes to actually building a foundation to learn on (which is what you say you're doing), such as a programming language, tuts simply won't give you enough to work with. You would be far better off investing in a textbook of some kind. Head First is excellent, or you could also use the For Dummies series. Now for your question:

Java is brilliant with cross-platform capabilities! That's actually what makes it so attractive among developers, and why a lot of games for phones and tablets use it. I think the manual was talking more about how the JRE works, having to handle the JARs etc differently on each system. Each OS obviously has different ways of handling events. Therefore, each OS must have its own JRE installed in order for the actual JARs and object files to be the same.

This link might be a useful read to understand how Java is actually handled. This is usually also discussed in the first chapter of any textbook, which is why I suggested investing in one in the first place. :)

By the way, Safari is an excellent resource, and incredibly cheap for its value. The only downside, of course, is it's all digital so you can't write in the margines, or fill out any exercises as easily.
 
Last edited:
Thanks guys. Also, I'm not using Head First, or For Dummies. The information source I am using isn't actually a guide. It is written like a textbook. Nowhere in it does it really tell you do do anything.

I have a PDF of it: Javanotes 6.0 -- Title Page

What do you guys think of it? (It's only a 5.99 MB download, 751 pages, and I've been understanding a lot of it so far!)

The information about interpretors and compilers is between paegs 6-9.
 

I skimmed through it a little bit. It looks like quite a comprehensive introduction to Java. Seems like the Professor that wrote it uses it for his intro Java course I would assume.

That should work for getting correct information and an introduction to Java. Though it doesn't have practice questions, code challenges etc.

EDIT: Here is the Professor's Intro to Programming web page. http://math.hws.edu/eck/cs124/
It has a bunch of lab exercises and quizes there as well. Looks like a whole course online. :p

Creativity
 
Last edited:
Thanks guys. Also, I'm not using Head First, or For Dummies. The information source I am using isn't actually a guide. It is written like a textbook. Nowhere in it does it really tell you do do anything.

I have a PDF of it: Javanotes 6.0 -- Title Page

What do you guys think of it? (It's only a 5.99 MB download, 751 pages, and I've been understanding a lot of it so far!)

The information about interpretors and compilers is between paegs 6-9.

I skimmed the section in question and it seems pretty solid, you have misinterpreted what he has written. Take a look at the diagram on page 7, you can see that there is a universal compilation step that transforms the source into bytecode which is then compatible with many platforms without having to be recompiled.
 
I skimmed through it a little bit. It looks like quite a comprehensive introduction to Java. Seems like the Professor that wrote it uses it for his intro Java course I would assume.

Yeah, it looks like he's converted his textbook into HTML and PDF. When I was talking about tuts etc, I meant sites that try to teach you Java by just jumping right in with no background, and no real explanations. They can be decent as a reference, but are terrible for actually trying to learn. People who do learn from these, often have problems later. Kudos for finding a gem in the rough :D However, I would suggest, as always when learning a new language, you try to come up with exercises both that you find online and that you yourself can make up and learn from. You might even make something you can still use years from now!

And as far as games go, they'll still run through a JRE (which is the interpreter) of some kind. Usually when it's online, like RuneScape as per your example, you'll need to install a Java plug-in of some kind to work with your browser. When it's downloaded, it should just use the regular JRE for your OS.
 
Back
Top Bottom