Categories
java

Which version of Groovy am I using with this Grails version?

Two nights ago [Jack Frosch](http://www.linkedin.com/in/jackfrosch) gave a great summary of the new features in Grails 2.3 at the [DFW Groovy – Grails User Group](http://www.dfw2gug.org/index.html#december2013). At the end of the meeting somebody asked him what version of [Groovy](http://groovy.codehaus.org/) shipped with [Grails](http://grails.org/) 2.3. I could tell by the look on his face he wasn’t sure, so I came to the rescue.

Considering nobody else in the room could answer the question, I figured I would blog my answer. For starters, you have two easy options to get the version of Groovy used in your Grails distribution.

You can simply look at the Grails installation on your workstation. One of the benefits of Grails is that it ships with everything you need to build your webapp, including Groovy. Just drill down into the lib dir and look at the jar file.

“`
Fri Dec 06 13:43 eweibust@RSNPLALT538 ~/dev/hello
$ ls $GRAILS_HOME/lib/org.codehaus.groovy/groovy-all/jars
groovy-all-2.1.6.jar groovy-all-2.1.6-sources.jar
groovy-all-2.1.6-javadoc.jar
“`

You can also get the version programatically with the following call:
“`
println “groovy version: ” + GroovySystem.getVersion()
“`
Which prints:
“`
groovy version: 2.1.6
“`
Hey, Google, you should go ahead and crawl this one. Should be useful to others. 😉

Categories
java

Book Review: Murach’s Java Programming

I was contacted by the people at Murach Books inquiring if I would like to start reviewing their books. Being a geek, and an avid tech reader, of course I said yes. This will be my first review, and it’s my favorite language, so I was excited with what they sent….

Murach’s Java Programming 4th Edition

This book is great for people with some programming experience, that are new to Java. Murach goes from the basics of Java, starting with primitive datatypes, through the fundamentals of Object-Oriented programming, and into GUI programming (probably could have left this out). That was the first 17 chapters. This is no short book, definitely not a quick read.

Starting with chapter 18, the book moves past beginner-level topics. Murach gives a solid review of data access in Java. First with reading and writing from/to XML files. Then their is a chapter on database theory and working with the Derby database. From there you learn how to use JDBC to read and write to a database. The book wraps up by tackling Threading.

The only negative thing I can say about this book as I’m confused as to why the author chose to use the Netbeans IDE as his IDE of choice. Murach does a great job covering the ins and outs of working with Netbeans. Going as deep as how to use the debugger to step through code and fix bugs. I just feel that Eclipse / STS have such a massive share of the market the reader would be better served learning Eclipse alongside Java.

If you only plan to buy one book on Java SE, this is the book for you. Murach’s Java Programming covers it all.

Categories
java

How to install Java 7 on Mac OS X (Lion)

Mac users are still waiting for Oracle / Apple to produce a simple download for using Java SE 7 on Macs running OS X. Until they provide one, the only safe way to use the Java 7 JDK is to build it from source. Luckily, Oracle provides a good wiki page that documents the process (and Arun Gupta has a useful post that helped with some of the gaps).

Check the Prerequisites:

OS X 10.7, Xcode 4.1 (easiest, and possibly the only way to get this, is from the Mac App Store), and Java for Mac OS X 10.7 Update 1

or

OS X 10.6.8, Xcode 3.2.6 (download from Apple Developer Portal), and Java for Mac OS X 10.6 Update 6

Mercurial version control tool. I installed this easily with the use of the awesome Mac package installer Homebrew. Simply run: “brew install hg”. (I didn’t make a dime for that blatant Homebrew plug 😉 )

Simple Process:

  1. Follow the Oracle instructions to “Get the Code”
  2. Run the Build command (part of the command is hidden by the box on the screen and if you don’t look close you may miss when copying / pasting) 😉

For all practical purposes, that’s it. If you want to install JDK 7 in the “Apple recommended” location follow steps 3-5 on the Oracle wiki page.

Just for grins I’m pasting the output of my build command. Pretty nice for a “wimpy” Mac Book Air. 😉

>>>Finished making images @ Sat Dec 17 00:09:17 CST 2011 ...
########################################################################
##### Leaving jdk for target(s) sanity all docs images             #####
########################################################################
##### Build time 00:20:58 jdk for target(s) sanity all docs images #####
########################################################################

## Build times ##########
Target all_product_build
Start 2011-12-16 23:34:39
End   2011-12-17 00:09:17
00:02:45 corba
00:08:18 hotspot
00:00:52 jaxp
00:00:55 jaxws
00:20:58 jdk
00:00:49 langtools
00:34:38 TOTAL
#########################

erik@eriks-mba ~/dev/sdks/macosx-port
$ build/macosx-universal/j2sdk-image/1.7.0.jdk/Contents/Home/bin/java -version
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-erik_2011_12_16_23_34-b00)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)

If you have any questions about these steps just leave a comment below or ping me on twitter (@erikweibust).

Categories
java

Dallas TechFest 2011 Recap…

