Shop OBEX P1 Docs P2 Docs Learn Events
Programming in Java - can the Propeller do it? — Parallax Forums

Programming in Java - can the Propeller do it?

ElectricAyeElectricAye Posts: 4,561
edited 2013-08-12 07:52 in General Discussion
You've probably heard of the game MineCraft by now. Recently I've seen some kids get interested in making their own modifications to the game, which is written in Java. So kids want to learn Java because of it. So I'm just curious - would the Propeller be programmable in Java? has anyone made that possible?

I had thought Java was like some sort of dinosaur but this MineCraft thing makes me wonder.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-08-09 21:06
    There are official subsets of the Java language that are intended for use in small embedded systems, but that's just what they are ... small subsets of the language with a lot left out ... the bits that have relatively high overhead and are very useful for doing things. Standard Java is for big computers only ... laptops ... desktops ... big tablets. The smallest official embedded implementation of Java that I know of is Java ME (Micro Edition) which does run on a Raspberry Pi and needs megabytes of RAM to run.

    On the other hand. Parallax did develop an SX-based Java interpreter for a useful subset of Java. That could theoretically be ported to a Propeller. See the Javelin manual chapter 10 for limitations.
  • jazzedjazzed Posts: 11,803
    edited 2013-08-09 21:53
    I've been playing with the Javelin based propeller-jvm again this last week. The tools work on Windows and Mac now with linux on the way..

    Doing a full Java 2 implementation will have to wait for propeller 2. I've started looking at already.
  • Heater.Heater. Posts: 21,230
    edited 2013-08-10 01:26
    Java is a Dinosaur. A young species but huge and slow and pointless nonetheless.

    Do warn those kids before they end up like the office droids in the Lady Java video: http://www.youtube.com/watch?v=Mk3qkQROb_k
  • John BoardJohn Board Posts: 371
    edited 2013-08-10 05:46
    Minecraft is a fairly great way of getting kids into programming java - I actually learned java through making modifications to the minecraft server software :P

    [EDITED] <Stand Corrected>
  • jazzedjazzed Posts: 11,803
    edited 2013-08-10 21:36
    The Javelin version of Java has been running on the Propeller for years. Javelin is based on Java 1.1 and uses the open source Jikes compiler created by IBM with a linker that pulls in all the required classes. Up to 32KB of Javelin code can be run on Propeller from eeprom using a small on-board cache ... smaller programs can be run without using EEPROM. There is about 16KB of HUB ram left over for interesting things like a Keyboard/VGA driver or other items depending on the number of virtual peripherals to be used. Currently the Virtual Peripheral concept is used with native SPIN code to deliver deterministic operation of various devices like UART, Serial IN/OUT, ADC, and DAC.

    And ... it performs as well as ZOG :)
  • Heater.Heater. Posts: 21,230
    edited 2013-08-11 01:23
    Jazzed,
    And ... it performs as well as ZOG

    It's a fair cop.:)
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2013-08-11 16:40


    • NEW Release: Oracle Java ME Embedded 3.3.1 for KEIL MCBSTM32F200 (based on a ARM Cortex M3 chipset), is now available as a reference binary, ready to install and run. This binary comes integrated with RTX OS for the reference board Keil MCBSTM32F200 for development/evaluation purposes. 303113.gifDownload 303113.gifLearn More
    • NEW Release: Oracle Java ME Embedded 3.3 for Raspberry Pi for ARM11, Linux is now available as a reference binary, ready to install and run
    • http://www.oracle.com/technetwork/java/embedded/downloads/javame/index.html




    I tried it on a Raspberry Pi and it worked fine.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-08-11 17:08
    ... I tried it on a Raspberry Pi and it worked fine....

    Interesting!

    Thanks everyone for providing some insights into this. Maybe I had better keep my eye on this Java thing, after all.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2013-08-11 19:33
    @ElectricAye

    Here's a video's for you:

    Do You Like Coffee with Your Dessert? Java and the Raspberry Pi
    https://www.youtube.com/watch?v=eJ9ArS4uhZU

    [h=1]Great User Interface using Raspberry PI and JavaFX[/h]
    https://www.youtube.com/watch?v=eJ9ArS4uhZU



    J
    ava should run on the Prop 2 fairly well. I was doing some Java on the Raspberry Pi but recently switched to Lazarus (Object Pascal). I used Delphi for many years(Object Pascal) before I learned Java, many moons ago. I just switched to Object Pascal for iOS & Android as well. Even Spin borrowed a few ideas from Object Pascal :)
  • Heater.Heater. Posts: 21,230
    edited 2013-08-11 23:01
    Bob,

    How big is that Java for Raspberry Pi?

    The Pi is hardly an MCU like the Prop. What with it having a 700MIPS processor and half a gig of RAM.

    Java just seems like a horrible waste of resources in exchange for a not very nice language. Or at least a language that does not offer any advantages in this environment.
  • TorTor Posts: 2,010
    edited 2013-08-12 00:57
    What about gcj, the Java native GNU compiler? It seems to not be updated much so it may not be up to speed with current Java standards (not that I have any idea what those might be), but it's still part of GCC, the Gnu Compiler Collection. The good thing in the Propeller context is that it's just another frontend to the already-ported gcc backend.. and one of the output alternatives is native code, it doesn't have to be Java bytecode.

    -Tor
  • jazzedjazzed Posts: 11,803
    edited 2013-08-12 07:52
    Getting GCJ to compile would be possible, but getting it to run with the libraries on propeller would be a much bigger matter.
Sign In or Register to comment.