Posts: 17
Joined: Tue Jul 17, 2012 6:50 pm

issues running pi4j examples

Sun Dec 29, 2013 6:29 pm

I've got some issues running the java example files included in the tutorial below:

I'm trying to run the following command:

Code: Select all

javac -classpath .:classes:/opt/pi4j/lib/'*' -d .
but get this error when I execute it:

Code: Select all error: error while writing <anonymous PiFaceExample$1>: No space left on device
        piface.getSwitch(PiFaceSwitch.S1).addListener(new SwitchListener() {
1 error
I'm really new to linux and the Pi in general. Does this mean the whole SD card is out of space or something more specific. My googling lead me to the following command which checks available space:

Code: Select all

$ df -k
this returns the following:

Code: Select all

Filesystem     1K-blocks    Used Available Use% Mounted on
rootfs           1804128 1778780         0 100% /
/dev/root        1804128 1778780         0 100% /
devtmpfs          216132       0    216132   0% /dev
tmpfs              44880     236     44644   1% /run
tmpfs               5120       0      5120   0% /run/lock
tmpfs              89740       0     89740   0% /run/shm
/dev/mmcblk0p1     57288   18888     38400  33% /boot
tmpfs              89740       0     89740   0% /tmp
Not sure if there's any clues there as to why I can't run this example to get some flashing lights on my PiFace...

User avatar
Posts: 37680
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: issues running pi4j examples

Sun Dec 29, 2013 6:34 pm

What size SDcard is it?

rootfs 1804128 1778780 0 100% /
says you've used 1.8GB

Have you run raspi-config to expand the filesystem to use all the available space on the card?
Is /var/log full of crud and cruft?
Have you cleaned up the apt cache?
Have you looked at the installed software packages to get rid of things you've not used and never plan on using?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Posts: 17
Joined: Tue Jul 17, 2012 6:50 pm

Re: issues running pi4j examples

Sun Dec 29, 2013 6:45 pm

It's a 4gb SD. Guess i need to expand the file system.

I've just found it all a bit hard to work out because I'm doing it all through SSH which I'm also new at.

And also Yes it will be full of crud I don't need. It's for a java project so I might get an image ready with everything on it I need minus the crud and back that up encase I brick it...

Cheers, I'll look into those things.

Update: Yep that sorted it!

Return to “Advanced users”