EDIT: 11/7/2011 Google has published to Maven Central, which makes this entire process obsolete. Refer to here for new instructions. Fortunately the new process is much nicer and faster.
PlayN is a wonder piece of technology with a horrible installation process, which is a shame as I think more people should check it out. So I decided to do something about it, I wrote an installer!
I have made the process (almost ) as simple as possible. For much more detailed process or if you encounter a problem more detailed instructions are available here.
First download the tools available here.
Extract the zip file to any folder ( make sure you extract though, do not run from the zip ) and run Install.cmd.
Now it is simply a matter of answering a couple Yes/No questions, and (optionally) point the installer at your JDK folder and telling it where you want PlayN to be installed. Except the gotcha… read about that below before running the install!
The only major gotcha is you *must* install the Android 3.0 SDK Platform, and you have to do it in a bit of a hurry, as the SDK install will happen in parallel to the PlayN install which is eventually going to need the Android SDK installed to continue. I chose to do this because both installs are fairly long and the Android install *should* be completed long before it is needed. When this screen appears, move quickly! To keep the install quick, click “deselect all” then choose Android 3.0 (API11)->SDK Platform. You can run the Android SDK Manager again later if you want to add more features. If for some reason the installer outpaced the Android SDK Manager, simply run the installer again.
If you already have the Android SDK installed, this process *may* hijack your ANDROID_HOME environment variable. When complete, simply change it back if you wish.
The installer and wizard consist of about 500 lines of Powershell script. For the record, I have never used Powershell before, so it’s 500 lines of ugly Powershell script!
The entire script is documented, so before running you can see exactly what it is going to do, and if it has a problem or you want to install different versions of Maven, Git or the JDK, you can change those URLs right at the top.
Over the course of execution, the script:
– downloads and configured the JDK [optional]
– downloads 7zip for later use ( from GameFromScratch.com )
– downloads and installs ( local ) Git
– downloads and runs the Android SDK
– Git’s PlayN from googlecode
– Downloads and installs Maven
– Runs Maven on the PlayN code
– Downloads and installed the New Game Wizard from GFS.com
– Runs the New Game Wizard [optional]
Java runtime. The java sdk will be installed as part of this process, but the java runtime will not.
Powershell 2.0. Tested on Windows 7 with Powershell 2.0, should work on Windows Server 2008 but untested. *May* work on Vista, untested. *Should* work on Windows XP, but you will need to download and install Powershell 2.0 first. Powershell 2.0 ships with Windows 7, and Powershell 1.0 ships with Vista and may require updating using the link above.
What files are created?
Everything is created under the PlayN installation folder you selected, except a few temp files such as the JDK installer. These are located in your %TEMP% folder and can be deleted whenever you wanted.
How do I uninstall?
Simply delete the downloaded scripts. If you want to erase your PlayN install, first stop adb ( the Android debugger ). To do so, load the task manager ( CTRL + SHIFT + ESC ), find adb.exe, right click and end process. Now simply delete the PlayN folder you created as part of the install.
Anything else I need to know?
Yeah, the install won’t have touched your Maven or Git configurations if those are already installed, but unfortunately as part of the process we had to update the ANDROID_HOME environment variable. So if you already have the Android SDK installed on your machine, you will need to update ANDROID_HOME to point to your installed SDK. This can be accomplished from a command prompt by typing:
Setx ANDROID_HOME “c:yourandroidsdklocation”
The new game wizard is installed as part of this process and can be located at [PlayN Folder]PlayNNewGame.cmd if you want to create a new game in the future.
If you want to install more Android SDK features after the install is complete, the Android SDK is located at PlayNAndroidSDK Manager.exe. Yes, there is a space in the name, and no, I don’t know what the hell Google was thinking when they did that…
Running Maven after the fact is a bit of a pain in the ass. I did not set the environment variable as part of the installed ( in case you already had Maven installed I didn’t want to break anything ) so now you have to fully resolve Maven to run it, such as c:Playnmavenapache-maven-3.0.3binmvn.bat [your command] if you think that gets old in a hurry, you are correct! The easiest answer is to add the maven Bin directory to your path, such as:
Setx PATH = “%PATH%;c:playnmavenapache-maven-3.0.3bin”
Be careful with the above syntax as you don’t want to screw up your PATH variable. Try it with a straight SET first ( no X ), then type “SET PATH” to verify it looks correct. If you are sure it does, run it again using SETX. At this point you can run Mvn from any directory.
IT STILL DOESN’T WORK!!!!
That’s not really shocking, there are a ton of moving pieces! Also, I made NO checks to make sure files existed across the network or that your internet connection was up, as both of these would simply be catastrophic failures anyways. My first suggestion is checking all the URLs at the top of the install script with your browser to make sure they are all still valid and connectivity to each site is fine. I also have no control over if Google break their build, but if they do, let me know and I can patch the script accordingly.
If you have other problems, post them here, email me ( not preferred because others won’t be able to read the results ) or use the PlayN tag on StackOverflow.com and I will monitor there as well.