It is currently 27 Feb 2017, 02:06
   
Text Size

How to get started?

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, moomarc, DennisBergkamp, Rob Cashwalker, friarsol, Chris H., CCGHQ Admins

Re: How to get started?

Postby drdev » 10 Mar 2014, 14:21

excessum wrote:I need some basic help with understanding the codebase. I am completely unfamiliar with Java programming so bear with me if all this is really trivial.

Is there a way to insert breakpoints within forge-ai to study the call-stack? I was inserting the breakpoints in Eclipse and doing the "run as Java application" on forge-gui and fail to trigger any of the breakpoints. Specifically, I was studying "CurseAI" and inserting breakpoints in "pumpTgtAI" in PumpAI.java.
You need to use "Debug As" instead of "Run As" if you want to hit breakpoints.
drdev
Programmer
 
Posts: 1945
Joined: 27 Jul 2013, 02:07
Has thanked: 188 times
Been thanked: 560 times

Re: How to get started?

Postby xbon » 20 Apr 2014, 20:51

I keep getting

RA layer request failed
svn: REPORT of '/forge/!svn/vcc/default': Could not read response body: connection was closed by server (http://svn.slightlymagic.net)

on trying to import from svn checkout at random points.
xbon
 
Posts: 114
Joined: 04 Jun 2013, 22:52
Has thanked: 17 times
Been thanked: 1 time

Re: How to get started?

Postby moomarc » 21 Apr 2014, 16:11

I found I had better luck with avoiding timeouts with the checkout when I used command line instead of Eclipse for the initial checkout. Perhaps give that a try xbon.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 369 times
Been thanked: 369 times

Re: How to get started?

Postby xbon » 22 Apr 2014, 00:18

moomarc wrote:I found I had better luck with avoiding timeouts with the checkout when I used command line instead of Eclipse for the initial checkout. Perhaps give that a try xbon.
on svn i get an error as well w/o subclipse, e120106: ra_serf: The server sent a truncated HTTP response body. at random points. i can't complete the checkout in subclipse or svn right now.

should I be using the latest version of sliksvn, or 1.6?


edit: got tortoisesvn and did a clean up and update to pick up from where it left off; I'll see if this works.


So I checked out with tortoiseSVN successfully, however now when I try to run as java application, it can't find the main class file....

"Selection does not contain a main type."
xbon
 
Posts: 114
Joined: 04 Jun 2013, 22:52
Has thanked: 17 times
Been thanked: 1 time

Re: How to get started?

Postby Sloth » 22 Apr 2014, 06:33

xbon wrote:So I checked out with tortoiseSVN successfully, however now when I try to run as java application, it can't find the main class file....

"Selection does not contain a main type."
The new main class is in forge-gui-desktop.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: How to get started?

Postby timmermac » 26 Jun 2014, 15:15

Trying to run from SVN, when performing the run-as command as described, I get the following error

Code: Select all
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
   Cannot switch on a value of type String. Only convertible int values or enum constants are permitted

   at forge.view.Main.main(Main.java:58)
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1328
Joined: 17 May 2010, 20:36
Has thanked: 17 times
Been thanked: 65 times

Re: How to get started?

Postby drdev » 26 Jun 2014, 16:15

timmermac wrote:Trying to run from SVN, when performing the run-as command as described, I get the following error

Code: Select all
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
   Cannot switch on a value of type String. Only convertible int values or enum constants are permitted

   at forge.view.Main.main(Main.java:58)
Do you have Java 7 installed? Java 7 is required for switching on strings to be supported.
drdev
Programmer
 
Posts: 1945
Joined: 27 Jul 2013, 02:07
Has thanked: 188 times
Been thanked: 560 times

Re: How to get started?

Postby timmermac » 26 Jun 2014, 16:39

Yep. Java 7 is running on my computer.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1328
Joined: 17 May 2010, 20:36
Has thanked: 17 times
Been thanked: 65 times

Re: How to get started?

Postby moomarc » 01 Jul 2014, 20:33

Is Java 7 set as your compiler though? If you were using java 6 when you first set up your svn, you possibly need to change that
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 369 times
Been thanked: 369 times

Re: How to get started?

Postby troyready » 08 Jul 2014, 22:39

I've been having trouble getting m2e & Eclipse setup, so I thought I'd take up friarsol's suggestion and try IntelliJ. It seems to be working properly, but I'm not quite sure how to get started with building the project (specifically the desktop app).

I configured the global SDKs to point to my Android SDK install and my system install of JDK 7:
platformsdks.png
Platform SDKs


I then configured my forge project SDK to 1.7. However, when trying to build the project with the following settings, I get the message "Error:Android Pre Dex: [forge] Android SDK is not specified".
buildoptions.png
Build/Run options


I've tried changing the SDK for the top level forge module (see next pic), but then builds quickly fail with the following output:
Code: Select all
/usr/lib/jvm/default-java/bin/java -Didea.launcher.port=7534 -Didea.launcher.bin.path=/home/troyr1/code/idea-IC-135.909/bin -Dfile.encoding=UTF-8 -classpath /usr/lib/jvm/default-java/jre/lib/charsets.jar:/usr/lib/jvm/default-java/jre/lib/management-agent.jar:/usr/lib/jvm/default-java/jre/lib/rt.jar:/usr/lib/jvm/default-java/jre/lib/jsse.jar:/usr/lib/jvm/default-java/jre/lib/resources.jar:/usr/lib/jvm/default-java/jre/lib/compilefontconfig.jar:/usr/lib/jvm/default-java/jre/lib/rhino.jar:/usr/lib/jvm/default-java/jre/lib/javazic.jar:/usr/lib/jvm/default-java/jre/lib/jce.jar:/usr/lib/jvm/default-java/jre/lib/ext/localedata.jar:/usr/lib/jvm/default-java/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/default-java/jre/lib/ext/zipfs.jar:/usr/lib/jvm/default-java/jre/lib/ext/pulse-java.jar:/usr/lib/jvm/default-java/jre/lib/ext/dnsns.jar:/usr/lib/jvm/default-java/jre/lib/ext/java-atk-wrapper.jar:/usr/lib/jvm/default-java/jre/lib/ext/sunjce_provider.jar:/home/troyr1/magic/intellij/forge/forge-gui-desktop/target/classes:/home/troyr1/magic/intellij/forge/forge-core/target/classes:/home/troyr1/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar:/home/troyr1/.m2/repository/org/apache/commons/commons-lang3/3.3/commons-lang3-3.3.jar:/home/troyr1/magic/intellij/forge/forge-game/target/classes:/home/troyr1/.m2/repository/com/googlecode/minlog/1.2/minlog-1.2.jar:/home/troyr1/magic/intellij/forge/forge-ai/target/classes:/home/troyr1/magic/intellij/forge/forge-net/target/classes:/home/troyr1/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-websocket/8.1.14.v20131031/jetty-websocket-8.1.14.v20131031.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-util/8.1.14.v20131031/jetty-util-8.1.14.v20131031.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-io/8.1.14.v20131031/jetty-io-8.1.14.v20131031.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-http/8.1.14.v20131031/jetty-http-8.1.14.v20131031.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-server/8.1.14.v20131031/jetty-server-8.1.14.v20131031.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-continuation/8.1.14.v20131031/jetty-continuation-8.1.14.v20131031.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-servlet/8.1.14.v20131031/jetty-servlet-8.1.14.v20131031.jar:/home/troyr1/.m2/repository/org/eclipse/jetty/jetty-security/8.1.14.v20131031/jetty-security-8.1.14.v20131031.jar:/home/troyr1/magic/intellij/forge/forge-gui/target/classes:/home/troyr1/.m2/repository/com/thoughtworks/xstream/xstream/1.4.7/xstream-1.4.7.jar:/home/troyr1/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:/home/troyr1/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:/home/troyr1/.m2/repository/org/freemarker/freemarker/2.3.20/freemarker-2.3.20.jar:/home/troyr1/.m2/repository/com/miglayout/miglayout/3.7.4/miglayout-3.7.4.jar:/home/troyr1/.m2/repository/com/mortennobel/java-image-scaling/0.8.5/java-image-scaling-0.8.5.jar:/home/troyr1/.m2/repository/com/jhlabs/filters/2.0.235/filters-2.0.235.jar:/home/troyr1/.m2/repository/junit/junit/4.10/junit-4.10.jar:/home/troyr1/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/home/troyr1/.m2/repository/com/googlecode/soundlibs/jlayer/1.0.1-1/jlayer-1.0.1-1.jar:/home/troyr1/code/idea-IC-135.909/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain forge.view.Main
FSkin > can't find skins directory!
main > java.lang.ExceptionInInitializerError
   at forge.Singletons.initializeOnce(Singletons.java:50)
   at forge.view.Main.main(Main.java:48)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.RuntimeException: Cannot find default skin.
   at forge.toolbox.FSkin.loadLight(FSkin.java:1006)
   at forge.toolbox.FSkin.loadLight(FSkin.java:1008)
   at forge.view.SplashFrame.<init>(SplashFrame.java:70)
   at forge.view.FView.<init>(FView.java:66)
   at forge.view.FView.<clinit>(FView.java:38)
   ... 7 more

Exception: java.lang.ExceptionInInitializerError thrown from the UncaughtExceptionHandler in thread "main"

Process finished with exit code 1
forgemodule-android.png
forge module settings


Not sure if I'm messing up something Android specific or missing something else entirely. Would greatly appreciate anyone's direction and assistance here!
troyready
 
Posts: 9
Joined: 03 Jul 2014, 22:41
Has thanked: 1 time
Been thanked: 0 time

Re: How to get started?

Postby KrazyTheFox » 08 Jul 2014, 23:05

"FSkin > can't find skins directory!"
That's the problem that you need to fix. I'm away from my computer and haven't tried setting up Forge in IntelliJ yet (just started using it recently) so I'm not sure what to do off the top of my head.
User avatar
KrazyTheFox
Programmer
 
Posts: 678
Joined: 18 Mar 2014, 23:51
Has thanked: 65 times
Been thanked: 196 times

Re: How to get started?

Postby friarsol » 08 Jul 2014, 23:36

KrazyTheFox wrote:"FSkin > can't find skins directory!"
That's the problem that you need to fix. I'm away from my computer and haven't tried setting up Forge in IntelliJ yet (just started using it recently) so I'm not sure what to do off the top of my head.
I believe you need to set both your working directory and the classpath of the configuration to ..\forge\forge-gui-desktop

the main Class should be forge.view.Main
friarsol
Global Moderator
 
Posts: 6970
Joined: 15 May 2010, 04:20
Has thanked: 218 times
Been thanked: 806 times

Re: How to get started?

Postby troyready » 09 Jul 2014, 00:13

That was it -- thank you so much!
troyready
 
Posts: 9
Joined: 03 Jul 2014, 22:41
Has thanked: 1 time
Been thanked: 0 time

Re: How to get started?

Postby jestervlc » 24 Jul 2014, 17:14

Hi, I have downloaded the project and installed it according to the instructions. I have been able to build the typical jar file (via Maven) correctly. But if I want to run/debug with Eclipse, once I click the run as Java application, Eclipse doesn't provide me a list of classes to choose from.

If I download just the forge-gui-desktop module, then the expected textbox with the classes appear and I can choose, but possibly I lack an additional folder or library and I get an error similar to the "can't find skins directory".

What do you recomend me to try next? I have mostly worked with JDeveloper rather than eclipse, and the project management (compilation,...) is somehow different.
jestervlc
 
Posts: 7
Joined: 19 Jul 2014, 16:16
Has thanked: 0 time
Been thanked: 0 time

Re: How to get started?

Postby PeterPrins » 16 Aug 2014, 18:20

Hi, I'm trying to set up my development tools using the 'Forge: How to Get Started Developing Forge' page on the wiki. I have a question about Subversion: Should I compile it myself, or can I use one of the third party binaries, and if so, which one would you recommend? (Edit: By Subversion I mean SVN, not the card :p )
PeterPrins
 
Posts: 3
Joined: 19 Jul 2014, 15:54
Has thanked: 0 time
Been thanked: 8 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 5 guests


Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 5 guests

Login Form