I am attempting to install Oracle’s Java jdk and compile and run java programs on my Raspberry pi. Basically I am getting a Error: Could not find or load main class error when I try to run a java myfile.java.
The steps I took were:
- Downloaded “wheezy” from the Raspberry Pi website that allows java (soft float)
- Downloaded the arm jdk from Oracle’s website
- Used the command
tar -zxvf jdk-7u6-linux-arm-sfp.gzto unzip the jdk - Wrote, compiled, and then attempted to run a simple java program
On a side note, because the wheezy image was only 2GB, I partitioned the other 2GB of my 4GB SD card for some additional storage. That is where I unzipped my jdk and now when I want to run java or javac I have to use the full path. How can you modify the installation so that you can simply type in java with out the full path. Doesn’t that have something to do with where the binaries are installed?
I am sorry… it was as simple as removing the .class from the java myfile.class