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 oskarolw » 07 Feb 2014, 11:48
Max, I tried to Run As... and tried some of the Maven options and also tried to run it as Java but I can't seem to do that anymore. I don't really know what my Run Configuration should look like. But I don't really understand how the Maven works either, like I said if I import from maven now I get like a copy of forge-gui that has tons of errors in it.
Re: How to get started?
by Chris H. » 09 Feb 2014, 22:38
oskarolw wrote:I don't quite get how Run Configurations are supposed to work. I can not seem to run anything as Java but I have the options to run as Maven, that gives me some log-output which sais something like:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[INFO] Forge Parent ...................................... SKIPPED
[INFO] Forge Core ........................................ SKIPPED
[INFO] Forge Game ........................................ SKIPPED
[INFO] Forge AI .......................................... SKIPPED
[INFO] Forge Net ......................................... SKIPPED
[INFO] Forge ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
I select the Package Explorer view and then select ForgeLocal [trunk]. From there I go to
Run -> Run Configurations…
Then select Java Application on the left and click on the
New launch configuration
icon that is located above the type filter text object. Give an appropriate name in the name box. Then make sure that the Main tab is selected. Then enter the following data into the Project and Main class boxes:
Project
forge-gui
Main class
forge.view.Main
Then select the (x)= Arguments tab and enter in the following VM arguments
VM arguments
-Xmx1024m
and this will increase the java heap space as Forge is run. Click on the Apply button and then click on the Run button. Forge should then launch.
From then on you should be able to launch forge by selecting the Package Explorer view and then select ForgeLocal [trunk]. And from there you can select
Run -> Run History
and select your launch configuration form the list shown.
I would suggest that you ignore the
Run -> Run As
Maven commands. Dave is our resident Maven expert and he set up our current Maven system. Prior to this I had to hand build the project and the archive and this was a lot of time consuming work to do on a daily basis. I now execute from a term window a couple of shell scripts that do the work for me. Maven is testing, building and deploying the archive to our cardforge site.

-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: How to get started?
by oskarolw » 10 Feb 2014, 08:50
Thank you for your help!
My issue seems to be that Eclipse can not find any projects (even though they exist)


My issue seems to be that Eclipse can not find any projects (even though they exist)


Re: How to get started?
by moomarc » 10 Feb 2014, 14:48
It looks like you haven't done the 'import existing maven project' step.
Go File > Import, then select Existing Maven Project as per the screen shot below.
Change Root Directory to your the root project you have there already. I think Chris said at some point you only need to import the forge-gui module, but I just select all the checkboxes. Click Finish and you should be done. Possibly run Maven > Update Project from the right click context menu. After that you can just update with usual SVN synchronise. If at some point it stops working, try the maven update again or try import existing project again as a new module might have been added.
Go File > Import, then select Existing Maven Project as per the screen shot below.
Change Root Directory to your the root project you have there already. I think Chris said at some point you only need to import the forge-gui module, but I just select all the checkboxes. Click Finish and you should be done. Possibly run Maven > Update Project from the right click context menu. After that you can just update with usual SVN synchronise. If at some point it stops working, try the maven update again or try import existing project again as a new module might have been added.
-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 oskarolw » 11 Feb 2014, 10:12
I did the maven-import again and now I am kinda back to where I was before. I get a few errors like in the picture and if I try to run it as java it sais it can't find the Main-file, even though I can search for it in the Run Config...


Re: How to get started?
by Max mtg » 11 Feb 2014, 11:20
I guess we really need some tutorial videos 
Will anyone record a video dedicated to working environment setup? A speaker with native English (or a very well learnt one) is preferred of course.
I'll do it on Sunday if noone else does by that day. (and my English is neither good nor natrive

Will anyone record a video dedicated to working environment setup? A speaker with native English (or a very well learnt one) is preferred of course.
I'll do it on Sunday if noone else does by that day. (and my English is neither good nor natrive

Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: How to get started?
by moomarc » 11 Feb 2014, 13:47
Looking at the errors, he's almost there though. Its just looking for the other module's poms, so I guess you do need to import all the modules. So import the others, then update project via maven in context menu, and I think it should work. I did mine a while ago, but after that and getting the run configuration right, I think it should work. The config should look like the attached image.
-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 oskarolw » 11 Feb 2014, 14:06
Yey now it works again! Thank you guys 
It was so confusing that you need doubles of all the projects, I think the reason it broke before was probably that forge-net was introduced and I didn't make new maven-imports? :S
So like I wrote in another thread now I just need to figure out the structure a bit better, if Max or someone else has time to do a small tutorial it would be awesome.

