Page 1 of 1

Java basic & Libraries

Posted: Sun Jan 13, 2013 4:33 pm
by Polydnj
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!

Re: Java basic & Libraries

Posted: Sun Jan 13, 2013 6:47 pm
by savageautomate
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

Re: Java basic & Libraries

Posted: Sun Jan 13, 2013 6:49 pm
by savageautomate
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

Re: Java basic & Libraries

Posted: Mon Jan 14, 2013 2:48 pm
by Polydnj
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".

Re: Java basic & Libraries

Posted: Mon Jan 14, 2013 3:28 pm
by -rst-
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.

Re: Java basic & Libraries

Posted: Mon Jan 14, 2013 3:40 pm
by savageautomate
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

Re: Java basic & Libraries

Posted: Tue Jan 15, 2013 3:42 am
by henrik
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

Re: Java basic & Libraries

Posted: Tue Jan 15, 2013 3:34 pm
by Polydnj
Okey, great looks like some good basic resources so i'll have to take some time and check them out. Thanks