Posts

JDeveloper installation on Mac OS X Mountain Lion

Let's get the "why?" out of the way first - Personally I like to know what IDE's are alive and well for any for any Java development I might be doing especially if it's something new or something I have not done for a while. Currently NetBeans is my first choice.  Certainly Eclipse is a great standby for any Java development (and a whole lot of non-Java stuff for that matter).  I have tried to get into the in some circles extremely popular Intellij IDEA IDE but so far I am not a fan. JDeveloper , from Oracle, has an interesting history (I think back to my JBuilder days any time it's mentioned).  It still exists and I assume is well respected or at least used by those in Oracle shops because it does seem to integrate nicely with (or is at least aware of) all things Oracle. Recently I wanted to check out some functionality specific to JDeveloper and decided I needed to install it on a relatively new MacBook Pro running OS X 10.8.2 (aka Mountain Lion). ...

P2V fun?

We have a good number of servers which are being moved from physical to virtual.  In our case VirtualBox is the virtualization solution.  If you have not heard of VirtualBox, as a result of the Sun acquisition, it is an Oracle product. In my opinion VirtualBox has certainly not suffered since Oracle rebranded it.  It is still available free of charge and is updated on a regular basis.  In addition to overall stability, running on Windows, Linux, and OS X hosts is an attractive, and in our shop, needed feature. Moving physical CentOS servers to VirtualBox proved to be a bit of a challenge.  There are a lot of good blog posts and HOWTOs on this subject.  If minimal downtime is a must, this and other rsync-based solutions is worth reading. As it turns out regardless of the solution I used, ultimately I could not boot the resulting virtual server without using a "linux rescue" or "live distro" and then chroot'ing or mounting the converted filesystems. ...

Dart FUD

Given that I currently do little to no programming specifically for the browser or should I say actually writing JavaScript code, I had, until recently, all but completely ignored Google's Dart language .  It's been about a year since Google released it and I recall reading that it was a non-standard JavaScript replacement which was only to be supported by Google's Chrome browser and it was history repeating itself (in a bad way) reminding folks of VB script or maybe ActiveX. Not to rehash the whole of the criticism but basically Google was accused of trying to do what Microsoft did with their own proprietary browser technologies which unfortunately led to a set of badly fragmented web "standards."  Given that I don't love JavaScript, tending to be more of a static-typed guy, replacing, or trying to replace, JavaScript with a variety of alternatives does not sound totally unreasonable to me. While I have never attended a Google I/O conference, I try to dig...

JavaFX, Maven, and Executables

I am glad to see Maven getting more attention from JavaFX folks. These are a couple of good recent posts: JavaFX and Maven  and more recently Create JavaFX executables with maven I created a project using the pom from the second post on OS X running Java 1.7.0_06-ea-b19 and had some, but what now is very little, trouble. In addition to having to precede the {java.home} and {javafx.version} variables with a dollar sign, I ran into and Ant issue which was solved for me with this:   Ant tasks that use the JDK .  After getting the project to build and package (that packaging part is cool especially the first time you see it) I had one more problem.  The IDE, in my case NetBeans, despite successful builds, would not run or debug the program. Now it's obvious that NetBeans could not find the JavaFX runtime which I solved by adding a symbolic link in the extensions directory.  Here is the command I used  from the /Library/Java/Extensions directory ...

maven 3 site building

We recently moved some projects from maven 2 to 3 and ran into some issues on our CI server.  Most issues while a bit time-consuming were easy enough to figure out given the error messages.  One, in particular, took a bit longer to track down for some reason.  Looking back it should have been obvious but google searches were not much help...perhaps it's just because today is Monday. The error had to do with building the site.  One of the messages, among others, is below: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:2.2:deploy (default-cli) on project projectname : Unsupported protocol: 'scp' Now, this is obvious to me but when I encountered it I thought something had changed in the distributionManagement support settings. As it turns out, the maven-site-plugin needs to have ssh/scp support made available to it. Adding the dependency to the site plugin will correct this problem. A...

Android and JavaFX

This brief post is not about running JavaFX on Android...something I really hope does happen and soon would be nice.  JavaOne announcement? It is about a quick comparison between a native Android application and a JavaFX FXML application. If I recall correctly, one of the books I used as a reference for Android development used code-only to explain "hello world" type examples.  After that simple stuff it was quickly pointed out that Android development is typically done using XML as the markup language to create views.  It is possible, although not advised, to use Java-only because the XML separates the design from the code. JavaFX 2.0 seems to be getting a great deal of press now and perhaps it's gaining in popularity.  In my opinion Jim Weaver and Stephen Chin joining Oracle as evangelists is a great for JavaFX.  I know I have been working with it a good bit lately.  At this point it seems like there are more code-only examples than FXML based exa...

JAX 2012 San Francisco

