How to get started?
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: How to get started?
by drdev » 10 Mar 2014, 14:21
You need to use "Debug As" instead of "Run As" if you want to hit breakpoints.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.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: How to get started?
by 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.
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.
Re: How to get started?
by 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
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: How to get started?
by xbon » 22 Apr 2014, 00:18
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.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.
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."
Re: How to get started?
by Sloth » 22 Apr 2014, 06:33
The new main class is in forge-gui-desktop.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."
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: How to get started?
by 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
Re: How to get started?
by drdev » 26 Jun 2014, 16:15
Do you have Java 7 installed? Java 7 is required for switching on strings to be supported.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)
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: How to get started?
by 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
Re: How to get started?
by 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
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: How to get started?
by 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:
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".
I've tried changing the SDK for the top level forge module (see next pic), but then builds quickly fail with the following output:
Not sure if I'm messing up something Android specific or missing something else entirely. Would greatly appreciate anyone's direction and assistance here!
I configured the global SDKs to point to my Android SDK install and my system install of JDK 7:
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".
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
Not sure if I'm messing up something Android specific or missing something else entirely. Would greatly appreciate anyone's direction and assistance here!
Re: How to get started?
by 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.
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.
-
KrazyTheFox - Programmer
- Posts: 725
- Joined: 18 Mar 2014, 23:51
- Has thanked: 66 times
- Been thanked: 226 times
Re: How to get started?
by friarsol » 08 Jul 2014, 23:36
I believe you need to set both your working directory and the classpath of the configuration to ..\forge\forge-gui-desktopKrazyTheFox 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.
the main Class should be forge.view.Main
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: How to get started?
by 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.
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?
by 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
Who is online
Users browsing this forum: No registered users and 45 guests