2

I am trying to install java on my raspberry pi following the instructions on: http://www.oracle.com/technetwork/articles/java/raspberrypi-1704896.html, but at the instruction ./bin/java -version, I get Permission denied. I tried doing sudo ./bin/java -version, but I get command not found. I am logged in on the root, so I'm not sure what's happening.

topherg
  • 497
  • 1
  • 5
  • 17
  • I think the problem when using sudo is that the java environment variable is not set for the root user. – Steve Robillard Jan 17 '13 at 22:00
  • So you are really using Debian and not Raspbian? Instead of using Java with Raspbian with more Performance. Java from Oracle for Raspbian is only available at the moment as java 8 "beta" release. – keiki Jan 17 '13 at 22:27
  • @SteveRobillard For some reason, typing in ./bin/java, even though it goes to an elf file, it doesn't execute it which is the problem – topherg Jan 18 '13 at 00:36
  • @otakun85 Sorry for the confusion, I'm running raspian (from the raspberry pi website) and I'm trying to run a Java application on it. Preferably something that would run java files the same on a desktop (or as similar) that it does on another device with java – topherg Jan 18 '13 at 00:38

2 Answers2

3

Java 8 is available as an early release for the Raspberry Pi. This includes JDK8 and JavaFX 8 early release.

Checkout http://jdk8.java.net/fxarmpreview/

johnma@raspbmc:~$ /opt/jdk1.8.0/jre/bin/java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b36e)
Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)
johnma@raspbmc:~$

Also, I suspect that you received program not found because the version of the executable was not compatible with the platform that you tried to run the executable on. I accidentally downloaded a JDK7 preview for ARM instead of the most current JDK8 preview and received the same "command not found" error that you did.

HeatfanJohn
  • 3,125
  • 3
  • 24
  • 36
2

Ok, I found a way around it. It's probably very silly, but it seems to work.

I run apt-get install openjdk-6-jre, which bundles java and now I am able to call java -jar TCA.jar and it does the same io reading and writing as done on my desktop version (which helps with my debugging), but I am still testing the other objects in it. So far, I haven't found any issues.

topherg
  • 497
  • 1
  • 5
  • 17
  • Damn it, didn't really work. Most of the libraries I want to use (like a lot of the System) doesn't work. Think I need one tailored for raspberry pi – topherg Jan 18 '13 at 00:33