Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Development and compiling help
#1
Is there any way we could get a quick crash course on how to compile and use MegaMek/Lab/HQ versions downloaded from the SVN repository for those of us not familiar with Java?  If it's too much of a headache I understand completely.
Reply
#2
There are various programs that will download source from SVN and compile it. I would recommend Eclipse as that is what most of the developers use.

Once you download Eclipse, you will need to add the Subclipse plug-in to enable SVN. Go to the SVN view in Eclipse and add a new repository at:

https://megamek.svn.sourceforge.net/svnroot/megamek

Then check out the project at the trunk by right-clicking on the megamek folder in the trunk and selecting "Check-out project." Check it out as a new java project and just follow the basic instructions the set-up wizard gives you. Once the program is checked out, it will have errors. You have to go to into the lib folder and right-click each item in there and say "add to Build Path." You also have to right-click on the l10n directory and set it as a source directory. Once all the errors are gone, then you can build the project. Right-click on packaging.xml and go to Run as > 2 Ant Build.... From there you will get a dialog that gives you lots of options about how you want to package up the program.

Once you have it set up, you can keep it up-to-date with the latest SVN by right-clicking on the project folder and selecting Team > Update.

I am not going to lie to you. Getting that all set up and working is tricky and you will probably hit some stumbling blocks on the way. Feel free to ask more questions.
Reply
#3
Thank you.  I'll give it a go and see how I manage.
Reply
#4
Everything was going smooth until I got around to actually building the project.  I marked all the files in the lib folder into the build path, set the other folder as a source path, right-clicked, 2 Ant Build, left it on the release (default) option and this the error message that popped up:

Code:
Buildfile: C:\Users\Me\Documents\Workspace\MegaMek SVN Build\packaging.xml
svndev-init:
svndev-get:

BUILD FAILED
C:\Users\Me\Documents\Workspace\MegaMek SVN Build\packaging.xml:88: Execute failed: java.io.IOException: Cannot run program "svn": CreateProcess error=2, The system cannot find the file specified

Total time: 5 seconds
Reply
#5
You'll need to install subversion and have the bin folder in your windows path.
You can get that here: http://sourceforge.net/projects/win32svn/
Reply
#6
Thanks fellas, it took some trying, reinstalling my JDK, and making some environment variables, but I finally got it to work and compiled a functioning dev version of MegaMek.  Thanks for taking the time to help me with that.
Reply
#7
Enjoy bug hunting!  The development versions are fun to play around with, especially with new features!
Reply
#8
Hi,

I thought I would give this a try and everything works well until the very end (I think).  When I try and run the complied program I get the error

"Unable to access Jarfile MegaMek.jar"

I've attached a log file from the Eclipse console.

Thanks in advance for any help.





Attached Files
.txt   log.txt (Size: 97.28 KB / Downloads: 5)
Reply
#9
From your log file, it appears that the program is actually breaking at the compile stage:

Code:
svndev-build:
    [mkdir] Created dir: D:\Megamek Local\megamek\svndev\classes
     [echo] building MegaMek from svn sources
    [javac] Compiling 1672 source files to D:\Megamek Local\megamek\svndev\classes

BUILD FAILED
D:\Megamek Local\megamek\packaging.xml:98: Error running javac.exe compiler

That means no jar file is being created.

If I had to guess I would say that you have the JRE installed instead of the JDK.  It could also be a problem with paths so eclipse doesn't no where to find what it is looking for. Try googling "Error running javac.exe compiler"
Reply
#10
Thanks for the help.  The problem was right in front of me!  I was able to do a build and start playing.

Keep up the great work with this program it has me and my friends hours of enjoyment. 

Cheers  Smile
Reply
#11
I've been having fun with Dev versions of MegaMek.  But if I may ask what would the steps up for MegaMekLab and MekHQ?

Thanks in advance for any help.
Reply
#12
Its the same basic process for both of those. Check out the svn project and add all the libraries to your build path..
Reply
#13
I believe he means what is the address for the repository. You can look it up on sourceforge pretty easy.    *dramatic pause*    So I did. Wink And here it is.

MegaMekLab
https://megameklab.svn.sourceforge.net/s...megameklab

MekHQ
https://mekhq.svn.sourceforge.net/svnroot/mekhq

Just copy and paste the links. Also make sure you check out the trunk one, unless you know what you are doing and have a good reason to not.  Another thought/idea is would this topic be best as a thread or in a different category other than "General Discussion"?
Anyway have fun with the bleeding edge changes!
Reply
#14
(02-20-2011, 03:10 PM)Taharqa link Wrote: Then check out the project at the trunk by right-clicking on the megamek folder in the trunk and selecting "Check-out project." Check it out as a new java project and just follow the basic instructions the set-up wizard gives you. Once the program is checked out, it will have errors. You have to go to into the lib folder and right-click each item in there and say "add to Build Path." You also have to right-click on the l10n directory and set it as a source directory. Once all the errors are gone, then you can build the project. Right-click on packaging.xml and go to Run as > 2 Ant Build.... From there you will get a dialog that gives you lots of options about how you want to package up the program.

I'm back again with more questions.  When I try to use the above directions on either MekHQ or MegaMegLab but I can't seem to figure out what directories to add to the build path.  If its not to much too ask could I ask for directions like the ones I quoted for each program.

Thanks in advance for any help.
Dave
Reply
#15
For MM, add the l10n folder to the build path, and all .jar files in the lib folder.
For MML, add MegaMek.jar from the root path to the build path, and all the .jar files from the .lib folder.
Reply
#16
Are there any instructions about how to go about building MegaMek on the Mac?  I see the download, but I want to develop for it and I'm not sure if you're using Xcode, or Eclipse to create app file?
Reply
#17
Most of the developers use Eclipse. The packaging.xml file included with the source code uses [url=http://"http://www.informagen.com/JarBundler/"]jarbundler[/url] to create the MegaMek.app. But you don't need to package it to run it in Eclipse. Packaging is only for releases.
Reply
#18
I've installed Eclipse and subclipse and checked outed the current copy of the source. After I added all the items in the lib folder to the build path, and set l10n as a source directory I get an error that says

Archive for required library: 'lib/manfest.txt' in project 'megamek' cannot be read or is not a valid ZIP file

I don't understand this error because I can open the manifest file within eclipse with no problem

Any ideas on what settings I need change, or what else I could do?

thanks

Cory
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  When good compiling goes wrong pheonixstorm 0 502 11-06-2014, 11:34 PM
Last Post: pheonixstorm
  Compiling MegaMek, whats the difference between... pheonixstorm 3 886 05-13-2014, 10:54 PM
Last Post: Xenon54z

Forum Jump:


Users browsing this thread: 1 Guest(s)