Posts: 2
Joined: Sat Apr 08, 2017 1:17 am

Having trouble importing packages. Can I use Maven?

Sat Apr 08, 2017 5:06 am

I have a program I was using on my PC with IntelliJ and Maven, so it was auto-importing a bunch of packages. I can't figure out how (if it's even possible) to get Maven working on my RPi, which means I have to download a bunch of different packages, but each package relies on a variety of other packages, so this is quickly becoming inefficient. Do I really have to get each package and compile each package individually to get a program running on the Pi? Also, are there any options for Java on the RPi than BlueJ?

Posts: 1143
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Having trouble importing packages. Can I use Maven?

Sat Apr 08, 2017 5:08 pm

I develop my java programs in eclipse on a laptop, and export to a runnable jar to the pi if needed. Eclipse has the option to include required jars into the export-jar. But usually I use an ant build script to build deployment packages.
If you have the libs available as a jar, then these do not need to be compiled on the pi (compile once, run everywhere...).
But I admit that I do not use maven. Especially because when my programs work with specific version of libs, then I do not want to change these; and 'cause of license issues I need to know in detail which libs and hence which licenses are imported.

Posts: 11
Joined: Thu Oct 29, 2015 10:38 am

Re: Having trouble importing packages. Can I use Maven?

Mon Apr 17, 2017 12:39 pm

ANT? Maven replaced ANT a decade ago :)

Can you use Maven on your Pi? Absolutely. Maven is pure Java, needs just a JDK, a network connection, and diskspace.
Diskspace on the Pi of course (for the Maven repository) can become a problem.
Or you can use Maven to build the entire deployment package (including all related jars you need) on the PC or Mac and copy everything to the Pi.
Either case, you're going to need a script to set your classpath for the application (you need that on any hardware).

Return to “Java”

Who is online

Users browsing this forum: No registered users and 5 guests