-
- Posts: 142
- Joined: Mon Dec 03, 2012 4:26 pm
- Location: Deep in the mines of Moria
Can the Pi run .jar files?
A bit of a noobish question, but can the Pi actually run .jar files, and what do I need so I can? The explanation on the downloads page is a bit misleading when it says about the JVM. I'm still not sure exactly what that is.
-
- Posts: 1
- Joined: Sun Dec 30, 2012 6:59 pm
Re: Can the Pi run .jar files?
It sure can. As long as you have you java environment setup correctly, all you have to do is type (off the top of my head): java -jar pathAndFilename.jar
- savageautomate
- Posts: 230
- Joined: Thu Aug 16, 2012 3:20 pm
- Location: USA
Re: Can the Pi run .jar files?
... just to clarify what the downloads page is talking about ...4thdwarflord wrote:The explanation on the downloads page is a bit misleading when it says about the JVM. I'm still not sure exactly what that is.
You can use the OpenJDK on any of the Linux distributions available. It's easy to install and already available in the apt-get repository for Raspian. Just use this command on the Pi's console or terminal to install the OpenJDK.
However, if you want to use Oracle's version of the JDK or JRE, then the current released JDK7 for the Pi (JDK7SE with ARM support) it only supports soft-float (ABI) based distributions of Linux. Thus you can only use this on the older Debian "Wheezy" Linux distribution available on the downloads page. Most users are installing the newer and more actively updated Raspbian Linux distribution available on the downloads page, but this is a hard-float (ABI) based Linux distribution and thus not compatible with Oracle's JDK7 for ARM.sudo apt-get install openjdk-7-jdk
Here are installation instructions on how to install the Oracle JDK7 on a Raspberry Pi using a Debian "Wheezy" (soft-float) distribution:
http://www.savagehomeautomation.com/raspi-jdk7
OK .. one more curve ball .... very recently Oracle announced (http://www.raspberrypi.org/phpBB3/viewt ... 81&t=26110) an early access development release of the JDK8 for ARM which does support hard-float (ABI) based systems. This JDK8 should be considered experimental since it is not released.
Here are installation instructions on how to install the Oracle JDK8 early access on a Raspberry Pi using a Raspian "Wheezy" distribution:
http://www.savagehomeautomation.com/raspi-jdk8
One last thing to consider ... "Why would I want to run the Oracle JDK versus the OpenJDK" ?
Well, the Oracle JDK includes a JIT compiler that allows your Java program to run much faster compared to the OpenJDK (Zero VM) with no JIT. There are options in the OpenJDK to run using alternate VMs (such as Jamvm, Avian, Cacao) that do support varying levels of JIT compilers and performance enhancements, but I have not yet seen any stats that outperform Oracle's VM.
Here is an article that I published a while back comparing the Oracle JVM and the OpenJDK using Zero VM: http://www.savagehomeautomation.com/pro ... marks.html
Also see this thread for more recent performance testing results with some of the other OpenJDK VMs: http://www.raspberrypi.org/phpBB3/viewt ... 81&t=25418
Regards, Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
- savageautomate
- Posts: 230
- Joined: Thu Aug 16, 2012 3:20 pm
- Location: USA
Re: Can the Pi run .jar files?
Oh, one other thing to note that is you can install multiple JVMs on your system such as OpenJDK 7 and Oracle JDK SE 8 early access and then switch between them as needed/desired.
Check out this how-to article for switching between JVMs on Debian/Raspbian:
http://www.savagehomeautomation.com/pro ... e-jvm.html
Check out this how-to article for switching between JVMs on Debian/Raspbian:
http://www.savagehomeautomation.com/pro ... e-jvm.html
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
-
- Posts: 142
- Joined: Mon Dec 03, 2012 4:26 pm
- Location: Deep in the mines of Moria
Re: Can the Pi run .jar files?
thanks for the instructions onn running jar files, and thanks for the thing about openJDK vs oracle JDK. i had no idea since the answer was nowhere to be found.
- savageautomate
- Posts: 230
- Joined: Thu Aug 16, 2012 3:20 pm
- Location: USA
Re: Can the Pi run .jar files?
You are welcome and glad to have you with us 

Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
-
- Posts: 26
- Joined: Fri Nov 30, 2012 8:25 pm
Re: Can the Pi run .jar files?
Hi there,
For the numptys out there like me can you be a bit more specific with regards to opening the file please?
I've downloaded project libre, i can click on it in the downloads file and i get a list of the files once they are unarchived but can't find the route to the file (new to Linux, previous experience limited to mac). I can't drag and drop it onto the desktop.
thanks in advance
For the numptys out there like me can you be a bit more specific with regards to opening the file please?
I've downloaded project libre, i can click on it in the downloads file and i get a list of the files once they are unarchived but can't find the route to the file (new to Linux, previous experience limited to mac). I can't drag and drop it onto the desktop.
thanks in advance
Re: Can the Pi run .jar files?
Hi milkybar_ton,
I'd guess this type of basic 'How to' questions are best handled outside of this specific JAVA forum. Entire websites have been created for learning and teaching LINUX. i.e. http://www.tldp.org/HOWTO/HOWTO-INDEX/howtos.html
The recommended links are:
http://community.linuxmint.com/tutorial/view/100
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html
Hope this helps
Regards
Mike
I'd guess this type of basic 'How to' questions are best handled outside of this specific JAVA forum. Entire websites have been created for learning and teaching LINUX. i.e. http://www.tldp.org/HOWTO/HOWTO-INDEX/howtos.html
The recommended links are:
http://community.linuxmint.com/tutorial/view/100
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html
Hope this helps
Regards
Mike
- savageautomate
- Posts: 230
- Joined: Thu Aug 16, 2012 3:20 pm
- Location: USA
Re: Can the Pi run .jar files?
This page describes how to install Pi4J and where the files are installed and includes instructions for how to compile the examples.
http://pi4j.com/install.html
Beyond that, you may want to explore some of the examples starting with this page:
http://pi4j.com/example/control.html
Thanks, Robert
http://pi4j.com/install.html
Beyond that, you may want to explore some of the examples starting with this page:
http://pi4j.com/example/control.html
Thanks, Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
Re: Can the Pi run .jar files?
There is a minecraft version on minecraft.net (not the pi version) it says its for linux and is .jar file ? will it run on raspiagent_paul wrote:It sure can. As long as you have you java environment setup correctly, all you have to do is type (off the top of my head): java -jar pathAndFilename.jar
- DougieLawson
- Posts: 42480
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Can the Pi run .jar files?
No!FeminD wrote:There is a minecraft version on minecraft.net (not the pi version) it says its for linux and is .jar file ? will it run on raspi
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.