User avatar
Polydnj
Posts: 25
Joined: Wed Oct 10, 2012 1:59 am
Contact: Website

Java basic & Libraries

Sun Jan 13, 2013 4:33 pm

Hey hope everyone is doing well, so I installed java JDK on Soft-float Debian “wheezy”, it works great for what I’m learning now. If I’m sticking to the basics, should I install any libraries?

Thanks!

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: Java basic & Libraries

Sun Jan 13, 2013 6:47 pm

Well, it depends on what you are wanting to do. For example, if you want to control or sense things using the GPIO pins then you may want to use something like Pi4J (http://www.pi4j.com)

-Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: Java basic & Libraries

Sun Jan 13, 2013 6:49 pm

If you are just getting started and you do want to control things in the "physical world", here is a very simple Java project that can control power to a device. All open source :-)
http://www.savagehomeautomation.com/pro ... ights.html

-Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

User avatar
Polydnj
Posts: 25
Joined: Wed Oct 10, 2012 1:59 am
Contact: Website

Re: Java basic & Libraries

Mon Jan 14, 2013 2:48 pm

I'm practising loops, methods, classes, variable, arrays which are all standard to Java, no matter what device I use right?. I guess that the purpose of using a libraries is to communicate with other hardware, like you said "in the physical world".

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Java basic & Libraries

Mon Jan 14, 2013 3:28 pm

Polydnj wrote:I'm practising loops, methods, classes, variable, arrays which are all standard to Java, no matter what device I use right?. I guess that the purpose of using a libraries is to communicate with other hardware, like you said "in the physical world".
There are extension libraries for more complex/specialised software-only applications as well, but the default libraries (packages) that come with Java are pretty extensive to get started with. So no need for extra libraries for some time ;)

After what you listed there, I'd suggest looking into the default packages:
- java.util (collections / 'advanced data types')
- java.text (date and other formats)
- java.math (big numbers)
- java.io (file input/output)
...these are all pretty much platform independent / portable stuff.
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: Java basic & Libraries

Mon Jan 14, 2013 3:40 pm

Polydnj wrote:I'm practising loops, methods, classes, variable, arrays which are all standard to Java, no matter what device I use right?. I guess that the purpose of using a libraries is to communicate with other hardware, like you said "in the physical world".
Like -rst- said,
Libraries are not just for hardware; there are thousands of libraries out there for Java projects and most of them are software only. Libraries represent some chuck of logic that you can import into your project so you don't have to program everything yourself. For example, if your program wanted to send Tweet messages via Twitter, you could manually write all the HTTP requests and follow Twitters API or you could use a library such as Twitter4J which already does the more complicated work for you and exposes a simple Java interface for your program to consume.

If you are just getting started with Java programming, then get comfortable with the basics before trying to import third-party libraries. The JDK (Java Development Kit) includes all the language support and tons of JDK provided libraries for you to accomplish most goals.

-Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

henrik
Posts: 65
Joined: Tue Dec 18, 2012 4:24 pm

Re: Java basic & Libraries

Tue Jan 15, 2013 3:42 am

Polydnj wrote:I'm practising loops, methods, classes, variable, arrays which are all standard to Java, no matter what device I use right?. I guess that the purpose of using a libraries is to communicate with other hardware, like you said "in the physical world".
Hi, some good resources for getting started below.

Java 7 tutorials:
http://docs.oracle.com/javase/tutorial/

Java 7 API docs:
http://docs.oracle.com/javase/7/docs/api/

JDK 8 and JavaFX early access (for hardfloat Raspbian):
http://jdk8.java.net/fxarmpreview/javaf ... eview.html

JavaFX docs:
http://docs.oracle.com/javafx/

Henrik

User avatar
Polydnj
Posts: 25
Joined: Wed Oct 10, 2012 1:59 am
Contact: Website

Re: Java basic & Libraries

Tue Jan 15, 2013 3:34 pm

Okey, great looks like some good basic resources so i'll have to take some time and check them out. Thanks

Return to “Java”