Ok, it’s been a while but I finally posted the code for GMaven-Blackberry in another blog post.
Leave it to me and I’ll figure out how to run the dishwasher from the Maven2 build system. Today I did it! I got a working J2ME build using only Maven! It’s still really early and premature and I’m definitely going to either need to change some plugins, write a plugin, or nest some oogly logic for Blackberry. Still you can’t beat the feeling of having true Maven/ME integration. Right now I struggle daily with an Ant build.xml wrapped with a Maven2 chocolate covering. It’s yuky, it’s messy, it’s dumb! Of course there’s a story here isn’t there? Anytime I talk tech I always have some long winded over dramatized story of what I went through to figure out the latest thing. See below:
Once upon a time there was a young villager named Cliff who sought out the mysteries of the amulet of Maven2. Young Cliffy frequently sought assistance from the Elders, keepers of the amulet of M2. Over the months our young hero practiced his art of project organization, separation of concerns, and deployment both local and remote until one morning he felt confident enough to take on the greatest challenge of all, J2ME! J2ME is not your momma’s Java. (My momma always put two lumps of sugar in her Java and three lumps on my backside when I tried to sneak a cup of Java. This Java comes sans sugar, sans lumps, minus the buttock sting.) J2ME comes with a unique set of bootclasspath jar files, a mandatory preverification step, optional but necessary obfuscation, manifest signing tools, and unique tool chains for certain platforms (eg. Blackberry RIM compilers). These additional tools and steps are not included in typical Java, thus no provisions are made with modern Java build systems. What does this mean for our young adventurer? Write your own or die trying!
Our hero began the morning blocked on a performance test. He diverted and traveled into an early traveled land of Pyx4ME. He’d been down this road before, gung-ho trying to get a Maven build that not only understood JME but could run directly on the Macbook Pro. The earlier venture ended in destruction and turmoil as he struggle with the bash terminal trying to wrapper the deadly JME preverify command. Today, lo, this morning our adventurer had a much different experience. He began his tussle with Pyx4ME running under parallels. with a stroke of the Maven wand and a copy paste from the online tutorial a Maven build was off and running. Errors returned sending our journeyman off to the mailing lists and help forums. Little did he know the (J)VM running on top of his VM (Parallels) was not the correct VM! It was the middle of hos about-to-be post for help when he awakened and decided to double check the error messages and all paths. After executing the jar command echoed in an error output log the “no file or program found” messages all made sense. You see our superstar thought they referred to the generated jar file which he could physincaly see sitting on his hard drive. Instead the mesages referred to the absence of the jar command used to update the file with pre-verified binaries! Configuring a JDK instead of the JRE he was using before allowed the build to complete. Our escapade ends with our main character raising his staff to the heavens and calling lightning down from the powers of Maven2 while the staff is transformed into a broad sword and his laptop super charged into a wild-cat upon which he rides off into the sunset.
Ok, yet another dumb bunch of rambling to say the following:
If you get a “no file or program found” error when running a Pxy4ME build then you probably are running under a JRE instead of a JDK.
For the technically inept that sometimes frequent my site, “what’s the difference between a JRE and a JDK?”
A JRE runs your Java program while a JDK builds your Java program. Maven is a build system and needs Java build tools to do it’s building.