Download presentation
Presentation is loading. Please wait.
Published byFelicity Holland Modified over 9 years ago
1
Java ACO101: Introduction to Computer Science
2
The History of Java Started out as a research project at Sun Microsystems in 1991 Code named “Green” Based on C and C++ Originally called “Oak” because its creator James Gosling had an oak tree outside his office window at Sun.
3
History of Java – part 2 They had to change the name from “Oak” to something else because it was discovered that there was already a language called “Oak”. A group of people at Sun went for coffee one day and someone suggested “Java” and it stuck. Between 1991 and 1993 the project faltered because Sun had anticipated that the smart consumer device market would grow faster than it did.
4
Java History – part 3 When the internet boomed in 1993 the project got a new life because people saw the potential to create dynamic content for the web. “Java” was officially announced in May 1995.
6
Religious discussion Java vs. C# James Gosling and Bill Joy (one of the founders of Sun Microsystems) called C# an "imitation" of Java; Gosling (originator of Java) further claimed that "[C# is] sort of Java with reliability, productivity and security deleted."
7
More religious debate Klaus Kreft and Angelika Langer (authors of a C++ streams book) stated in a blog post that "Java and C# are almost identical programming languages. Boring repetition that lacks innovation." Anders Hejlsberg (lead the C# team) has argued that C# is "not a Java clone" and is "much closer to C++" in its design.
8
Why do you care? Because you will have to decide where you are in the debate and that will inform your career path. http://www.sun.com/lawsuit/ http://www.theregister.co.uk/2010/08/13/ora cle_sues_google/ http://www.theregister.co.uk/2010/08/13/ora cle_sues_google/ http://regmedia.co.uk/2010/08/13/oracle_co mplaint_against_google.pdf http://regmedia.co.uk/2010/08/13/oracle_co mplaint_against_google.pdf
9
Technology is constantly moving forward And so you will move forward with it. I will not tell you what to think or how to be; I will only give you the information to decide for yourself.
10
Knowing Both They are so similar that – If you know Java then you pretty much know C# and knowing both will double your job opportunities. http://www.indeed.com/ Programming is one of the professions that the more you know the more you earn.
11
Runtime environments Java Java Runtime Environment – Includes the JVM and Common Code Libraries JVM = Java Virtual Machine The JRE was originally designed to support interpreted execution with final compilation as an option. The Java compiler produces Java bytecode C# Common Language Runtime The CLR is designed to execute fully compiled code. The C# compiler produces Common Intermediate Language instructions.
12
Program execution Java bytecode is loaded by the Java runtime and either interpreted directly or compiled to machine instructions and then executed C# the runtime loads Common Intermediate Language code and compiles to machine instructions on the target architecture
13
Side bar: bytecode and CIL instructions A Java programmer does not need to be aware of or understand Java bytecode at all. However, "Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer.“ – Peter Haggar IBM The same is true for CIL instructions and C#
14
We are not going that deep. If you are interested – here are some links; but this is Intro and you are not required to understand bytecode, CIL instructions or machine code on a deeper level. – http://www.ibm.com/developerworks/ibm/library /it-haggar_bytecode/ http://www.ibm.com/developerworks/ibm/library /it-haggar_bytecode/ – http://en.csharp-online.net/CIL_Instruction_Set http://en.csharp-online.net/CIL_Instruction_Set
17
Lets check to see if the JDK is installed Go to Start > Run > type “cmd” in the box to launch a command prompt – Type in the window (where the cursor is) java –version C:\Program Files\Java – Is there a folder named jdk1.6.0_21 click into the bin in that folder – C:\Program Files\Java\jdk1.6.0_21\bin – javac.exe is the compiler
18
To DIY you will need The Java SE Development Kit 6 (JDK 6) – http://www.oracle.com/technetwork/java/javase/ downloads/index.html http://www.oracle.com/technetwork/java/javase/ downloads/index.html – Read the installation instructions http://www.oracle.com/technetwork/java/javase/index -137561.html http://www.oracle.com/technetwork/java/javase/index -137561.html – Click on the Download JDK button I registered (you don’t have to) Pick your platform and click continue Click on the link provided to download the exe Save file, double click and run
19
Follow the installation wizard
20
Next
21
next
22
Close browsers
23
finish
24
This is optional
26
Hello world We havta do the tradition…. It would be just wrong to not have your first program be “Hello World” Open notepad (on a mac you can use simple text) and type this code…..
27
class myfirstjavaprog { public static void main(String args[]) { System.out.println("Hello World!"); }
28
Save as…. myfirstjavaprog.java
29
Bring up a command prompt Start > Run > cmd
30
Change the directory to the location of javac
31
Now send the location of your.java file to the compiler
32
Now go check to see if you have a.class file (you should)
33
Let’s run it – go to the location of the class (current working directory) and pass the name of the class to the Java runtime
34
Success!
35
Homework Is posted on the class portal
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.