Throughout my career as a programmer I have been to a wide variety of developer conferences but today concludes four days of one I have never previously attended.  JAX, which originated in Europe and has been around since 2001 is focused on Java, other JVM languages, and anything that touches Java technologies.  The JAX conference is small when compared to JavaOne and others but the number of attendees is not a reflection of the quality of the conference. If you have been around the Java community for any length of time you would recognize a significant number of the speakers.  We were fortunate enough to attend sessions lead by Stephen Chin, Neal Ford, Ted Neward,  Kohsuke  Kawaguchi, Arun Gupta, Rich Hickey, and Charles Nutter.  In my opinion, one or two of these guys makes it worth the price of admission but that's not even a complete list.  The material presented at JAX is both practical stuff you can take home and begin using in your development...

Time saving Java development

I recently ran into some issues with a commercially support product that reduces development time by eliminating the need for recompile/deployment after every code change.  When it's working, this can save hours with a variety of Java development spaces and is well worth checking out. The commercial product for this purpose is indeed a very good one and worthy of the praise it has gotten but alternatives and competition can be good.  Having said that, Javeleon  is a free tool developed by a group of researchers at the  University of Southern Denmark. While I know my way around Eclipse and will use Intellij if and when I must, I happen to be a NetBeans fan at this point in time.  With respect to Javeleon, that's a good thing because the NetBeans plugin is a breeze to install and configure in an application.  [Javeleon has a standalone version of their product and there is a third party Eclipse plugin which I have not yet tried.] Most of my Java develop...

Talking to Swing

