Building from the SVN?

Winterbay

Active member
So, removed that but no change. It still doesn't compile, my other java-program, does still not start and Mafia runs just fine if I download a build.
 

holatuwol

Developer
If you're on Vista or higher, you should be able to type the following into Command Prompt to find out what's getting executed:
Code:
where javac
If you're on XP or lower, you probably want to download the "which" utility port from GNU.
 

Winterbay

Active member
Hmm... "which javac" (I'm on XP) says:
Code:
C:\Program Files\GnuWin32\bin>which javac
which: no javac in (.;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Program Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Pinnacle\SharedFiles\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Subversion\bin;C:\Program Files\Java\jre6\bin;C:\Program Files\WinAnt\bin)

The result was the same when I didn't have the java-path in the PATH-variable. which java and javaw gives both results from \system32\
 

xKiv

Active member
I would try uninstalling the jre completely, then reinstalling the jdk (maybe even newest version possible?).
 

Winterbay

Active member
After my first failure to uninstall and reinstall both the jre and the jdk I've completely removed them (I even removed everything on the computer even remotely related to java that wasn't connected to another program) and reinstalled. Nothing different. The versions I have are 6.24 of both the jre and jdk.
 

Winterbay

Active member
I took a look at the java_home variable again and realised that it said ...23, while the version installed is ...24. So I changed that to 24, rebooted and now it works. Stupid uninstaller/installer that can't take care of its own system variables...
 

xKiv

Active member
You made it work, but still ..

The versions I have are 6.24 of both the jre and jdk.

... this is not OK. You shouldn't have a separate jre if you already have jdk.
The jdk includes jre of its own, having a separate jre install is just running the risk that some program that wants the jre will instead end up using the jdk and fail.
 

Winterbay

Active member
SO, uninstalling the jre is likely a good idea and won't lead to anything stop working? (I think I had the jre and the jdk earlier mainly because I installed the jre first and then the jdk without uninstalling the jre and so I continued to do that...)
 

Paragon

Member
I have the items listed installed and working. I was able to build kolmafia by running ant from the command line in the proper directory and all what have you. But does anyone know how to build and run or debug kolmafia from eclipse. I have the project imported correctly but whenever I attempt to run or debug it eclipse tells me that It can't find a main function. I tried setting the main type to kolmafia, kolmafiacli, and kolmafiagui....
 

xKiv

Active member
I have the items listed installed and working. I was able to build kolmafia by running ant from the command line in the proper directory and all what have you. But does anyone know how to build and run or debug kolmafia from eclipse. I have the project imported correctly but whenever I attempt to run or debug it eclipse tells me that It can't find a main function. I tried setting the main type to kolmafia, kolmafiacli, and kolmafiagui....

In your project preferences, go to Builders, remove all of the default ones and add a New ant builder pointing to build.xml (which already exists).
Then debug the KoLmafia class.
(you *might* have to set up output directory to (project)/build, in Java build path - Source tab)
(also, I have the (project) (default classpath) entry in Classpath tab of the only run/debug configuration configured in Run/Debug settings; under User Entries)
 
Last edited:

fronobulax

Developer
Staff member
Anyone building with NetBeans 7.0? r9689 borked up my (non-standard) build procedures so I am trying to use the build.xml from SourceForge and the lib and src trees. I suspect there are classpath and project settings that I do not have correct. In particular, the IDE does not want to run KoLmafia in the debugger and the IDE editor does not seem to pick up anything in the lib tree so it flags half of src as having compiler errors. My reasons for running NetBeans instead of Eclipse are not as good as they once were so I am willing to switch but figured asking a question was easier. Thanks.
 
Oh dear, fronobulax. Did you try manually adding the required libraries to the project dependency list? It's been a while since I used NetBeans... mostly because I rely on FindBugs and UCDetector Eclipse plugins. :p
 

fronobulax

Developer
Staff member
This is not getting as much of my attention as it needs since I can build without the IDE behaving. AFAIK the build.xml file compiles everything in the subdirectories src and lib and merges the results in the build subdirectory. Everything is there so the "linking" process can easily resolve all references.

When I am using the IDE and viewing source I see one of two problems. Problem one is that a file in the src tree that references something in the lib tree cannot find the corresponding src in order to do all the doc display and code completion types of things. Problem two is that every reference to a class in the src is marked as an error because they are multiple definitions.

The is a setting for a classpath to be used when manipulating source and changing that seems to determine which problem I get although I have not done it in a repeatable way - in other words I have been lazy and not being super careful and taking notes.

I would certainly consider switching to Eclipse but the thing that stopped me was I could not find a SVN plugin. I'm sure it is there but I didn't find it.

I'm sure parts are buried in 117 pages but if someone has instructions for importing KoLmafia into Eclipse and a pointer to the SVN plug in, then I'd rather switch than fight. I have Java SE Development Kit 6 Update 20 (64 bit) and Tortoise SVN 1.6 so I can have Eclipse reference files I have already fetched or i can have it fetch things.

Thanks.
 
Top