It was so confusing that you need doubles of all the projects, I think the reason it broke before was probably that forge-net was introduced and I didn't make new maven-imports? :S
So like I wrote in another thread now I just need to figure out the structure a bit better, if Max or someone else has time to do a small tutorial it would be awesome.
Re: How to get started?
by Headrock » 03 Mar 2014, 00:18
Alrighty, my turn now.
So here's what I've done so far:
1) Downloaded and installed the JDK. It also installed something called Glassfish, which I was unhappy with, but I figure there was no other way to install the JDK anyway so I just went with it.
2) Downloaded and installed Eclipse. Went smooth.
3) Failed to download and install Subclipse. It seems that the "Install New Software" menu is incapable of connecting to any repository I've tried, something called a "provision exception". I searched google for an answer, tried a lot of stuff to get it to work, including turning off my firewall and adding arguments to the eclipse run command, no go.
4) Drdev said I would be fine just using Tortoise to get the source and open it in Eclipse. Tortoise did work just fine and I checked out the trunk. So far so good.
5) After several attempts to import the source code as a project into Eclipse, I have yet to be able to run the program properly. My most "successful" attempt was this:
* Right-click on the project explorer -> import -> Existing projects into workspace -> Set the source code directory, checked "search for nested", then checked all projects that appeared as well as "copy into workspace".
* With this, most projects are listed as having errors (small red x on the project icon), and the error log shows 16,301 errors (btw, how can I actually see more than the first 100 errors?). I can run the forge-m-desktop project, which gives me a splash screen and then freezes with an error in the build results window. Attempts to run the forge-gui project result in the following:
Your turn, code wizards.
So here's what I've done so far:
1) Downloaded and installed the JDK. It also installed something called Glassfish, which I was unhappy with, but I figure there was no other way to install the JDK anyway so I just went with it.
2) Downloaded and installed Eclipse. Went smooth.
3) Failed to download and install Subclipse. It seems that the "Install New Software" menu is incapable of connecting to any repository I've tried, something called a "provision exception". I searched google for an answer, tried a lot of stuff to get it to work, including turning off my firewall and adding arguments to the eclipse run command, no go.
4) Drdev said I would be fine just using Tortoise to get the source and open it in Eclipse. Tortoise did work just fine and I checked out the trunk. So far so good.
5) After several attempts to import the source code as a project into Eclipse, I have yet to be able to run the program properly. My most "successful" attempt was this:
* Right-click on the project explorer -> import -> Existing projects into workspace -> Set the source code directory, checked "search for nested", then checked all projects that appeared as well as "copy into workspace".
* With this, most projects are listed as having errors (small red x on the project icon), and the error log shows 16,301 errors (btw, how can I actually see more than the first 100 errors?). I can run the forge-m-desktop project, which gives me a splash screen and then freezes with an error in the build results window. Attempts to run the forge-gui project result in the following:
Attempts to run the ForgeLocal project give me the run configuration menu, where I've tried inputting the values mentioned in previous posts. This results in the same error message as above.Exception in thread "main" java.lang.Error: Unresolved compilation problems:
CardStorageReader cannot be resolved to a type
CardStorageReader cannot be resolved to a variable
CardStorageReader cannot be resolved to a type
CardStorageReader cannot be resolved to a type
CardStorageReader cannot be resolved to a type
Observer cannot be resolved to a type
StaticData cannot be resolved to a type
StaticData cannot be resolved to a type
at forge.Singletons.initializeOnce(Singletons.java:59)
at forge.view.Main.main(Main.java:39)
Your turn, code wizards.
Re: How to get started?
by moomarc » 03 Mar 2014, 05:26
Have you performed the maven related steps mentioned a few posts above? or: once you have your project imported, go to file>import>maven>from existing project. Import all the packages listed. That should help.
There was also an issue with nobody being able to compile the project recently due to some changes in the maven setup. Those changes have been reverted now so maybe that was also affecting you
There was also an issue with nobody being able to compile the project recently due to some changes in the maven setup. Those changes have been reverted now so maybe that was also affecting you
-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 Headrock » 03 Mar 2014, 05:57
Well my main problem with Maven is that, again, I can't do "install new software"...
Re: How to get started?
by moomarc » 03 Mar 2014, 06:06
Unfortunately I'm not well-enough acquainted with Eclipse to help out there. I just installed the version of Eclipse with Maven integration included when I set everything up again as a 64-bit setup. When I'm on my PC later I can also get the repository locations I used for subversion. I hope youanagr to get this all working. I think there's a lot of people hoping to see you get the strategy later working.
-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 swordshine » 03 Mar 2014, 09:11
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: How to get started?
by Headrock » 03 Mar 2014, 16:18
@ Swordshine, yeah I did follow that page's instructions, right up to the point where Eclipse totally refused to download (or indeed locate) any plugins, so that's a no-go.
Re: How to get started?
by Chris H. » 03 Mar 2014, 16:50
Headrock wrote:Well my main problem with Maven is that, again, I can't do "install new software"...
When you select the Help -> Install New Software… from within Eclipse you should get the following dialog, do you get a similar dialog?
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Who is online
Users browsing this forum: No registered users and 18 guests