Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
15. November 2011



Eclipse has this annoying habit of using the JRE instead of a JDK you have installed.  It isn’t immediately obvious what is happening until you attempt to build a project.  For example, I just move some PlayN source to a new laptop and when I try to compile I get:


[ERROR] Failed to execute goal on project tictactoe: Could not resolve dependencies for project com.gamefromscratch:tictactoe:pom:0.0.1-SNAPSHOT: Could not find artifact com.sun:tools:jar:1.6 at specified path C:\Program Files (x86)\Java\jre6\..\lib\tools.jar -> [Help 1]


Which can be a bit of a head scratcher if you haven’t been bit by it before, but there error is exactly right, the JRE unlike the JDK doesn’t have everything installed, including the aforementioned tools.jar.  Fortunately the fix is quite simple.




In Eclipse, select the Window menu->Preferences.  Then select Java->Installed JRE’s.  Then click Add… select Standard VM then click Next.  In the JRE home, navigate to the folder you’ve installed the JDK to ( c:\Program Files\Java\jdk1.6.0_21\ in my case ).  It will now churn away for a while.  After a few seconds, it should look like this:






Now click Finish.


This will bring you back to the installed JRE’s window, unclick the JRE and click your newly added JDK, like this:





And voila!  you are now configured to properly use the JDK instead of the JRE in Eclipse.  So if you run into the error saying tools.jar is missing and you are using Eclipse, this is probably the problem.



If you launch Eclipse from the command line or via a shortcut, you can also set this value using the –vm command line setting, simply type:


eclipse.exe –vm c:\path\to\jdk\bin\javaw.exe


6. November 2011



The Gamefromscratch PlayN installer is fairly straight forward in execution but has a few tricky points.  Also, I can’t be sure it will work 100% and you can refer to this process to see if your installation worked properly.



On occasion an environmental or Maven problem can occur during installation, or you weren’t fast enough installing the Android SDK.  If that happens, simply close the dos prompt then run the installer again.



First things first, download the GFSPlayNInstaller.  Extract this file anywhere on your computer, it will contain two files, a .CMD and at .PS1 file.  The PS1 file does all the work, but needs to be launched using the .CMD to have the proper permissions.  Do not run from within the zip, this will not work.  Throughout the install you might get a Windows firewall prompt regarding Java, this is part of the Google PlayN install process and should be granted permission.



Double click Install.cmd



A command prompt will open and you will receive a prompt to determine if your system is 32 or 64 bit; hopefully the detection is correct and you can simply click YES.






Now you will be prompted if you have a Java JDK installed ( the JRE is not enough! ).






If you do not have a JDK installed or you do not know, click No.  This will cause the JDK to be downloaded and installed automatically.  If you already have a JDK installed click Yes, and the following dialog will appear:






Simply navigate to the JDK directory and click OK.  Do NOT click cancel, I am not completely sure what will happen, but I doubt it’s good. Winking smile  If you clicked No earlier, you will not get this dialog.  If you clicked YES and the dialog didn’t appear, alt-tab around to see if it is there somewhere, it doesn’t always get focus.



Now you will be presented with this dialog:






This dialog is determining where PlayN is going to be installed.  If you simply click OK, it will be created in C:\.  Where ever you select a new folder PlayN will be created, so you do not need to create a folder just for it.  Again, don’t click Cancel…  Now the installer is going to go off and do its magic for a while….






Behind the scenes it is doing a number of things, downloading a zip program, grabbing Git and the Android SDK.  Even if you don’t want to develop for Android, you need the SDK installed for PlayN to work properly.  That is the next step and it is very important you do this part correctly as it was the only bit I could not automate!  You need to configure the Android SDK and you need to do it fairly quickly as the install will continue while the Android SDK install happens and eventually the install is going to depend on the SDK being installed.  Worst case scenario, run the installer again and simply close the Android SDK window when it opens.




As I said, this part is important, so I made a rather cryptic message box to inform you of just that!







Once you click OK, the race is on!  The Android SDK installer will be loaded and it should look like this:






