资源预览内容
第1页 / 共24页
第2页 / 共24页
第3页 / 共24页
第4页 / 共24页
第5页 / 共24页
第6页 / 共24页
第7页 / 共24页
第8页 / 共24页
第9页 / 共24页
第10页 / 共24页
亲,该文档总共24页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
JavaHow to find, install and begin to use the Java programming language. A word or two on the history of some old fashion programming languages A small history of Java How do I install it on my computer? How do I use what I just installed? What were going to coverWhat were going to cover A short look at some old school languages, BASIC, C and C+It all begins in the sixties BASICBASICBASIC stands for Beginners All-purpose Symbolic Instruction Code. It was designed in 1963 at Dartmouth college. It was designed to make it easy for non-technical people to write computer programs. BASIC programs were like grocery lists. You told the program what you wanted to do and it did it in order.BASIC was InterpretedInterpreted. C and C+Developed in the early seventies, “C” became the de-facto language for microcomputer programming in the seventies and eighties.“C” was not interpreted, it was compiled. compiled. _Later, in the early eighties, C+ introduced object orientation to the C world. Originally called “C with Classes”, Bjarne Stroustrup developed the additions to C that, in 1985, became C+.OO is when programmers try to mimic the real world more closely and make programs act like “objects” and not just be grocery lists. So, what have we learned?1.BASIC was an interpreted programming language2.“C” was a compiled programming language 3.“C+” brought object orientation to “C” Say goodbye to the seventies and welcome to a short (but hopefully informative) history of the Java programming languageAuthentic SeventiesNerds James Gosling began developing Java beginning in 1991It was first called “Project Green” and Oak”First developed for remote cable TV boxesJames Naughton creates “HotJava” in 1995. its a web browser that lets you run “Applets”. The entire browser is written in Java.In 1998 Java 1.2 is releasedJava just released version 1.6 or J2SE 6James Gosling Circa 1971James Gosling Today Java BuzzwordsSimple Object OrientedArchitecture NeutralPortableMultithreadedHigh Performance JITBuzzwords glommed from the Core Java 2 book verbatim FREE Is Java Interpreted or Compiled? Is Java Interpreted or Compiled?BOTH!Java programs are compiled to BytecodeBytecode is then interpreted by a JVM, or Java Virtual machine. The virtual machine is what runs your programIts the JVM that cares about your Operating system, NOT THE PROGRAM!WORA - Write Once, Run Anywhere! Is Java Object Oriented? Is Java Object Oriented?YES!Every bit of code in a Java program is in a “Class”Code Reuse, Encapsulation, Polymorphism, Inheritance DUKE!Why? Who knows Downloading a Java JDKYou want a JDK, not just a JRECreate a “Temp” directory on your PC or laptopGo to http:/java.sun.comGo to the “Popular Downloads” section and select “Java SE”Select a JDK without Netbeans (Well talk about this later)Agree to the accept the use policyRight Click and Save the Offline Windows JDK to your temp dir Installing a Java JDKGo to your “Temp” dir using Windows ExplorerMake sure no other apps are running and double click the install program you just downloaded. Follow the steps.I install in C:JavaWatch fom multiple JREs and JDKs! In Windows the Registry runs the show now, not the JAVA_HOME env variable Test with a Command Prompt Window and “java version”Add C:Java”Java ver”bin to your PATH varBe sure to add “current directory” to the CLASSPATH (if you had one) Now, Lets test itDOS - Command PromptMake a directory structureType “Edit” and VoilaPSVMTest JAVAC and JAVACreate Bytecode ( the *.class file) with “Javac”Run Program with “Java” If we were lucky we got something that looks like this Help on the Webhttp:/java.sun.com/javase/6/docs/api/http:/www.javaranch.comhttp:/java.sun.com/docs/books/tutorial/http:/www.sorcon.com/java2/http:/remus.rutgers.edu/freestuffGot an Error?Just type it verbatim into Google and you usually can find the answer to your question or solve your problem.Wikipedia is a good place to get background and history On anything, and Java is no exception Remember.Java is both compiled and interpretedJava is Object Orientedhttp:/java.sun.com is Javas homeYou want the Java Development Kit (JDK) , not a JRE or J2EETake your time, use temp directories for setup filesTest with a simple “Hello World” after you installUse the Web for help (Google errors, javaranch, etc.) THANK YOUhttp:remus.rutgers.edujavaworkshopsAny questions or comments can be sent to me At biglarscs.rutgers.eduBe Good Now2007 Rutgers University & Lars Sorensen
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号