Attention: Windows Users using JAVA 7 with MapTool b87

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by aliasmask »

When you click the MapToolLauncher and nothing happens that means that the path to java is incorrect or you have a corrupted version of java or a bad install of MT (can't find jar). I would start by removing all versions of java, then restarting computer. Then follow the directions in the first post.

User avatar
jespley
Cave Troll
Posts: 67
Joined: Thu Oct 26, 2006 9:56 pm
Location: Washington, DC

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by jespley »

Let me be even more clear about one aspect of my recent problems.

Go to quicklaunch page. Right click b84 and save as. Launch maptool from saved shortcut. Place token. Save campaign. Relaunch maptool from shortcut. Reload campaign. Cannot reload because "the campaign cannot be read by this version of maptool."

I will try reinstalling both versions of java and follow directions a beginning of thread.

Thanks for the reply!

EDIT: Ok, I uninstalled java 7 and manually deleted java 6 since there didn't seem to be an uninstall procedure and reinstalled java 6 from the link provided. Then I was able to run the downloaded, unzipped b84 quicklauncher with the .cfg file pointing to the java 6 install. Now, my older campaign files are accessible again. Yay! Still think it would important to update maptool to work with java 7 but I sincerely appreciate the help.
Jared

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by aliasmask »

It's in the works. The new patch does work with java 7, but we're waiting for Az to confirm the latest patches and build the newest version.

User avatar
Farland
Cave Troll
Posts: 80
Joined: Sat Dec 05, 2009 8:02 am

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by Farland »

It would be awesome to finish this soon. We are having no end of trouble with Maptools right now bc of Java.
An epic roleplaying resource:

http://www.farlandworld.com

Twitter: @Farland_World

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by JamzTheMan »

I thought I'd get a jump on things since I'm running my own JAR based on the latest trunk with most of the patches.

Does any know if there is a fix yet for the MapToolLauncher & Java 1.7? I just upgraded to .17 and looks like it still has an issue due to the maptool-*.jar convention.

Will try downgrading to 1.7_09 but curious if there was another fix, given that once b89 does go live this will be a common issue for most.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by jfrazierjr »

JamzTheMan wrote:I thought I'd get a jump on things since I'm running my own JAR based on the latest trunk with most of the patches.

Does any know if there is a fix yet for the MapToolLauncher & Java 1.7? I just upgraded to .17 and looks like it still has an issue due to the maptool-*.jar convention.

Will try downgrading to 1.7_09 but curious if there was another fix, given that once b89 does go live this will be a common issue for most.
Well... for the "core" release, the only fix is the hard code the full jar name into the various "loader" files(batch files, .sh script, Launcher). In essense, that's what's going to happen for the 'final' release anyway since the only reason why there is an asterisk in there was to handle (what at the time was) frequent dev builds so that Trevor did not have to change and check in those various "loader" files with each build.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by JamzTheMan »

What is the "Launcher" coded in? For personal reasons, I'd hate to see it hard coded (although I assume it would be coded into the cfg file at least)

But there shouldn't be a reason why it could just use a normal shell command to get the jar name based on * and then pass that name to the java shell command.

Probably could do this with windows bat files as well, although ironically I'm more familiar with korn shell scripting than windows batch file coding. I can take a look though.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by jfrazierjr »

JamzTheMan wrote:What is the "Launcher" coded in? For personal reasons, I'd hate to see it hard coded (although I assume it would be coded into the cfg file at least)
C++ I believe. Phergus did it. However, I believe the MapTool1.3*.jar is hard coded directly into the compiled exe. This is one of the reasons I don't like launchers like this. Makes it easier in perfect cases, but FAR harder when it does not work right. I THINK Lee is working on a different Launcher made in Java, but I have no idea if it will get included in the next build(which means if not, the exe launcher will still be broken in J7 ever if MapTool itself works perfectly fine in J7...)
JamzTheMan wrote: But there shouldn't be a reason why it could just use a normal shell command to get the jar name based on * and then pass that name to the java shell command.
You could. Go ahead and knock yourself out. Submit the patch to Azhrei. So, I take it you would do something like "dir" into a variable looking for the MapTool1.3b*.jar and then in a for loop grab the first match and set that to a variable. Then verify the variable is not empty and if not call the java process passing the variable in. If it is empty, report some error(perhaps even reporting an error if multiple matches are found so that the end user can rename them so that we will only ever find a single match to make sure they are running the version they expect to run.)

JamzTheMan wrote: Probably could do this with windows bat files as well, although ironically I'm more familiar with korn shell scripting than windows batch file coding. I can take a look though.
See above, thought I guess that was more thinking in dos terms and I guess you were talking in *nix terms but the same approach could apply with tweaks to the "shell" commands utilized per platform type.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by JamzTheMan »

OK, so I whipped up this Windows batch file at work yesterday. It should be a decent replacement for all the current Launch Maptool*.bat files as well as the MapToolLauncher.exe. It's also Java 1.6 and Java 1.7 friendly. It will launch the "latest" JAR file in your directory (based on alphanumeric order).

It will use the values set in win.cfg, otherwise defaulting to set values. You can also either modify this bat file directly or use a custom .cfg file. I tested this on Windows XP and Windows 8. It also launches via "start" so no command prompt window is left open.

Also note, I run my MapTool from a shared UNC path on multiple machines so I coded this to make sure that still worked (hence the mtpath variable usage). If you are a Windows user, please feel free to use and test this batch file and let me know if you run into any issues or have any suggestions.

*Az, feel free to include this in the build if you want.

Code: Select all

@echo off
cls
REM This batch file will find the latest MapTool JAR and launch it using win.cfg values if existing

REM Sets MapTool path to path of this batch file, needed for UNC paths as windows will run batch under C: otherwise
set mtpath=%~dp0
set mtconfig=%mtpath%mt.cfg

PUSHD %mtpath%
echo Launching MapTool from %mtpath%

REM Set Default values, assumes java is in PATH
set MAXMEM=512
set MINMEM=64
set STACKSIZE=2
set JVM=javaw

REM Read values from mt.cfg, setting them as variables (or create custom a file).
for /f "delims=" %%x in (%mtconfig%) do (set "%%x")

REM Set prompt back to default vs prompt=false from win.cfg
prompt

REM Retrieve the last MapTool JAR file sorted alphabetically
for /f "tokens=*" %%F in ('dir /o:-n /b %mtpath%maptool-*.jar') do (
	set "maptool_JAR=%%F"
    goto :done
)

REM Finally, launch MapTool
:done
start "MapTool" "%JVM%" -Xmx%MAXMEM%M -Xms%MINMEM%M -Xss%STACKSIZE%M -jar %mtpath%%maptool_JAR% run
POPD
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Vhex
Giant
Posts: 162
Joined: Fri Sep 09, 2011 4:41 am
Location: Honolulu, HI

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by Vhex »

I had also done a batch file that takes into account Java, which you can find here: http://forums.rptools.net/viewtopic.php ... 7&start=25

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by JamzTheMan »

Well, dang, I should have searched better lol

I may borrow a few things for my script :) Although I probably won't it to auto choose my Java for me, I prefer setting it myself as I have multiple versions installed. Although your script looks like it would be very good for the average user who just wants MT to run.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Vhex
Giant
Posts: 162
Joined: Fri Sep 09, 2011 4:41 am
Location: Honolulu, HI

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by Vhex »

