Trouble with Combat Commander for Mac osx

Thus spake “Tim Franklin”:

This isn’t a solution I like, BTW. The reason for doing it this way
is the usual culprit, Windows, because I haven’t found a better way
there yet. I’m still thinking about it, though, so this might change
soon.


J.


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

Post generated using Mail2Forum (mail2forum.com)

Thomas & Tim, when you try the bundle, could you also try running what’s
in the bundle from this shell script?

nomic.net/~uckelman/tmp/vassal/VASSAL.sh

If this works, then we’ll know that the problem is the bundle; if not,
then we’ll know that the problem is with the classes.

Hi Joel,

uckelman wrote:

I think we’ve cracked it.

Both your script and VASSAL.launch.Launcher are using a classpath of
lib/Vengine.jar. Inside the app bundle, there is no lib directory
anywhere - all the JARs are just in Contents/Resources/Java. I made
Contents/Resources/Java/lib a symlink to Contents/Resources/Java, and
the application now starts fine from a double-click. I can successfully
load a module and a saved game.

Hope that helps,
Tim.


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 29, 2008, at 2:06 AM, uckelman wrote:

Here’s what I get:

./VASSAL.sh
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)

Although you note that there isn’t any mention of Vassal classes in
the backtrace, there is some loading of classes, so it would appear
that the class that is being loaded is the one that has a bad version
number.

Let me try a tool to investigate this. I used the byte-code version
file from <http://alumnus.caltech.edu/~leif/opensource/bcver/
index.html> to look at the jar files in the archive.

The results are the following. The number in […] is the range of
bytecode versions found in each archive. The association between
bytecode version and JVM version is show in the next table. Note in
particular that the Vengine.jar file uses bytecode from Java 1.6.
Maybe the compiler isn’t really following the manual specification.
It might be safer to specify “-target 1.5” as well as “-source 1.5” in
the compilation.

Bytecode Version JVM Version
45.0 - 45.3 1.0.2
45.0 - 45.65535 1.1.*
45.0 - 46.0 1.2
45.0 - 47.0 1.3
45.0 - 48.0 1.4
45.0 - 49.0 5 (1.5)
45.0 - 50.0 6 (1.6)

