The Java Platform

 
 
What is Java Not?
 
Java is not the same thing as Javascript.
 
Types of Java Applications
 
Include:
  • Desktop applications
  • Browser applets
  • Java Webstart Applications (.jnlp files)
  • Cell phone applications (Java ME, midlets)
  • Server-side web applications
  • Used in embedded devices, robotics
  • Openoffice extensions
 
"Java" is really two things:
  1. A programming platform (JVM - Java Virtual Machine)
  2. A programming language (.java source code files)
 
The Java Compilation Process
 
See the diagram here.  A text file with java source code in it has a name that ends in ".java" (for example MyProgram.java).  You pass that text file to the java compiler (called javac).  The compiler parses the text, checks for errors, and converts the source code into bytecodes - numeric codes that represent operations the java virtual machine (JVM) understands, and data (like string values, numeric values).  The bytecode is spit out into a file with a name that ends in ".class" (like MyProgram.class).  You can then run this class file in the java virtual (using the java command line tool or applet code or another java launcher).
 
Other Programming Languages for the JVM
 
Other programming languages besides the Java programming language can be compiled to JVM bytecodes, too, and run on the Java platform.
 
Some of these languages were designed primarily for the JVM, such as java itself, JavaFX, Scala, and Groovy.
 
Others were initially designed for other platforms but were ported to run on the JVM as well, such as Ruby (JRuby), Python (Jython), Javascript (Rhino), ...
 
Comparing the Java VM to the .NET VM (CLR)
 
Microsoft came out with their own virtual machine (called the common language runtime, or CLR) and programming language that was very similar to Java (called C#, pronounced "C sharp").
 
.NET and C# have some improvements over the JVM and Java, but there are some disadvantages as well.  There were 3 main differences between the 2 platforms, but the Mono project (an open source clone of .NET) takes care of 2 of them:
  1. .NET only runs on Windows (Mono runs on Windows, Mac, & Linux)
  2. .NET is not open source (Mono is open source)
  3. You cannot create browser applets with .NET.  However the .NET Silverlight and Mono Moonlight projects do let you make applications that run in a browser, although they are perhaps not as interactive as you can do with a Java or Flash app.
(still incomplete)
 
Java vs. Flash
 
(still incomplete)
 
The java platform is free and open source.  Flash costs hundreds of dollars and is closed and proprietary (owned by Adobe).  Parts of Flash are becoming open source, however, and some free and open source development tools are becoming available.
 
Flash is also limited to only browser-based applications (although Adobe Flex can do desktop apps too now I believe).
 
Flash is more lightweight and smaller and quicker to load, although the next version of Java (Java 6 update 10) is addressing that for the Java platform.
 
Generally, if you want to do a browser-based animation or small game, Flash is most popular.  If you want to do a non-browser application, or a more complex kind of applet such as a simulation, Java may be better suited.
 
Don't fall into the trap of getting zealotrous about Java or Flash or .NET.  Don't think of one as "better" than the rest.  Think of them as different tools in your toolbox, that are better or worse for various applications and contexts.
 
 

Class Activity & Assignment #1

 
At this point we did the Greenfoot quick intro.  That was the first assignment.
 
 
 
Groups:

Disclaimer

Any opinions expressed here, except as specifically noted, are those of the individual authors or commenters and do not necessarily represent the views or policies of the Department of Instructional Technology and Learning Sciences, the Emma Eccles Jones College of Education and Human Services, or Utah State University.