Another year, another great Dallas TechFest event…

There were some great new speakers, Ken Sipe was my favorite with his Gradle talks.  The story on Gradle is one worth listening to, regardless, of how ingrained Ant or Maven are at your organization.  The best place to go if you’re new to Gradle is their website. The Gradle documentation is great.  Java “developer-types” can start with this Gradle tutorial geared to building Java projects.

There were also some great returning speakers, I especially liked Arun Gupta, with his Java EE Workshop.  A few years ago, I wouldn’t consider starting a new enterprise Java application without the Spring stack.  To be honest, in my mind, Spring == Enterprise Java.  However, after seeing Arun’s talks the last two years, Oracle and the Java EE 6 stack have rapidly closed the gap on SpringSource, and now just might have a story to tell in the enterprise development space.  I highly recommend you follow Arun on Twitter, or subscribe to his blog.  The content is outstanding and the current Java EE story is really impressive.

This was my first year as a presenter at TechFest, after having been involved as an organizer the past 4 years.  I gave a double session on The Grails Framework.  The attendees were great.  Lots of great participation and an all-around good time was had by all. Don’t forget to tell Tim that you want him to use the website we built next year.  😉

Grails Workshop - Dallas TechFest 2011
Lastly, I need to add there was numerous great speakers / sessions I didn’t get to see.  Craig Walls, author of Spring in Action (required reading for all Spring developers) and lead on Spring Socialgave two talks in the same slot I was speaking in so I unfortunately missed his talks.  Next year I need to make sure I’m not speaking when Craig is.I guess it’s now time to start getting ready for Dallas TechFest 2012…

Categories
java

Dallas TechFest 2009 Recap…

After close to 6 months of planning, Dallas TechFest 2009 is… “in the books.”  Planning and running an all-day tech conference with 40 presentations, 400+ (ok 401) attendees, X great sponsors, and Java and .NET developers is *totally* exhausting.  I took Saturday off to relax and now I’m back on my laptop writing this review.

First, let me say, that it wasn’t just Java and .NET.  That was just a joke because it’s always those two languages pitted against each other.  Dallas TechFest was 8 technology tracks: Java, .NET, Flex, ColdFustion, Ruby, and Silverlight, and in those tracks other technologies were mixed in.  Our great speakers present at user groups and conferences all over the country, they’ve also authored a number of books.

Anyhow, thanks to everyone that helped out.  Tim Rayburn did an awesome job heading things up, and Chris Koenig was the guy that kept things moving when we were being lazy and blowing off responsibilities, and Omar Villarreal did great with sponsors.  I was especially happy to see the returning sponsors.  And lastly, I gotta thank Jonathan Campos for all his work, that was a great after party.  I look forward to helping out again next year, given the chance.

Here are some relevant links covering the event:

Categories
java

Review of Spring Web Flow 2 Web Development

I was approached by one of the editors at Packt Publishing about doing a review of Spring Web Flow 2 Web Development.  I obviously said yes, the title of this post *is* “Review of Spring Web Flow 2 Web Development”  :)  Plus, I really don’t have much experience with Spring Web Flow 2 (SWF2) and felt doing the review made perfect sense.

For those of you that appreciate my short, don’t-hold-back, opinions, I’ll start there:

Spring Web Flow 2 Web Development is both a great “getting started” book for people wanting to learn SWF2 and serves as a good high-level “getting started” with web programming using Spring / Java EE.  Definitely worth the time and money.

Now my detailed review:

Again, I really liked how Spring Web Flow 2 Web Development serves as both a jump-start on SWF2 and also covers technologies outside of SWF (Spring Security, build tools, Apache Tiles, etc).  The book isn’t a detailed reference manual, that leaves you feeling you still don’t know how to use the technology, but gives the right amount of walk-through examples and framework documentation.

When finished with the book you will understand how to install SWF2, how to build and use the examples.  You will have numerous, feature-rich examples the authors build throughout the book.  You’ll know how to use SWF2 in a request-respone Spring MVC app and also with a JSF application.  You  get a solid tutorial on using Apache Tiles (kind of odd in a SWF book), a very detailed explanation of Spring Security and integrating Spring Security with SWF.  You also will understand how to test your flow definition and SWF application while also learning about EasyMock.

Here are my bulleted notes chapter by chapter:

ch 1:
Very short, brief intro to Spring Web Flow 2.
High level terms and definitions

ch 2 setup and example app:
install swf2
discuss the distribution
discuss the example apps and how to build from src
covers build systems (ant, mvn, ivy)
eclipse and spring ide
then a thorough example app
-flow definition
-service layer
-dao with jpa impl

ch 3
web flow documentation
detailed look at flow definition (.., scopes, states)
least favorite chapter
hard to read, not enough example tying concepts together

ch4
spring faces
starts with intro to jsf
I’m not interested in jsf

ch 5
sub flows – built on ch2 and ch3
spring javascript abstraction
oddly placed apache tiles tutorial for combining swf, spring js, and tiles
reference for web flow configuration

