Trouble with Combat Commander for Mac osx

mcbeth wrote:

What did you do to make the ‘-auto’ (and related bits) work? This was
my sticking-point earlier today with trying to build a bundle. (I’m
trying to have a look at your file, but it’s going to be another hour
downloading - are you hosting it on dial-up? grin)

I do still like the app bundle approach, but I do understand it’s a
manual (or needs-scripting) step for Tim M each time the module changes.

Just been playing a bit more with the ‘cc.command’ approach - it’s
possible, by passing ‘-Dapple.laf.useScreenMenuBar=true
-Xdock:name=“CombatCommander”’ to the java invocation to get things bit
more Mac-like, although the ‘About’ box still contains garbage.
Allegedly we could pass an icon file in that way too, just by having one
somewhere in the module zip file, but I haven’t tried that. Also, this
approach leaves a ‘dead’ Terminal window hanging around afterwards,
which isn’t exactly great user experience.

What was the third option? Giving people instructions on running cc.sh
through Terminal?

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Jan 28, 2008, at 11:08 AM, Timothy Mccarron wrote:

No. Just renaming the shell file works fine.

It will then launch the Mac Terminal (Unix window) and run the script.

I think that the most convenient, and most Mac-like solution is to
build (package) a Mac .app file. The shell file is just a quick and
easy work-around that is perhaps a bit too Unix-like for non-
programmers on the Mac.

Build the application and distributing it as a .dmg file would be the
best from the user perspective.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Just wondering where it’s all at?

I’m no techy but I was wondering why the CC mod needs a different approach to get it up & running from all the other mods posted on vassal? Usually u dl and either unstuff or leave stuffed and away ya go! :unamused:

3rd option I was thinking of was the plist.info (or was it pinfo.list?) file version I got - looks a lot different to the dmg version.

I suppose the sh instructions would make a 4th option then

Tim Franklin tim@pelican.org wrote:

Post generated using Mail2Forum (mail2forum.com)

Timothy Mccarron wrote:

Oops, sorry. Is that downloadable somewhere - I’m intrigued to see what
the ‘3rd way’ is?

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Ill zip it up and send to you when I get home here in about an hour

Tim Franklin tim@pelican.org wrote:

Post generated using Mail2Forum (mail2forum.com)

I’ve tried to put together an app bundle from the uckelman-working@2911:

nomic.net/~uckelman/tmp/vass … macosx.zip

I have no clue whether this will work at all. In addition, it might behave
oddly, look strange, violate cultural taboos for Mac users, or eat your
children. I don’t know, because I can’t test it myself. I need your comments.

Also, I built this by hand the first time, because I simply can’t get the
JarBuilder Ant task to work. (That’s ok, since I’m no fan of Ant, and I’ve
already made a target in my Makefile for this.)

Tim Franklin wrote:

Oh, I see - didn’t realise you could put a shell script into a bundle
where it’s expecting an executable. Neat trick :slight_smile:

However:

  • Dock icon is generic Java one, not the application one
  • About dialog is nonsense
  • Menu bar is in window, not Mac menu bar
  • Application menu title is org.vassal.Main, not VASSAL or Combat Commander

The latter two I know we can fix by tweaking the script. I’m not sure
if the first two can be fixed in Info.plist - I’m open to suggestions.
I know they can be fixed that way with a Jar Bundler app that uses
JavaApplicationStub instead of the script, but then I can’t see how to
make ‘-auto’ work…

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Hi Joel,

uckelman wrote:

Info.plist:

Java version needs to be ‘1.5+’, not ‘5+’, or it won’t start at all.

I suspect it’s going to need every JAR in the Resources/Java dir adding
to the Classpath array.

