Tag: java

Android Studio – useful notes (1)

Having worked for years with Eclipse (and some time with Netbeans), I have to admit that using Android Studio (based on InteliJ) I’m fining harder that what it should be. Where’s all my key shortcut combinations!

Whenever I use Netbeans, I use the Eclipse keymappings option in the settings, so I don’t have to remember any new key shortcuts. I’m not sure¬†if Android Studio/IntelliJ has this option as well, but in the meantime, here’s some notes for useful things to remember.

Organize Imports (Eclipse: shift-Ctrl-O) / Optimize Imports: Ctrl-Opt-O

Jump to definition (Eclipse: F3) : Opt-Cmd-B

Fix error with popup suggestion: Opt-Return


Other useful Android development related posts:




Game development for Android (attempt #3)

A while back (9 years it seems, see here) I had the urge to try and create a game in Java after having spent many years of Java development for business, but I’d never developed a game. It turned out OK (final version here), and along the way I abstracted a simple 2d game engine (here).

Inspired by one of the game development panels at Silicon Valley Comic Con last weekend, I’ve picked up a copy of  Android Game Development by Example by John Horton, and now off I go ūüėČ I’ll report back in a couple of weeks…

Mark Little on Java EE and Microservices in 2016

Mark Little has an interesting article¬†on InfoQ looking at what’s going on with Java EE and microservices. At the beginning of this year I looked at a number of Java frameworks that are emerging that support microservice development and deployment. What’s interesting is everyone has a slightly different take on what parts of the EE apis they would take with them, and/or how a Java based microservice should be packaged and deployed.

What I find interesting is there’s obviously a general agreement that there’s still parts of EE that are beneficial and useful for microservice development and deployment, but from a distance the activity in this space looks like vultures picking apart the carcass of Java EE.

While there’s still benefit for some to develop monolithic enterprise systems using Java EE and traditional app servers ‘in the traditional way’ as we have done for for the past 15 years or so, it’s interesting that microservices seems to be questioning the EE approach of all your apis in a bucket provided by a single¬†app server. I rather like the JBoss Swarm approach of being able to pick the apis you want and just bundle/deploy a fat War with what you need. I wonder if there’s enough interest and/or momentum in this space that we might see EE (probably too late for EE8, but EE9?) start to embrace this different approach to building apps as many smaller, individual services, and directly offer support for microservices type approach in future EE versions?

Lightweight Java microservice frameworks/libraries

This is primarily a personal todo list of Java-based microservice frameworks to investigate. If I’ve already looked at any of these then I most likely have a separate post about them elsewhere.

As I investigate each of these, you may find implementation examples as part of this Git repo here (https://github.com/kevinhooke/JavaRESTFrameworkComparison) – check the readme in the repo for those which I’ve built examples already.

Libraries and Frameworks:

Useful/Interesting REST and microservice related articles:

Microsoft teaming up with Red Hat for RHEL on Azure (and RH looking at node.js and Java integration options)

Red Hat recently announced a partnership with Microsoft where Microsoft is now offering Red Hat Enterprise Linux (RHEL) as an option on Azure. Although Microsoft has been offering Linux based IaaS offerings on Azure for a few years already, adding RHEL to the mix introduces an option with the backing of Red Hat enterprise support.

Red Hat are also apparently looking to increase integration options between Java and node.js for it’s clients, according to¬†Rich Sharples, senior director for product management at Red Hat, recently speaking at a node.js conference in Portland.

Running Weblogic 10.3 config utils in console mode, and gui mode in a Docker container

Most of Weblogic’s config utilities¬†can run in a console/text mode if you need to run them from a terminal session in text mode, by passing the option: -mode=console

E.g. the apps here: /[middlewarehome]/wlserver_10.3/common/bin, like config.sh will run in console mode.

config_builder.sh however does not, and only runs in gui mode. This is an issue if you’re running Weblogic in a Docker container. All is not lost however, as you can forward X out of a Docker container, but it takes a few steps to get running.

Follow the steps in this logged issue to install and run socat, and then pass ‘-e DISPLAY=’ where the IP address is the address of the vbox interface. ¬†On my Mac this looked like:

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"


docker run -it -e DISPLAY= imageid bash

My image included xterm and dependencies installed via the Dockerfile with:

RUN yum install -y xterm

When attempting to run config.sh in gui mode however, it gave me this error:

Unable to instantiate GUI, defaulting to console mode.

This is fine for config.sh at it runs in console mode, but since config_builder.sh does not, it must run in gui mode with forwarded XWindows.

This post on ServerFault held the key – you need to also install libXtst:

yum install libXtst

Now all the utils will run in GUI mode forwarding X to your host. On Mac OS X this assumes also that you have XQuartz installed too.

Java EE App Servers – are they still relevant in a world of Docker containers?

This year at JavaOne 2015 there was a¬†recurring theme across many of the Cloud and DevOp tech sessions that was promoting self-contained deployable Jars (not EARs or WARs) as a more efficient approach for deploying lightweight Java based services. This approach also plays well for a microservices type architecture¬†and can also easily make use of containers, like Docker, PaaS offerings like CloudFoundry or Heroku, or even Oracle’s new Java SE Cloud Services offering.

Being able to deploy small, self-contained services (compared to large, monolithic EARs) brings a whole range of benefits, like being able to deploy more often, and deploy individual services individually without touching or impacting any of the other deployed services.

If you go a step further to consider a deployable unit as a disposable Docker container, then you have to start asking questions about whether a traditional Java EE App Server is still required, or even fits at all this this kind of deployment approach.

Oracle has¬†a supported project on GitHub for Dockerfiles to build images running Weblogic 12c… if you try to do this you also wonder just just how practical it is to even attempt to run Docker containers that are 2GB+ in size… yes, you can do it, but are you really getting the benefits of the lightweight and lean, disposable containers at this point?

I came across this article by James Strachan, “The decline of Java application servers when using docker containers“, which is an interesting read on this topic. The more you look into Docker, containers and lightweight services, you have to question whether Java EE App Servers are losing their relevance. Or at least whether they are relevant for this approach of containerized deployments.

Are Oracle abandoning Java?

That’s an alarmist question, but recent goings on at Oracle suggest something is changing.

Today there was an eye opening story on InfoWorld about a letter from a ‘former high ranking Java official’ (maybe one of the Java Evangelist team recently laid off?), that

… the company [Oracle] was becoming a cloud company, competing with Salesforce, and “Java has no interest to them anymore.” The subject line cited “Java — planned obsolescence.”

This follows the recent layoffs in August/September of several key players on their Java evangelist team: Simon Ritter, Cameron Purdy, James Weaver, and others.

Maybe I’m scraping the barrel for facts here, but I noticed earlier this year that the java.net site hadn’t been updated with any new stories or updates since April:

And @javanetbuzz, who¬†used to¬†tweet Java related stories from the java.net site hasn’t tweeted since February 18th this year:

Incidentally, this might just be horribly bad timing, but both java.net and netbeans.org websites have been down today:

So have Oracle been quietly ramping down their Java related efforts this year? JavaOne is only 3 weeks away at this point – is there going to be some news or announcement from Oracle about their plans for Java, or are they just going to continue as if nothing has changed?

Updated: As I wrote¬†this, java.net is back with this message (although this is dated from a few days back, so I’m assuming this message was already there on the site for a few days):