ch 6 testing swf apps
covers use of AbstractXmlFlowExecutionTests
short intro to EasyMock
tests subflows

ch 7
really good intro spring security
spring security and swf

Categories
java

Modular Java with OSGi and Spring

I was lucky enough to be asked to preform a technical review of “Modular Java: Creating Flexible Applications with OSGi and Spring“.  It’s Craig Walls‘ next book and it’s being published by the Pragmatic Programmers.

Craig does a great job of making the case for modular Java development with OSGi.  He covers why we need to start thinking about more than just how we design our methods / classes and focus more on how we design reusable Java modules.

First, Craig makes the case for modular design.  Then he talks about how OSGi enables us to write modular Java applications.  He covers both the Apache Felix and Eclipse Equinox OSGi containers.  Next you are writing and deploying a HelloWorld OSGi service.  And that’s all done in the first two chapters!

Craig spends the rest of the book covering modular Java and OSGi concepts through the development of an example project, Dude Where’s my JAR.  You also throughly learn an invaluable tool for OSGi development, Pax Construct. You learn about and writing and deploying OSGi bundles, then writing, deploying and consuming OSGi services.

Once you think you know everything about OSGi, and might be thinking that it’s a bit complicated, Craig brings in the Spring Framework.  He covers Spring Dynamic Modules for OSGi (Spring-DM) which is used to eliminate all of the OSGi-specific code in the example application.  You refactor the app away from depending on the OSGi API.  You change the services to POJOs and OSGi services then inject them into other beans.

My favorite thing about this book was that I didn’t have to read 1000 pages to understand the concepts and get up and running.  Like all the Pragmatic Programmer books, you are educated, and up and running in a few 100 pages.  Read this book if you want to quickly get up-to-speed on OSGi and Spring Dynamic Modules.

Categories
java

Writing a Presentation on Dynamics of Open Source…

I’m been tasked with writing a presentation on the “Dynamics of Open Source.”  I’ll be co-delivering the talk at the MPower Open User Conference next week.  Why I’m doing this talk is another story for another post.

 Anyhow, there is so much to say on this subject.  I was hoping to solicit some feedback from some of my readers.  The most common stuff people say about open source, “lower total cost of ownership”, “it has less bugs”, “improves faster, new features added faster”, etc, etc.

What do you like about open source software/tools?  What don’t you like?  How has it helped/hurt your organization?

Thanks…

Categories
java

Google Chrome Review…

UPDATE:

I have Java support working with Google Chrome.  I followed the video instructions left in the comments by Vladimir and I’m good.  Watch this video or just know that you need Java SE 6 Update 10.

 

Google Chrome…  I dig it, but it needs work.  I guess Google’s “out” is that Chrome was released as Beta.  It kind of bothers me that *everything* Google releases is Beta.  Has Google ever finished a product?

I think there is a ton to like about the design decisions Google made when beginning work on Chrome.  Google covered them all in a cool, hip comic book.  I guess they couldn’t get their hands on a tech writer, but found an out-of-work comic book illustrator.  Either way, the artist got all the important points across.  Chrome is multi-process by page/tab, they wrote a jvm for JavaScript called V8, they went with WebKit for page rendering, tabs are first-class citizens (not parts of the browser), and many other things.

One annoying thing was that Google Chrome proudly states that the browser won’t crash, just individual tabs.  Well, within an hour of using Chrome, it crashed on me.  I grabbed a screenshot to prove it.

Google Chrome crashes
Google Chrome crashes

Another thing Google Chrome needs to work on is it’s tab support. I know that I abuse browsers that support multiple tabs. I know I could bookmark a tab or two, or tag them with delicious a bit more frequently… but hey, if the browser supports multiple tabs, why should I ever close one. Right now, I’m running Chrome with 50+ open tabs. The screenshot below clearly shows that once you get a bunch of open tabs you can’t really tell which tab is which. I *really* dig how Firefox handles more tabs then fit a screen, they just turn them into a left-right scroll.

Google Chrome has problems with multiple tabs
Google Chrome has problems with multiple tabs

My last complaint, or maybe “improvement area” is where is Java support? Come on? Google is one of the biggest supports of Java out there. Get some Java support, please.

Google Chrome does NOT support Java
Google Chrome does NOT support Java
Categories
java

Eclipse Hates SVN…

Yup, I said it…  Eclipse hates SVN.  The way I see it, Eclipse treats Subversion like a red-headed stepchild.  How long has Subversion been around now?  Years and years, since 2000 to be exact.  Yeah, it’s been around for 8 years.  And Eclipse still only does a half-ass job of supporting subverion.  The Eclipse Foundation choose Subversive as their svn client/plugin of choice back in Nov 2007.  Yet, to get Subversive up and running in Eclipse is a matter of pain and suffering.

Eclipse just released their yearly version, this year they’re calling it Ganymede, and it was supposed to kind of have svn/Subversive support….  but heck no.  Good luck getting it working.  The documentation/instructions suck at best, being fair, the instuctions are crap.

Oh, I’m so close to giving NetBeans a serious look.