I also suspect the MainClass wants to be VASSAL.launch.Main, not
VASSAL.launch.Launcher (it is for my bundle, but I don’t know what
changed from there (3.0.15 release) to SVN-2911.

However, I can’t check the latter two, as I get this trying to start it,
with or without those changes:

tim@feathers:~/Download/VASSAL-3.1.0-svn2911.app/Contents/MacOS$
./JavaApplicationStub
[LaunchRunner Error] VASSAL.launch.Main.main(String) threw an exception:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at VASSAL.launch.Main.initSystemProperties(Main.java:124)
at VASSAL.launch.Main.(Main.java:54)
at VASSAL.launch.Main.main(Main.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at
apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)

Class versioning errors and actual mechanics of class loading is getting
way beyond my Java skills, so I hope it means something more to you…

Bedtime now, if there’s any more specific things I can try / collect,
let me know.

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Jan 28, 2008, at 1:54 PM, uckelman wrote:

No joy.

It fails to launch with the following message:

================================================================
Could not launch the application because it requires a version of
Java that is not installed.

The application requires Java 5 or later, but only the following
java versions are installed: 1.5.0, 1.4.2, 1.5, 1.4. Updating to a
newer version of Mac OS X may resolve this.

Of course, I’m running the latest version of Mac OS X.

A quick check of the Info.plist file finds JVMVersion set to “5+”. It
should be “1.5+” instead.
(<http://developer.apple.com/documentation/Java/Conceptual/JavaPropVMInfoRef/Articles/JavaDictionaryInfo.plistKeys.html

Changing that to be correct got a bit further, but still ran into an
error with the class file version. Did you perhaps compile this under
Java 1.6? That is not available on the Mac, and Apple hasn’t said
anything at all about plans for Java 6. (Grumble).

[LaunchRunner Error] VASSAL.launch.Launcher.main(String) threw an
exception:
java.lang.UnsupportedClassVersionError: Bad version number in .class
file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at VASSAL.preferences.Prefs.getGlobalPrefs(Prefs.java:185)
at VASSAL.launch.Launcher.main(Launcher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
at apple.launcher.LaunchRunner.run(LaunchRunner.java:115)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at
apple
.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:
52)


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Joel and Tim,

Heres Option 3 - the Info.plist version zipped up that the guy sent me. Ive deleted the actual mod (to upload) but left the folder structure so you would see where the jars go.
Joel, this may? be useful to you for the Vassal version to look at. Seems like you are both working on the same idea as this is based on your alls’ last few posts

Tim

Thus spake Tim Franklin:

Fixed.

Why? VASSAL.launch.Launcher doesn’t need any JARs except Vengine.jar.
Explanation below.

Launcher is a tiny class which reads the user’s preferences to get
the initial and maximum heap sizes for VASSAL and then launches
another JVM to run VASSAL with those settings. The point of this is
to make it possible to adjust the heap sizes from within the prefs
in VASSAL (though changes to these values can’t take effect until
the next time you start VASSAL—that’s unavoidable).

This is a feature which will be new in 3.1.0.

I compiled some classes with the 1.5 compiler earlier today—I might
have ended up with a mix as a result.

Here’s a new bundle:

nomic.net/~uckelman/tmp/vass … macosx.zip


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

Yes, it was compiled with Java 1.6, but with the ‘-source 1.5’ option,
which the man page claims will produce 1.5-compatible class files
when ‘-target’ is left unset. (But there might have been another
probem, see my reply to Tim.)


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Tim Franklin:

Yes, I found a way to produce DMGs if we want them. What purpose do they
serve? Is this the usual way to distribute Mac software?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Jan 28, 2008, at 3:13 PM, Joel Uckelman wrote:

It is a software disk image.

It is normally the way applications are distributed, but it is only
really useful if what you are distributing has multiple files/folders
or runs an installer. If the application itself is all there is, you
could just forgo the step of producing a dmg file and just have the
users
move the application from their download area to the applications folder
or somewhere else.

[Of course, I recall reading about a user study done, IIRC by Apple,
which indicated that the instruction “drag AAA to BBB” was too
complicated for some users to follow, so they needed to have
installers…]

Bottom line: I don’t think it is necessary, but perhaps other
Mac users should chime in. I’m a professional computer scientist,
so my idea of what is easy is not at all representative of normal
people’s. ;)


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Jan 28, 2008, at 2:54 PM, Joel Uckelman wrote:

Still problems.
It crashes on launch with a class version error, but in a slightly
different place now.
(Oddly, my previous crash and Tim Franklin’s were in different places):

[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
Exception
in thread “main”
java.lang.UnsupportedClassVersionError: Bad version number in .class
file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at apple.launcher.LaunchRunner.loadMainMethod(LaunchRunner.java:55)
at apple.launcher.LaunchRunner.run(LaunchRunner.java:111)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at
apple
.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:
52)


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

I don’t see any of our classes in the stack trace. What next?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Mon, January 28, 2008 11:50 pm, Thomas Russ wrote:

Except you can’t do that, because the web / ftp site you’re serving from
won’t know to handle the Foo.app directory tree in the special Mac
‘treat-it-as-a-file’ fashion, and will treat it like any other directory.
So you either have to try and get the user to download a directory
structure (not too bad with a real FTP client, hard with a web browser, as
far I can make out), or you end up needing Foo.app.{zip,tgz} on the
download server.

Zip/tgz is easy to generate by script on non-Mac machines; if Joel’s found
a way to generate DMGs as easily, I’m all for it.

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Mon, January 28, 2008 10:54 pm, Joel Uckelman wrote:

Ah, OK - didn’t realise it was spawning a second JVM.

I’ll try and have a look tonight, ta - sadly no Mac at work :frowning:

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Tim Franklin”:

dd if=/dev/zero of=VASSAL-3.1.0-svn2911.dmg bs=1M count=20
mkfs.hfsplus -v -s ‘VASSAL-3.1.0-svn2911’ VASSAL-3.1.0-svn2911.dmg
mkdir img
mount -t hfsplus -o loop VASSAL-3.1.0-svn2911.dmg img
cp -va VASSAL-3.1.0-svn2911.app img
umount img

That’ll do it. Now what we need is something which works to put in it.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)