We recently saw the need to create an interface to an older Java Swing application.  We don't have access to the backend and currently there is no standards-based interface (e.g. web services) or immediate plans to create one. The application in question was designed for and is delivered with Java 1.3.  This fact limited the possibilities of using off-the-shelf or even pieces of other open source solutions such as Swing testing code. Ultimately we decided to create Swingomatic .  The code is still in development but it is working well enough to consider it viable.  The architecture involves the use of an older release of the  Java Accessibility  and a mini HTTP server which accepts a string of component instructions as an XML string. The project is maven based.  It includes a client library which allows a Swingomatic client to be built in a current version of Java.
Getting JavaFX going on NetBeans on OS X First off JavaFX, like many features in NetBeans, is disabled by default. The first time you create or open an existing JavaFX project it will be enabled. Unfortunately, at least for now, there's no way I could find to add JavaFX to an existing Java platform. Here's a workable solution: create another "Java Platform" (sort of) I created a symbolic link to the current platform and appended _javafx to the name Specifically from the directory /System/Library/Java/JavaVirtualMachines I did "sudo ln -s 1.6.0.jdk 1.6.0.jdk_javafx" Then from within NetBeans Tools->Java Platforms Add Platform choose directory pointed to by newly created symbolic link (in my case /System/Library/Java/JavaVirtualMachines/1.6.0.jdk_javafx/Contents/Home) Now that we have a newly created Java Platform (albeit a copy of the other one) we get the JavaFX option tab Because I unzipped my javafx to /opt I used these values: JavaFX SDK: /opt/javafx...
Proguard on the Mac... In trying to do a maven build on OS X which includes the proguard plugin for obfuscation we ran into an issue. Three jar files which are included in the runtime library in the Sun, I mean Oracle, Java version are not found. The solution we chose was to create three symbolic links like this (from JAVA_HOME/lib): sudo ln -s ../../Classes/classes.jar rt.jar sudo ln -s ../../Classes/jsse.jar . sudo ln -s ../../Classes/charsets.jar . If you don't know where your JAVA_HOME is, run this command: /usr/libexec/java_home
I have been playing with JavaFX in NetBeans a bit lately. When I tried to run an app without the development environment I was presented with an (ugly) message which said I needed to install the JavaFX runtime. I was not able to find instructions on how to do this quickly so I thought I would post my solution. JavaFX 2.x runtime on OS X Get JavaFX 2.x from Oracle if you don't already have it handy (my current version is installed in /opt/javafx-sdk2.1.0-beta) Find "JAVA_HOME" - this can be done using this command: /usr/libexec/java_home My JAVA_HOME is /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Copy the JavaFX runtime files to the JAVA_HOME/lib/endorsed directory Given my settings after changing to JAVA_HOME I used this command: sudo cp /opt/javafx-sdk2.1.0-beta/rt/lib/* lib/endorsed
Open Office labels There's a lot going on the world in general and there's a lot going on in the world of programming these days. At least there is a perception that a lot is going on. This is especially true if you happen to make a living doing anything related to Java. Oracle buying Sun may change some things for the better and others for the worse. Making (more) money from Java than Sun was able to do is not necessarily a bad thing. Speaking of Sun...I mean Oracle...Open Office has an interesting bug related to printing labels. The procedure itself is documented and maybe even relatively intuitive (if you're a programmer that is). But seriously once you get past these great instructions you may run into this problem: The first page prints two or three labels with addresses and the remainder of the page with labels containing field names only. I played around for a little while before I found what I think is the bug that's gone unanswered in a few places. If...
...additional JARs have been added : ' some maven corrupted jar file name here '...repeatedly So it seems with the combination of Eclipse, Tomcat, Axis2, and maven one might run into this. The actual error I was getting was, at least initially was the "Initial Server Error". This particular error is mentioned in the Axis2 FAQ section and should be looked at if you get this error. However, it seems the maven corrupted jar error is not, as of this writing, documented so well, hence this quick blog entry. The bottom line is there seems to be something amiss with maven and corrupt repositories because this issue impact another related project...and given that I should have thought about this sooner. If you do get and error in your Tomcat console which says "...additional JARs have been added" every five seconds or whatever reload timeout setting you might have and you're using maven, take a look at that jar in your local repository. If it a few hundred by...
Image
Again I write about one of what seems to be my favorite subjects. Binding in Java has, over the years, occupied a bit of time for many Java developers (not that binding is unique to Java). I am thankful for this time because it has ultimately made using really easy. Despite the busy holiday season now among us (Thanksgiving and Christmas for my family and me) along with the usual stuff, I wanted to write something quickly about NetBeans , specifically about version 6.5 since it was released not that long ago and has something relatively minor but very nice included. I have, in the post, posted a hack we employ to get JAX-WS to generate property listeners/notifiers in the generated POJOs we rely on for binding (we're using JSR-295). The NetBeans team resolved an outstanding issue that makes this a good bit easier (although in my opinion it should be default JAX-WS behaviour). Assuming JAX-WS does not yet generate property event notifiers (and last time I checked it did not), you...
Off by one day...and worth writing about... It's been quite a while since I blogged about anything.  I have been very busy but I really should make more time to blog.  Some of the bugs I encounter, fix, and yes sometimes re-fix seem familiar.  It sure would be nice to read about them to provide myself or someone else a clue now and again. We have been working on an application which is built using web services.  The Java Swing client utilizes JAX-WS and the server was built with Apache Axis.  One of the issues we have run into on more than one occasion involves dates.  There's a Java class that's used to send date(times) over the wire in XML format which includes the time zone.  It's called XMLGregorianCalendar   If you're sending or receiving date/times over the wire using Java and web services, chances are you have bumped into it. One issue we have had to deal with is null date/times.  Certainly they can exist in databases and that's not a bad thing.  Getting ...
Eagles still fly... We went to the Eagles concert this past Wednesday evening in Charlottesville, VA with some friends. I was amazed, no blown away, by the performance. Sometimes we (or at least I) "filter" experiences to see, hear, or otherwise sense an event in a manner more consistent with what we expect rather than the way it actually is. I could easily go off on a tangent about philosophy at this point but instead I'll just admit I certainly have my own biases. This concert, discounting any biases I might have, was truly amazing. It's not necessarily because I really enjoy listening to both old and new music written and performed by the Eagles although that's certainly true. No, this is more about using a God-given talent with no compromises whatsoever. To simply say we witnessed a bunch of artists who happen to be perfectionists does not do the performance justice. I believe God has given each one of us one or more talents which He expects, sometimes i...
Binding...finally getting it together (well maybe) It's been a while now but I might have hacked a solution for binding. We have an application which we developed using NetBeans . We have been through various binding solutions but once JSR-295 code was released by Scott Violet a couple of JavaOne's ago, we decided to use it. Looking back this decision may have been even more premature than we expected but I don't regret it. JSR-295 has, at least on some level, been usable since it was available. In my opinion the initial release was as good (and as bad) at most anything else we tried. In the one project I have in mind at the moment we had a couple of wrinkles. This is a Swing application that utilizes web services. We really do like NetBeans for many reasons including the ability to visually design Swing apps. Having just returned from I think what was my seventh JavaOne (I was not at the first one and missed quite a few years along the way), I am not unaware that ...
JavaOne 2008...worth the trip. It seems like I do well to write something here quarterly and I should make it more of a priority. Anyhow here are some of my impressions of JavaOne in no particular order. First off JavaFX is just about where I have expected it to be since last JavaOne. I do believe this language extension will be a success. Personally, I don't see how it can't be although I may measure success differently than some. I am not claiming Flash apps will no longer be available on the web and the world will flock (back) to Java but I do think if you're using Swing and maybe Java2D to build your apps, you'll start using JavaFX and you're stuff will find it's way from the desktop to the browser and back with little to no effort on your part. I think Josh Marinacci explained this well on the last day in one of his sessions. There was not a lot of technical content in this particular session and I happen to agree with his assertion that we might u...
Eclipse rocks...again. I was just reading one of my older posts. In the spirit of giving credit where credit is due, I must say I have been very impressed with Eclipse these days on both Ubuntu Linux and OS X. There have been many updates/new features since writing that post and this is (for what I've been doing with it lately) one solid IDE.