Page 1 of 18

How to get started?

PostPosted: 19 Apr 2009, 19:38
by TimGradwell
Would somebody mind telling me the bare minimum I'd need to compile the game?

Thanks

Tim

Re: How to get started?

PostPosted: 19 Apr 2009, 20:27
by DennisBergkamp
Eclipse with java 1.5 or 1.6 should do the trick :)

Re: How to get started?

PostPosted: 19 Apr 2009, 21:36
by TimGradwell
I've installed eclpise. I've downloaded the source from svn.

I'm trying to open the project? Workspace? I'm not sure what it is I can actually open.

Pointer please? :)

Re: How to get started?

PostPosted: 19 Apr 2009, 22:26
by DennisBergkamp
I don't think it matters what directory you set your workspace, but be sure you follow these steps:

Start up Eclipse (just click ok when it asks for the location of the workspace to use)
File -> New Java Project -> Create Project from Existing Source (point this to the directory where the MTGForge source is), just name the project whatever, and click finish.

Re: How to get started?

PostPosted: 20 Apr 2009, 19:50
by Rob Cashwalker
I've downloaded the source from svn.
I don't think the SVN source is up-to-date.... Try the source file that's included with the 4/19 beta release.

Re: How to get started?

PostPosted: 20 Apr 2009, 21:54
by mtgrares
The SVN is not up to date, you have to use the source from the zipfile.

Re: How to get started?

PostPosted: 20 Apr 2009, 22:26
by TimGradwell
Ok, thanks.

Re: How to get started?

PostPosted: 17 Aug 2009, 15:46
by mtgrares
Just unzip the source code into a directory and using Java 1.6 you can compile everything. Also see "Readme-Compile.htm" since MTG Forge needs some files in order to run like cards.txt, up.gif, down.gif, etc...

Re: How to get started?

PostPosted: 17 Aug 2009, 22:10
by Chris H.
For those people who may in the future decide that they are interested in learning Java and the Eclipse development system, they should visit the Eclipse web site at: http://www.eclipse.org/

I think that I downloaded the Eclipse IDE for Java Developers some months ago, my version is version 3.4.

There are two long pdf files that will provide you with a basic tutorial:

Workbench User Guide

Java Development User Guide

Additional documentation can be found at: http://www.eclipse.org/documentation/

Re: How to get started?

PostPosted: 18 Aug 2009, 12:22
by Chris H.
You can find some java tutorials on the Sun web site:

The Java Tutorials

There appears to be a printed form which can be purchased from Amazon.com.

There are a number of Online Courses at:

Online Training and Tutorials

And these Online Courses can be downloaded for you to use offline with your web browser:

Sun Download Center

Re: How to get started?

PostPosted: 18 Aug 2009, 12:26
by Chris H.
In Message:

http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=1315#p18348

DennisBergkamp wrote:
Yeah, I can see that I still need to gain a lot of experience with Eclipse. I still have not figured out how to combine all of these multiple java class files into one large jar file. :(
File -> Export -> Java -> Runnable Jar File -> next. Then set your "Launch configuration" to GUI_NewGame and click finish. You do have to empty (copy them somewhere else temporarily) your pics folder and refresh your project, otherwise your JAR will be really big.

Re: How to get started?

PostPosted: 19 Aug 2009, 19:42
by silly freak
in my opinion, the very key features of eclipse are these (they will save you the most time):

  • hovering over an element, such as a class/method etc, shows its javadoc in a popup. however, if there's an error on the hovered piece of code, you get suggestions and automatic fixes for the error.
  • hovering over an element with ctrl pressed allows you to hyperlink-like navigate to the declaration (if the source code is available)
  • pressing ctrl+space displays code completions. you can limit the hits by typing something. also "camel case" is found:
    Arr -> ArrayList
    AL -> ArrayList
    ArLi -> ArrayList
    You can also define your own code templates. for example, sysout is by default defined for "System.out.println();"
  • I make a lot of use of the folding feature. you should make a key binding for the "fold all" action, so you can easily fold all the content in your classes, and show only the methods you're working at.
  • I prefer using the save operations to format my source code. for one, you always have nice code, and the second: you save more often ;)
  • the "toggle comment" action is very useful. just select some lines (you don't have to select the full lines, just a part) to temporarily disable a piece of code
  • last but not least, also make a key binding for the "run java application" action ;)

PS: in the class body, code completion shows options for generating getters/setters, a default constructor, and overriding/implementing methods from the superclass

PPS: if you speak german, you can view http://proggers-diary.blogspot.com. I have posted there some techniques I use in java

Re: How to get started?

PostPosted: 20 Aug 2009, 20:58
by Chris H.
silly freak wrote:[*]hovering over an element, such as a class/method etc, shows its javadoc in a popup.
I spent a little time experimenting with javadoc. It appears that we need to be connected to the internet for javadoc to provide any information. As laptops and netbooks become more popular, the chances that we may not be connected may increase.

I looked for a javadoc download containing all of this info, I had hopped that having this stored locally on our computer would make it easier to access this javadoc info.

I have not had any success finding a javadoc download, does one exist?

Re: How to get started?

PostPosted: 20 Aug 2009, 21:26
by silly freak
of course ;) however, it's easier to use the src.zip contained in the JDK.
in the preferences, go to Java/Installed JREs. Click Edit... for your JRE and go through all the jars: Click Source Attachment... and Externale File... to point it to src.zip
Eclipse should then be able to figure out the javadoc directly from the source. at the same time, you can now also access the source by ctrl+click

so that's enough to have it in eclipse. i know it's crucial to be able to view it in the browser. for this, you won't come around the download from sun. (and I totally agree that the javadocs are hard to find)

Re: How to get started?

PostPosted: 20 Aug 2009, 23:33
by Chris H.
When I downloaded eclipse, I chose to download the smallest of the development packages, the Eclipse IDE for Java Developers version. I can't find a "src.zip" in the eclipse folder.

At the very bottom of the Eclipse Downloads web page there is a
Eclipse Classic 3.5.0 (161 MB) download link.

This link states: The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation.

I am wondering if I should have downloaded this larger version instead?