GettingStarted

97 views
Skip to first unread message

Arthur Godoy

unread,
Aug 27, 2011, 8:01:21 PM8/27/11
to pl...@googlegroups.com
Hello for everyone,

I am trying to install PlayN using the GettingStarted walkthrough (http://code.google.com/p/forplay/wiki/GettingStarted), because i didnt find any new version of it.
But when i am in "Importing projects in eclipse" step it didnt find any project importable, no folder have a ".project" file or anything like that. What i should do to start working with PlayN?

These are all steps i did:

1- Installed Eclipse 3.7;
2- Installed GWT 2.3;
3- Cloned git repository "https://code.google.com/p/playn" using TortoiseGit (http://code.google.com/p/tortoisegit/);
4- Open eclipse importing projects wizard;

I'm running on Windows 7 x64.

Thanks in advance,
Arthur

Michael Bayne

unread,
Aug 27, 2011, 8:19:31 PM8/27/11
to pl...@googlegroups.com
On Sat, Aug 27, 2011 at 5:01 PM, Arthur Godoy <arthur...@gmail.com> wrote:
> I am trying to install PlayN using the GettingStarted walkthrough
> (http://code.google.com/p/forplay/wiki/GettingStarted), because i didnt find
> any new version of it.

Try the instructions on this page, in the "Building with Eclipse and
Maven (m2e)" section:

http://code.google.com/p/playn/wiki/CheckoutReviewCommit

-- m...@samskivert.com

Dorian Manning

unread,
Aug 27, 2011, 8:29:08 PM8/27/11
to pl...@googlegroups.com
Also, I have have been posting the changes I have been making to my project to make it build in eclipse on Win 7 x64 in the Maven Wrangling thread. I've made it through the whole build process at this point with a few unresolved errors. I guess it should be as easy as documented on that wiki page, for most, but if you run into any of the problems I had you can check that thread for solutions for now. I would expect to update the wiki with any changes that couldn't be made to the main branch of the project, once I get all the errors resolved.

Arthur Godoy

unread,
Aug 27, 2011, 10:01:33 PM8/27/11
to pl...@googlegroups.com
Thanks for all answers!
I tryed both versions of eclipse (x86 and 64) and had the same error. In my case a missing lib of maven: ".m2\repository\com\sun\tools\1.6\tools-1.6.jar"
There is a way to resolve this?

bsles...@gmail.com

unread,
Aug 27, 2011, 10:07:10 PM8/27/11
to pl...@googlegroups.com
I'm seeing something similar. IntelliJ is complaining that it can't resolve the tools.jar dependency (on a Mac).

This link explains about how to configure Maven, but since I'm a complete novice at Maven, I don't have enough context to really judge:

Arthur Godoy

unread,
Aug 27, 2011, 10:17:05 PM8/27/11
to pl...@googlegroups.com
I removed the profile section for tools in pom.xml like suggested in topic "Trouble playn to compile"(https://groups.google.com/d/topic/playn/Wwx6uy5k4Fc/discussion). And now sample projects (HelloGameJava) it's building!
But, when start running i can just see a gradient blue background... Anyone know what's wrong?

Michael Bayne

unread,
Aug 27, 2011, 10:37:16 PM8/27/11
to pl...@googlegroups.com
Nothing wrong. Just click the mouse to see sprites added to the screen.

-- m...@samskivert.com

Arthur Godoy

unread,
Aug 28, 2011, 2:59:29 PM8/28/11
to pl...@googlegroups.com
Thank you man for the tip. ;)
But i got another doubt. How can i run this example (HelloGame) in HTML5? "Run as" dont give me this option or similar.

PS: I1m running on Eclipse Java Developer version like in topic : http://code.google.com/p/playn/wiki/CheckoutReviewCommit .

Dave LeCompte

unread,
Aug 28, 2011, 3:08:55 PM8/28/11
to pl...@googlegroups.com
Does the "Run As" menu have an option to run as "Web Application"?

Dorian Manning

unread,
Aug 28, 2011, 3:10:50 PM8/28/11
to pl...@googlegroups.com

I also don't have options for flash and html projects.

Arthur Godoy

unread,
Aug 28, 2011, 3:14:15 PM8/28/11
to pl...@googlegroups.com
Don't have. -.-
I will try to install Java EE Eclipse edition.

Dave LeCompte

unread,
Aug 28, 2011, 3:33:29 PM8/28/11
to pl...@googlegroups.com
Hm, this: http://blog.philbit.com/2011/06/getting-started-with-forplay.html
says you want the "Eclipse IDE for Java Developers".

Michael Bayne

unread,
Aug 28, 2011, 3:42:28 PM8/28/11
to pl...@googlegroups.com
On Sun, Aug 28, 2011 at 11:59 AM, Arthur Godoy <arthur...@gmail.com> wrote:
> But i got another doubt. How can i run this example (HelloGame) in HTML5?
> "Run as" dont give me this option or similar.

Compiling the HTML5 version of the game in using the standard Eclipse
mechanisms is cumbersome, and not easy to test.

I recommend using the build.xml Ant script, which you can also run
from within Eclipse:

Expand the playn-hello project in the Package Explorer, right click on
the build.xml file and select "Run as -> Ant build..." (the one with
the ... not the one without). Then uncheck "compile" and check
"run-html" and click Run.

This will compile the JavaScript version of the game and run an
embedded Jetty process that allows you to test it. Look in the console
tab and you should see it report this output after the compilation is
done:

[echo] =================================================================
[echo] Browse to http://localhost:8080/hello/HelloGame.html
[echo] =================================================================

One you see that, you can browse to the reported URL to play the HTML5
version of the game in your desired browser.

When you're done, click the red square in the UI to the right of the
Console tab to terminate the running Jetty process.

-- m...@samskivert.com

Arthur Godoy

unread,
Aug 28, 2011, 4:48:11 PM8/28/11
to pl...@googlegroups.com
Thank you Michael! ^^

But i got this error when running "Ant build...":  T_T
-prepare:
[artifact:dependencies] Downloading: com/googlecode/playn/playn-java/1.0-SNAPSHOT/playn-java-1.0-SNAPSHOT.pom from repository forplay-legacy at http://forplay.googlecode.com/svn/mavenrepo
[artifact:dependencies] Unable to locate resource in repository
[artifact:dependencies] [INFO] Unable to find resource 'com.googlecode.playn:playn-java:pom:1.0-SNAPSHOT' in repository forplay-legacy (http://forplay.googlecode.com/svn/mavenrepo)
[artifact:dependencies] Downloading: com/googlecode/playn/playn-java/1.0-SNAPSHOT/playn-java-1.0-SNAPSHOT.jar from repository forplay-legacy at http://forplay.googlecode.com/svn/mavenrepo
[artifact:dependencies] Unable to locate resource in repository
[artifact:dependencies]
[INFO] Unable to find resource 'com.googlecode.playn:playn-java:jar:1.0-SNAPSHOT' in repository forplay-legacy (http://forplay.googlecode.com/svn/mavenrepo)
[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies]  Diagnosis:
[artifact:dependencies] 
[artifact:dependencies] Unable to resolve artifact: Missing:

Why is it searching for "playn-java.jar.1.0-SNAPSHOT" in the forplay repository? How i change it?


Dorian Manning

unread,
Aug 28, 2011, 5:53:15 PM8/28/11
to pl...@googlegroups.com
It works for me, but isn't contradictory to the way the other types of projects are run? Is this the ideal way to run these types of projects in the long run or more of a temporary solution? 

Michael Bayne

unread,
Aug 28, 2011, 6:50:11 PM8/28/11
to pl...@googlegroups.com
On Sun, Aug 28, 2011 at 1:48 PM, Arthur Godoy <arthur...@gmail.com> wrote:
> Why is it searching for "playn-java.jar.1.0-SNAPSHOT" in the forplay
> repository? How i change it?

Ah, I forgot you need to "mvn install" the main library jars into your
local Maven repository first.

Right click on playn-project and select Run as -> Maven install. This
will take a long time (5 minutes on my pretty fast computer), but when
you're done you should be able to run the hello sample in HTML5 mode
as I described.

-- m...@samskivert.com

Michael Bayne

unread,
Aug 28, 2011, 6:54:25 PM8/28/11
to pl...@googlegroups.com
On Sun, Aug 28, 2011 at 2:53 PM, Dorian Manning <dmann...@gmail.com> wrote:
> It works for me, but isn't contradictory to the way the other types of
> projects are run? Is this the ideal way to run these types of projects in
> the long run or more of a temporary solution?

It is possible to build the JavaScript version of the game in the
"standard Eclipse" way, if you first do some manual steps to configure
the GWT Eclipse plugin (unfortunately it does not auto-detect that
imported projects are GWT projects).

However, I am not aware of any way to build the JavaScript version of
the game *and* temporarily serve it up via HTTP so that it can be
tested, from within Eclipse. You cannot just point the browser at the
generated JavaScript game on the file system, it has to be served up
via HTTP.

AFAIK, using the Ant build target is the only way that you can easily
test your game in HTML5.

If you use the "Run as -> Web application" command in Eclipse, that
runs the game in GWT devmode, which is unusably slow, due to the way
GWT devmode works. There's no way we will ever be able to make running
a game in GWT devmode fast, which is why we recommend that you do most
of your testing using the Java backend, and only periodically test the
HTML5 backend by compiling the game to JavaScript (which takes a long
time, and is not suitable for frequent testing and debugging).

-- m...@samskivert.com

Ray Cromwell

unread,
Aug 28, 2011, 7:52:27 PM8/28/11
to pl...@googlegroups.com
With maven, you could define a war and use "mvn jetty:run". With
IntelliJ, I create a Web artifact and then run it as a Tomcat
runnable. I would think Eclipse has to hack some notion of "take the
artifacts of these sub-projects and put them into an exploded-war". It
looks like you can Publish to AppEngine and view it
(http://code.google.com/webtoolkit/usingeclipse.html#compiling) , it
seems like an oversight if you can't run the GAE Dev server without
using GWT DevMode.

-Ray

Arthur Godoy

unread,
Aug 28, 2011, 8:08:26 PM8/28/11
to pl...@googlegroups.com
Finally the HTML5 example worked!! =)

Thanks everyone for the help!


Next step for me it's install Android SDK and to try its example..


Regards,
Arthur
Reply all
Reply to author
Forward
0 new messages