SlideShare une entreprise Scribd logo
1  sur  31
Intro to Java 5-8 and Eclipse 
11/16/14 
Jeanne Boyarsky 
Programming Mentor FRC Team 694 
Twitter @jeanneboyarsky 
Blog: http://www.selikoff.net 
Moderator on Java forums at: 
http://www.coderanch.com
Pause for Commercial 
My first book:
Installing Eclipse 
 Eclipse Luna 4.4 
+ plugins 
https://www.eclipse.org/downloads/ 
Eclipse is used more 
“in the real world” 
than NetBeans 
FIRST recommends C/C++ 
edition. (I used the Java 
edition and things seem fine)
Eclipse Version Q&A 
 Can I use an older version of Eclipse? 
It will not support Java 8 syntax additions or 
the FRC plugins.. 
 When is Eclipse released? 
Eclipse releases come out on the fourth 
Wednesday of June. 
Release Name Version Java supported 
June 2012 Juno 4.2 Java 6 (also known as 1.6) 
June 2013 Kepler 4.3 Java 7 (also known as 1.7) 
June 2014 Luna 4.4 Java 8 (also known as 1.8)
Eclipse - Perspectives 
 Eclipse has different “perspectives” (sets of views) 
- Java and Resource 
- Git/Svn and Team Synchronization
Eclipse - Views 
 Views are screen elements 
- Package explorer 
- Problems 
- Tasks – used for code with //TODO 
- Console - output 
 To add: 
 Window > Show view > Console
Tip: Configure contents
Tip: Save launch configuration 
 Run as > ___ …. lets you enter options 
 On common tab can save those options 
 Can even put them in SVN/Git because just a file
Tip: Show hidden files 
 Filter 
 Uncheck 
Ex: .classpath
Tip: Variables 
 Built in: Use classpath variables for the FRC libraries so 
no changes to project on different computers
Eclipse – Autocomplete 
 Control + space
Configuring FRC Eclipse Plugin 
 Enter your team number in Eclipse global preferences 
- Windows > Preferences on Windows/Linux 
- Eclipse > Preferences on Mac 
- Note difference between global and project 
preferences
Creating a new project 
 Just like NetBeans, create a new project
More Eclipse 
 Create a class 
 Force a rebuild 
 Update the classpath 
 Look at errors 
 Sync package explorer with code 
 Compact list 
 Outline view
Running the Ant script 
 Right click build.xml - Run As 
 Or run link up top 
Note: Eclipse projects do not build using Ant automatically, 
they have a .classpath file for the classpath
How to migrate NetBeans project? 
 There isn't a generic way 
 I recommend: 
– Create a new Eclipse project 
– Copy the source code from the 
NetBeans source directory 
– Commit to version control
Installing Java 
 Java Platform (JDK) 8 
Not the micro 
edition anymore! 
(Or) 
http://www.oracle.com/technetwork/java/javase/downloads/i 
ndex.html
Java Version Q&A 
 Why doesn't Java know how to count? The 
versions go 1.1, 1.2, 1.3, 1.4, 5, 6, 7, 8 
Blame marketing! 
 What's the difference between Java Micro 
Edition (used by FRC until 2014) and the 
“small memory” version (used by FRC starting 
in 2015)? 
Java Micro Edition didn't have a lot of the built in 
Java functions that you can now use.
Java – “New” Features 
 This presentation is not a complete list. 
 Features most likely needed for FRC programming. 
 Includes: 
