Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  otakun85 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 –  cgoddard Jan 18 '13 at 0: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 –  cgoddard Jan 18 '13 at 0:38
add comment

2 Answers 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.

share|improve this answer
    
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 –  cgoddard Jan 18 '13 at 0:33
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.