It will take a minute or two to configure all of the various options… don’t be distracted by the installer going on in the background, keep your attention focused here!  First things first, once it’s done fetching info, click the “Deselect All” button to clear all selections.  Then you want to select Android 3 ( API11 )->SDK Platform, like this:







If everything was done correctly, the button will show “Install 1 package…”.  If you want more features, you can run the Android SDK Manager later… when you aren’t under type restraints! Winking smile


After you click the Install 1 package… button, you will see:





Simply click Install.



Alright, stressful bits are over, now just a matter of sitting back and letting the installer do it’s thing..







That was a screenshot of the installer doing it’s thing.  Frankly it isnt very exciting and yes, it’s a rather long process.  While that process is happening, the Android SDK Manager is chugging along and will eventually say:





Say whatever you want, it doesn’t really matter so you might as well go with Yes.  Eventually assuming success with the Maven process ( actually it runs even if there is a failure… if you see a whole bunch of failures, try running the installer again ), you will get the following prompt:







This is just another simple GFS provide script that builds your new game Maven script for you.  If you want to create a game of your own, click Yes.  If you click Yes…





The new game wizard will appear!  Simply fill in the values you want to make your game, like I have above and click Make Game!  Once you click “Make Game” a MakeGame.bat file will be created then run.  This process creates an actual game within your PlayN folder.  Unfortunately I couldn’t completely automated it and it will prompt you to continue.  When prompted ( in the dos prompt ) type Y then [Enter].  Voila, your new game is created!  If you chose C:\ for your PlayN folder, your game will be located at [C:\PlayN\PlayN\YourGame]



Finally, you will get one last prompt:





I hear there are all kinds of interesting things at that website, you should click Yes and check it out! Winking smile  If you click Yes, it will open your webbrowser ( or a new tab if already open ) and send you to




Voila, all done!  Enjoy PlayN!



If you want to create a new game at a later date, the New Game Wizard can be run again, it is located at Playn\Playn\NewGame.cmd.



If you encounter any problems, please let me know and I will do what I can.  Either use comments here, send me an email ( not preferred, because other people having the sample problem will not benefit from the results ) or I will piggyback the PlayN teams support process and request you post to StackOverflow with the PlayN tag and I will keep an eye on posts there.


14. October 2011



I am noticing from web logs a number of people are searching to discover if PlayN supports iOS as a target.  The short answer is no, the medium answer is maybe and the long answer is probably soon.



As it stands today PlayN targets Android, Java, HTML5 and Flash but no iOS.  That said HTML 5 and possibly Flash ( need research if the output from PlayN can be imported into Flash for export to iOS ) can be run on iOS 4 or higher devices.



Those looking for native iOS support though can take heart.  Take a look at issue 79 in the PlayN Issues list:


1. Implement a C (or Objective-C, if need be) backend for the GWT compiler
(I'm told @cromwellian has a very rough prototype of this).
2. Implement the ForPlay abstractions in terms of native iOS APIs.
3. Profit.


So, no, iOS native support is not available in PlayN, yet.  It is however on the radar, and the person whose radar it is on, is obviously a Slashdot fan!



We have to remember, PlayN is an extremely  young product, which will hopefully evolve quickly, so stay tuned!

Deep down inside I really wish Google kept the horrifically un-PC but much funnier ForPlay name! Understand why they didn't, but that doesn't make it any less of a shame.


13. October 2011



Alright, I may be that last person in the world to discover this, but its incredibly handy.


Today I was working with a command prompt and realized instead I would be better served using the file browser in this case.  On a lark instead of grabbing my mouse and launching Explorer I simply typed “explorer . “ and up came Explorer open to the current directory.


Very cool.


13. October 2011


Just a quick note to the people, like myself, that are checking out Google’s new game library PlayN.  The getting started guide says to

git clone


This will error out if you try it.  Instead use the url


I don’t know if this is a typo, or if the https version is down.  Anyways, a potential show stopper to someone new wishing to check out PlayN.


AppGameKit Studio

See More Tutorials on!

Month List