– Non-micro APIs from Java 1.4 (and below) 
– Java 5 new features 
– Java 7 new features 
– Java 8 new features 
– (Java 6 didn't have much)
Java 1.4 non-Micro APIs 
 java.util.ArrayList – like an array, but grows dynamically 
(faster than a Vector) 
 java.lang.Math – more methods 
 java.util.Properties – read file in format key=value 
(example in Java 7 section)
Java 5 – Generics/Autoboxing 
 Generics – you specify the type of the ArrayList and the 
compiler tells you if you use it wrong 
 Autoboxing – Java converts primitives (int, double, etc) to 
Objects and back for you
Java 5 – Enhanced for loop 
 Which is easier to read/write? 
 Can use for array, ArrayList and more
Java 5 – Static imports 
 Don't have to write Ports.X over and over and ...
Java 7 – Diamond Operator 
 Less typing:
Java 7 - Underscores 
 Make long numbers easier to read during the rush to 
change code between matches:
Java 7 – Reading a file 
 NIO.2 makes reading a file (or network connection or the 
like) easier. 
Also, now that we are on Java Standard Edition you 
can use open source APIs such as 
http://commons.apache.org/proper/commons-io/ 
Which lets you code: 
String s = FileUtils.readFileToString(file);
Java 7 – try with resources 
 Which is easier to read/write?
Java 8 
 Lambdas and functional programming (way too much to 
cover in one slide) 
 Consider whether you want to use this style of 
programming when training your new team members. 
 Like Groovy – might be less clear at first. 
 Examples: 
new Thread(() -> System.out.println(“foo”)) 
words.sort ((a,b) -> a.length() – b.length())
Multi-threading 
 Remember we have 2 CPUs now. 
 What can the second one do? 
– Vision 
– Logging 
– Long running calculations 
– Poll a sensor until some event happens 
– Use your imagination!
Questions 
 About Java or Eclipse: 
– Friendly forums for those new (or not 
new) to Java 
– http://www.coderanch.com 
 For FRC specific questions: 
– After the 2014-2015 plugins launch 
– http://www.chiefdelphi.com
References 
 Blog posts from Championships: 
- http://www.selikoff.net/2014/04/25/first-wpilib-in-2015/ 
 How to get around the problem launching 
Eclipse on a Mac: 
http://www.selikoff.net/2013/06/29/eclipse-kepler-4-3-mac/

Contenu connexe

Tendances (20)

The Java Story
The Java StoryThe Java Story
The Java Story
 
Chapter 1 introduction to java technology
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technology
 
Java introduction
Java introductionJava introduction
Java introduction
 
Java notes
Java notesJava notes
Java notes
 
Appium & Robot Framework
Appium & Robot FrameworkAppium & Robot Framework
Appium & Robot Framework
 
Java introduction
Java introductionJava introduction
Java introduction
 
Java programming course for beginners
Java programming course for beginnersJava programming course for beginners
Java programming course for beginners
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machine
 
Features of JAVA Programming Language.
Features of JAVA Programming Language.Features of JAVA Programming Language.
Features of JAVA Programming Language.
 
Java byte code presentation
Java byte code presentationJava byte code presentation
Java byte code presentation
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Java basics
Java basicsJava basics
Java basics
 
JVM
JVMJVM
JVM
 
Learn Java Part 1
Learn Java Part 1Learn Java Part 1
Learn Java Part 1
 
Introduction to java technology
Introduction to java technologyIntroduction to java technology
Introduction to java technology
 
Java Virtual Machine - Internal Architecture
Java Virtual Machine - Internal ArchitectureJava Virtual Machine - Internal Architecture
Java Virtual Machine - Internal Architecture
 
Java
JavaJava
Java
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
 
Chapter 1. java programming language overview
Chapter 1. java programming language overviewChapter 1. java programming language overview
Chapter 1. java programming language overview
 

En vedette

2015 nyc-spin-collective-ownership
2015 nyc-spin-collective-ownership2015 nyc-spin-collective-ownership
2015 nyc-spin-collective-ownershipJeanne Boyarsky
 
Throw Away all the Rules: Now What Process do you Follow?
Throw Away all the Rules: Now What Process do you Follow?Throw Away all the Rules: Now What Process do you Follow?
Throw Away all the Rules: Now What Process do you Follow?Jeanne Boyarsky
 
My aiesec.net for alumni tutorial pt1 final
My aiesec.net for alumni tutorial pt1 finalMy aiesec.net for alumni tutorial pt1 final
My aiesec.net for alumni tutorial pt1 finalaiesecalumni
 
My aiesec.net for alumni tutorial pt2final
My aiesec.net for alumni tutorial pt2finalMy aiesec.net for alumni tutorial pt2final
My aiesec.net for alumni tutorial pt2finalaiesecalumni
 
Capitalizing on alumni
Capitalizing on alumniCapitalizing on alumni
Capitalizing on alumniaiesecalumni
 
National history day
National history dayNational history day
National history dayewaddington
 
Nhd slideshow 2012
Nhd slideshow 2012Nhd slideshow 2012
Nhd slideshow 2012ewaddington
 
Creation of alumni associations
Creation of alumni associationsCreation of alumni associations
Creation of alumni associationsaiesecalumni
 
2016 first-champs-java-cert
2016 first-champs-java-cert2016 first-champs-java-cert
2016 first-champs-java-certJeanne Boyarsky
 

En vedette (20)

2015 nyc-spin-collective-ownership
2015 nyc-spin-collective-ownership2015 nyc-spin-collective-ownership
2015 nyc-spin-collective-ownership
 
FTC 2015-2016 Judging
FTC 2015-2016 JudgingFTC 2015-2016 Judging
FTC 2015-2016 Judging
 
Throw Away all the Rules: Now What Process do you Follow?
Throw Away all the Rules: Now What Process do you Follow?Throw Away all the Rules: Now What Process do you Follow?
Throw Away all the Rules: Now What Process do you Follow?
 
2016 java8-cert-intro
2016 java8-cert-intro2016 java8-cert-intro
2016 java8-cert-intro
 
FTC Robot C to Java
FTC Robot C to JavaFTC Robot C to Java
FTC Robot C to Java
 
2016 java9-how-make-qus
2016 java9-how-make-qus2016 java9-how-make-qus
2016 java9-how-make-qus
 
My aiesec.net for alumni tutorial pt1 final
My aiesec.net for alumni tutorial pt1 finalMy aiesec.net for alumni tutorial pt1 final
My aiesec.net for alumni tutorial pt1 final
 
My aiesec.net for alumni tutorial pt2final
My aiesec.net for alumni tutorial pt2finalMy aiesec.net for alumni tutorial pt2final
My aiesec.net for alumni tutorial pt2final
 
Capitalizing on alumni
Capitalizing on alumniCapitalizing on alumni
Capitalizing on alumni
 
Weathergrams
WeathergramsWeathergrams
Weathergrams
 
Food r ead
Food r eadFood r ead
Food r ead
 
E read
E readE read
E read
 
Digital tools
Digital toolsDigital tools
Digital tools
 
Nhd 2013
Nhd 2013Nhd 2013
Nhd 2013
 
National history day
National history dayNational history day
National history day
 
Nhd slideshow 2012
Nhd slideshow 2012Nhd slideshow 2012
Nhd slideshow 2012
 
Mirza
MirzaMirza
Mirza
 
Creation of alumni associations
Creation of alumni associationsCreation of alumni associations
Creation of alumni associations
 
2016 java9-how-make-qus
2016 java9-how-make-qus2016 java9-how-make-qus
2016 java9-how-make-qus
 
2016 first-champs-java-cert
2016 first-champs-java-cert2016 first-champs-java-cert
2016 first-champs-java-cert
 

Similaire à Intro to Java 5-8 and Eclipse for FRC Programming

Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-librariesIcsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-librariesICS User Group
 
Eclipse Overview
Eclipse Overview Eclipse Overview
Eclipse Overview Lars Vogel
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and ObjectsPrabu U
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel Fomitescu
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importancenishajj
 
212 kuliah 01 pengenalan pemrograman berorientasi objek (java)
212 kuliah 01   pengenalan pemrograman berorientasi objek (java)212 kuliah 01   pengenalan pemrograman berorientasi objek (java)
212 kuliah 01 pengenalan pemrograman berorientasi objek (java)yuan99
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...Paul Withers
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentationdhananajay95
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
 

Similaire à Intro to Java 5-8 and Eclipse for FRC Programming (20)

Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-librariesIcsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
 
01 spring-intro
01 spring-intro01 spring-intro
01 spring-intro
 
Eclipse Overview
Eclipse Overview Eclipse Overview
Eclipse Overview
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importance
 
212 kuliah 01 pengenalan pemrograman berorientasi objek (java)
212 kuliah 01   pengenalan pemrograman berorientasi objek (java)212 kuliah 01   pengenalan pemrograman berorientasi objek (java)
212 kuliah 01 pengenalan pemrograman berorientasi objek (java)
 
perl-java
perl-javaperl-java
perl-java
 
perl-java
perl-javaperl-java
perl-java
 
java new technology
java new technologyjava new technology
java new technology
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
.NET RDF APIs
.NET RDF APIs.NET RDF APIs
.NET RDF APIs
 
Java 9 Features
Java 9 FeaturesJava 9 Features
Java 9 Features
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
 
java slides
java slidesjava slides
java slides
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 

Plus de Jeanne Boyarsky

Plus de Jeanne Boyarsky (12)

Pathways intro january 2018
Pathways intro   january 2018Pathways intro   january 2018
Pathways intro january 2018
 
Pathways path-comparison
Pathways path-comparisonPathways path-comparison
Pathways path-comparison
 
2017 stuysplash-build-tools
2017 stuysplash-build-tools2017 stuysplash-build-tools
2017 stuysplash-build-tools
 
Virtual scrum
Virtual scrumVirtual scrum
Virtual scrum
 
Ignite java-robots
Ignite java-robotsIgnite java-robots
Ignite java-robots
 
2017 JavaOne Mutation Testing Session
2017 JavaOne Mutation Testing Session2017 JavaOne Mutation Testing Session
2017 JavaOne Mutation Testing Session
 
java 8 Hands on Workshop
java 8 Hands on Workshopjava 8 Hands on Workshop
java 8 Hands on Workshop
 
2017 java9-spring-days
2017 java9-spring-days2017 java9-spring-days
2017 java9-spring-days
 
Pathways overview
Pathways overviewPathways overview
Pathways overview
 
2016 java-sig-mutation-testing
2016 java-sig-mutation-testing2016 java-sig-mutation-testing
2016 java-sig-mutation-testing
 
Ftc judging
Ftc judgingFtc judging
Ftc judging
 
2016 qcon-virtual-scrum
2016 qcon-virtual-scrum2016 qcon-virtual-scrum
2016 qcon-virtual-scrum
 

Dernier

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Dernier (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

Intro to Java 5-8 and Eclipse for FRC Programming

  • 1. Intro to Java 5-8 and Eclipse 11/16/14 Jeanne Boyarsky Programming Mentor FRC Team 694 Twitter @jeanneboyarsky Blog: http://www.selikoff.net Moderator on Java forums at: http://www.coderanch.com
  • 2. Pause for Commercial My first book:
  • 3. Installing Eclipse  Eclipse Luna 4.4 + plugins https://www.eclipse.org/downloads/ Eclipse is used more “in the real world” than NetBeans FIRST recommends C/C++ edition. (I used the Java edition and things seem fine)
  • 4. Eclipse Version Q&A  Can I use an older version of Eclipse? It will not support Java 8 syntax additions or the FRC plugins..  When is Eclipse released? Eclipse releases come out on the fourth Wednesday of June. Release Name Version Java supported June 2012 Juno 4.2 Java 6 (also known as 1.6) June 2013 Kepler 4.3 Java 7 (also known as 1.7) June 2014 Luna 4.4 Java 8 (also known as 1.8)
  • 5. Eclipse - Perspectives  Eclipse has different “perspectives” (sets of views) - Java and Resource - Git/Svn and Team Synchronization
  • 6. Eclipse - Views  Views are screen elements - Package explorer - Problems - Tasks – used for code with //TODO - Console - output  To add:  Window > Show view > Console
  • 8. Tip: Save launch configuration  Run as > ___ …. lets you enter options  On common tab can save those options  Can even put them in SVN/Git because just a file
  • 9. Tip: Show hidden files  Filter  Uncheck Ex: .classpath
  • 10. Tip: Variables  Built in: Use classpath variables for the FRC libraries so no changes to project on different computers
  • 11. Eclipse – Autocomplete  Control + space
  • 12. Configuring FRC Eclipse Plugin  Enter your team number in Eclipse global preferences - Windows > Preferences on Windows/Linux - Eclipse > Preferences on Mac - Note difference between global and project preferences
  • 13. Creating a new project  Just like NetBeans, create a new project
  • 14. More Eclipse  Create a class  Force a rebuild  Update the classpath  Look at errors  Sync package explorer with code  Compact list  Outline view
  • 15. Running the Ant script  Right click build.xml - Run As  Or run link up top Note: Eclipse projects do not build using Ant automatically, they have a .classpath file for the classpath
  • 16. How to migrate NetBeans project?  There isn't a generic way  I recommend: – Create a new Eclipse project – Copy the source code from the NetBeans source directory – Commit to version control
  • 17. Installing Java  Java Platform (JDK) 8 Not the micro edition anymore! (Or) http://www.oracle.com/technetwork/java/javase/downloads/i ndex.html
  • 18. Java Version Q&A  Why doesn't Java know how to count? The versions go 1.1, 1.2, 1.3, 1.4, 5, 6, 7, 8 Blame marketing!  What's the difference between Java Micro Edition (used by FRC until 2014) and the “small memory” version (used by FRC starting in 2015)? Java Micro Edition didn't have a lot of the built in Java functions that you can now use.
  • 19. Java – “New” Features  This presentation is not a complete list.  Features most likely needed for FRC programming.  Includes: – Non-micro APIs from Java 1.4 (and below) – Java 5 new features – Java 7 new features – Java 8 new features – (Java 6 didn't have much)
  • 20. Java 1.4 non-Micro APIs  java.util.ArrayList – like an array, but grows dynamically (faster than a Vector)  java.lang.Math – more methods  java.util.Properties – read file in format key=value (example in Java 7 section)
  • 21. Java 5 – Generics/Autoboxing  Generics – you specify the type of the ArrayList and the compiler tells you if you use it wrong  Autoboxing – Java converts primitives (int, double, etc) to Objects and back for you
  • 22. Java 5 – Enhanced for loop  Which is easier to read/write?  Can use for array, ArrayList and more
  • 23. Java 5 – Static imports  Don't have to write Ports.X over and over and ...
  • 24. Java 7 – Diamond Operator  Less typing:
  • 25. Java 7 - Underscores  Make long numbers easier to read during the rush to change code between matches:
  • 26. Java 7 – Reading a file  NIO.2 makes reading a file (or network connection or the like) easier. Also, now that we are on Java Standard Edition you can use open source APIs such as http://commons.apache.org/proper/commons-io/ Which lets you code: String s = FileUtils.readFileToString(file);
  • 27. Java 7 – try with resources  Which is easier to read/write?
  • 28. Java 8  Lambdas and functional programming (way too much to cover in one slide)  Consider whether you want to use this style of programming when training your new team members.  Like Groovy – might be less clear at first.  Examples: new Thread(() -> System.out.println(“foo”)) words.sort ((a,b) -> a.length() – b.length())
  • 29. Multi-threading  Remember we have 2 CPUs now.  What can the second one do? – Vision – Logging – Long running calculations – Poll a sensor until some event happens – Use your imagination!
  • 30. Questions  About Java or Eclipse: – Friendly forums for those new (or not new) to Java – http://www.coderanch.com  For FRC specific questions: – After the 2014-2015 plugins launch – http://www.chiefdelphi.com
  • 31. References  Blog posts from Championships: - http://www.selikoff.net/2014/04/25/first-wpilib-in-2015/  How to get around the problem launching Eclipse on a Mac: http://www.selikoff.net/2013/06/29/eclipse-kepler-4-3-mac/