If you set the path in the first part, it will use the path that you pick as long as the java version you want matches (so set path & java version and it'll work the way you describe).

forgottensoul
Kobold
Posts: 17
Joined: Sat Jan 05, 2013 8:33 pm

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by forgottensoul »

Azhrei wrote:
forgottensoul wrote:Is there any chance an updated version will be done by then or does the latest on Sourceforge work with version 7?
Yes, there is a chance. :)

I'm currently merging in the last few patches and many of those are Java 7 compatibility patches. There may be some issues with third-party libraries that we use but the problems that have been reported so far have been with MT code, not libraries, so I'm pretty confident that we'll be okay. I haven't decided whether to update the third-party stuff to the most recent version. On the one hand I'd like to just to stay as current as possible, but on the other hand it could expose bugs at a distant point down the line and then reverting could be difficult. :?
Now that Java 6 is no longer being patched, will there be a release that works with Java 7? I am currently evaluating the latest test release to see if it works well enough for my uses.

Thank you,


User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Attention: Windows Users using JAVA 7 with MapTool

Post by JamzTheMan »

FYI, i ran my game last night using Java 1.7 x64 on windows 8 using the latest code checked in and everything ran perfect :)

In fact, it was one of the smoothest runs in awhile. I think we are close once the decisions are finalized regarding the libraries to use...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Post Reply

Return to “MapTool”