[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-anim.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-awt-util.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-bridge.jar
[45.3 – 46.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-codec.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-css.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-dom.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-ext.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-extension.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-gui-util.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-gvt.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-parser.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-script.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-svg-dom.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-svggen.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-swing.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-transcoder.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-util.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/batik-xml.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/BrowserLauncher2-10.jar
No class files./Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/docs.jar
[47.0 – 47.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/js.jar
[45.3 – 47.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/pdf-transcoder.jar
[45.3 – 49.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/smack.jar
[49.0 – 49.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/smackx-debug.jar
[48.0 – 49.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/smackx.jar
[49.0 – 49.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/swing-worker-1.1.jar
[50.0 – 50.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/Vengine.jar
[48.0 – 48.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/wizard.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/xalan-2.6.0.jar
[46.0 – 46.0] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/xerces_2_5_0.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/xml-apis-ext.jar
[45.3 – 45.3] /Users/tar/Downloads/VASSAL-3.1.0-svn2914.app/
Contents/Resources/Java/xml-apis.jar


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 29, 2008, at 12:18 PM, Tim Franklin wrote:

Are you by chance running Java 1.6 under Tiger?

I can’t get it to work using Java 1.5 and Leopard.


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

Post generated using Mail2Forum (mail2forum.com)

Thomas Russ wrote:

No, 1.5 on Tiger.

tim@feathers:~/Download$ java -version
java version “1.5.0_13”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
Java HotSpot™ Client VM (build 1.5.0_13-121, mixed mode, sharing)

Did you make the symlink inside the bundle?

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:

VASSAL.launch.Launcher is no more—I’ve replaced it with a method which
doesn’t require starting an additional JVM. This should at the same time
clear up the path issue you found.

Here’s another:

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

Questions:

  1. Does this work without modification now?

  2. Where should the ext and plugins directories go in the bundle? In
    non-Mac installs they would be siblings of lib.

  3. When you modify your heap sizes in the preferences, do you see those
    changes show up in the Info.plist? (Or are you getting a stack trace
    in the errorLog?)

  4. Is there anything else which looks stupid that should be fixed?


J.


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

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

I was not aware of that. Thanks!

I’ll check on that.

After building 2916, I checked Vengine.jar and the range was [49.0–49.0],
so the current build should not have this problem.

(BTW, I see that you do AI research. Do you ever go to AAAI?)


J.


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 29, 2008, at 12:43 PM, Tim Franklin wrote:

Yes. I set up the symlink.

My compiler produces bytecode version 49.0 code, and the Vengine.jar
file
contains bytecode version 50.0, which causes my installation to fail.

My Java is supposedly (according to Software Update) up-to-date,
although
it seems to be ever so slightly behind the version you have:

java -version
java version “1.5.0_13”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_13-
b05-237)
Java HotSpot™ Client VM (build 1.5.0_13-119, mixed mode, sharing)

Anyway, the latest 2916 build has everything at 49.0 or below, so
here’s hoping.


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 29, 2008, at 2:36 PM, Joel Uckelman wrote:

OK. But the bundle below still lists VASSAL.launch.Launcher as the
Main class
in the Info.plist file

Not for me.
A little more machine background.
This is an Intel Core-2 duo processor, Mac OS X 10.5.1 (Leopard)

java -version
java version “1.5.0_13”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_13-
b05-237)
Java HotSpot™ Client VM (build 1.5.0_13-119, mixed mode, sharing)

The error I get now is a NumberFormatException trying to parse integers:

1/29/08 2:57:36 PM [0x0-0x416416].VASSAL.launch.Launcher[24769]
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:415)
at java.lang.Integer.parseInt(Integer.java:497)
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)
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:415)
at java.lang.Integer.parseInt(Integer.java:497)
at VASSAL.launch.Launcher.main(Launcher.java:56)
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)

It may be that my initial setup is missing something that is expected.
However, since this occurs in the Launcher main method, it should be
fairly easy to detect the null case and use some appropriate default.


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 29, 2008, at 2:44 PM, Joel Uckelman wrote:

I wasn’t either before today. Amazing what a little luck on Google
will turn up.

Yep, that problem went away.

OT:

I do AI research. I haven’t been to AAAI in a while, though. And
our current research results were not quite ready for a paper this
year, so I likely won’t be at this summer’s either.

Actually, for some fun gaming-related stuff, you might want to look
at another research group that I’m doing some work with (Hmmm, I really
need to update my web page…) over at the Institute for Creative
Technologies – great name, what? – on virtual humans
http://ict.usc.edu/projects/virtual_humans and simulation
agents in general http://ict.usc.edu/


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

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

DING DING DING, we have a winnner!

According to the man page for javac:

"The default for -target depends on the value of -source:

o If -source is not specified, the value of -target is 1.6

o If -source is 1.3, the value of -target is 1.1

o For all other values of -source, the value of -target is the
value of -source."

Thus, if Sun’s 1.6 compiler does what the docs say it does, ‘-source 5’
and ‘-source 5 -target 5’ should produce equivalent output. But they
don’t—I get class files with bytecode version 50.0 with the former,
but 49.0 with the latter.


J.


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

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

Fixed.

[snip]

This code shouldn’t still be there. I thought I had removed that class.

Once more:

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)

On Jan 29, 2008, at 3:19 PM, Joel Uckelman wrote:

Well, 4th time’s the charm. I guess three doesn’t work because these
are binary computers and the needed something divisible by 2.

Oh, there was one minor glitch which I had to fix, which is that the
startup class was not set properly in the Info.plist. The one that
was edited was the bundle name and not the JVM parameter.

The key that needs changing is
Root>Java>MainClass

When I set that to VASSAL.launch.Main things launched fine.

The other thing is that the preference for max memory size doesn’t (yet)
update the Info.plist file. The preference stays saved in the
preferences
file, but it didn’t have any effect on the launch parameters in the
application.
(I’m guessing you haven’t gotten to that yet, since getting this working
was more pressing.)

Anyway, I’m glad to see that a native Mac App is being produced. This
will be great!

-Tom.


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

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

Thanks. Fixed now.

If it didn’t change the real Info.plist file, then you should have a
stack trace in your errorLog saying where it looked for the file. It
would help me to know where it looked relative to where the Info.plist
actually is.


J.


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

Post generated using Mail2Forum (mail2forum.com)

Hi Joel,

On Tue, January 29, 2008 10:36 pm, Joel Uckelman wrote:

Will have a look at this and the 2917 build tonight - I guess they should
be good, as the latter works for Thomas, but given that there seem to be
some slight differences between the Intel and PPC JVMs, it’s worth
checking.

By Mac standards, they ought to go in ~/Library/Application
Support/org.vassal.VASSAL/, but I appreciate that’s more platform-specific
code :frowning:

The big question here is how are these items to be installed? Any kind of
graphical file-selector won’t let you navigate to inside the app bundle,
so anything that asks the users where to install the plugin or extension
won’t be able to put it inside the bundle. Even ‘download and unzip to
inside the bundle’ is going to be beyond a lot of people who aren’t
shell-savvy.

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”:

Try the image instead:

nomic.net/~uckelman/tmp/vass … vn2918.dmg

There’s not much platform-specific code in VASSAL right now—all I know
of is what I’ve put in GlobalPreferences for writing heap size information
and what’s in TemporaryFileManager.

There are a bunch of other platform-specific things we need to do to make
the app look right on a Mac, so I’m thinking of creating a class which
holds platform-specific settings like directories, UI stuff, etc.

I don’t know. You’d have to ask Brent about that.


J.


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 30, 2008, at 1:28 AM, Joel Uckelman wrote:

I can’t find any error trace in the console log. All I get is a large
number of
thread queue:
messages. No errors, and no updated Info.plist. Sorry.


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 30, 2008, at 5:32 AM, Joel Uckelman wrote:

Interestingly enough, this one doesn’t run on an Intel-based Mac.

Even weirder, when I tried to mount the disk image again, I got a
message that the disk image was damaged and contained no mountable
file system. When it was directly downloaded, it automounted (with
some console error messages) but with an application bundle that
wouldn’t launch.


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

Post generated using Mail2Forum (mail2forum.com)

On Jan 30, 2008, at 5:32 AM, Joel Uckelman wrote:

OK. There are also some really easy things.

Putting the menu bar at the window top is done by just setting a up
certain Property values in the existing Info.plist file:

Under the Root>Java key add:

Properties

apple.laf.useScreenMenuBar
true
apple.awt.showGrowBox
true

There’s Apple’s guide:
http://tinyurl.com/dzak4

And there’s some nice hints for both Mac and Windows in
http://today.java.net/pub/a/today/2003/12/08/swing.html
http://today.java.net/pub/a/today/2004/01/05/swing.html
These are from 2003 and 2004, but the basic items should still hold,
with the possible exception of some of the packaging advice.


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

Post generated using Mail2Forum (mail2forum.com)