Launching on OSX thread

Get general Towns support here

Launching on OSX thread

Postby edbrannin » Sat Oct 29, 2011 6:52 pm

This is a continuation of the old Running on OS X thread.

The towns*.command files still unzip without executable permissions on OS X. I had to chmod +x them before it would work.

Even then, double-clicking in the Finder resulted in an error because its working directory was $HOME, rather than the location of the jar:

Code: Select all
Ed-Brannins-MacBook-Pro:~ ed$ /Users/ed/Downloads/Towns/towns.command ; exit;
Exception in thread "main" java.lang.NoClassDefFoundError: xaos/Towns
Caused by: java.lang.ClassNotFoundException: xaos.Towns
   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
logout


I think your best bet for OS X is to package a native App Bundle with one of these tools:


There also seem to be some App packaging methods that take place within OS X, but I'm not listing them because you don't seem to have access to a mac.
edbrannin
 
Posts: 4
Joined: Sat Oct 29, 2011 6:37 pm

Re: Launching on OSX

Postby alexpoysky » Sat Oct 29, 2011 10:37 pm

We will definitely keep that in mind! We haven't made enough to buy a mac in order to run our testing, but rest assured that once we do, we will be preparing it with proper support!

-Alexander Poysky

Towns team.
alexpoysky
 

Re: Launching on OSX

Postby Vibe » Mon Oct 31, 2011 1:16 am

Hello, (i'm french)
For the moment it does not work for me too:
Code: Select all
Exception in thread "main" java.lang.NoClassDefFoundError: xaos/Towns
Caused by: java.lang.ClassNotFoundException: xaos.Towns
   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


I hope to really test your game, the video makes me want to play ;)
My website JeuxVidéoMac.fr
Vibe
 
Posts: 3
Joined: Mon Oct 31, 2011 12:54 am
Location: France

Re: Launching on OSX

Postby edbrannin » Mon Oct 31, 2011 2:12 am

Vibe wrote:Hello, (i'm french)
For the moment it does not work for me too:
Code: Select all
Exception in thread "main" java.lang.NoClassDefFoundError: xaos/Towns
Caused by: java.lang.ClassNotFoundException: xaos.Towns
...


I've found a tweak that lets towns.command run from the Finder:

Edit towns.command (with TextEdit) and add this line before the line that starts with "java":
Code: Select all
cd $(dirname $0) &&


It should look like this:
Code: Select all
#!/bin/sh
cd $(dirname $0) &&
java -cp .:./lib/lwjgl.jar:./lib/lwjgl_util.jar:./lib/slick-util.jar:./xaos.jar -Djava.library.path=./lib/native/ -Dsun.java2d.opengl=false xaos.Towns


Notes:
(That's the number 0 after "dirname", not the letter "O".)
Do the above for Towns{EN,ES}.command if you want to force English or Spanish.
edbrannin
 
Posts: 4
Joined: Sat Oct 29, 2011 6:37 pm

Re: Launching on OSX

Postby Vibe » Mon Oct 31, 2011 2:41 am

Thank you :P
it works, I look and I'll translate into French the file:
messages_es_ES.properties
messages_fr_FR.properties
Vibe
 
Posts: 3
Joined: Mon Oct 31, 2011 12:54 am
Location: France

Re: Launching on OSX

Postby supermalparit » Mon Oct 31, 2011 7:13 am

Thanks again edbrannin.

You are helping us a lot!

Xavi Canal
Xavi Canal
Image
User avatar
supermalparit
Towns team
 
Posts: 2444
Joined: Thu Oct 27, 2011 11:57 pm

Re: Launching on OSX

Postby Smashbox » Wed Nov 02, 2011 8:46 pm

Hey gang - I'm having a slightly different problem getting it to launch on OS 10.5.8. Here's the Terminal error:

Code: Select all
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:676)
   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:317)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
logout


Seems like it's a Java version issue. Anyone have any insight?
Smashbox
 
Posts: 5
Joined: Wed Nov 02, 2011 8:44 pm

Re: Launching on OSX

Postby supermalparit » Wed Nov 02, 2011 9:39 pm

Hi.

Yes, it seems a Java version outdated (prior to 1.5).

Please, download the lastest one (from or download section) and try it again.

Regards
Xavi Canal
Image
User avatar
supermalparit
Towns team
 
Posts: 2444
Joined: Thu Oct 27, 2011 11:57 pm

Re: Launching on OSX

Postby Smashbox » Wed Nov 02, 2011 9:51 pm

Unfortunately Apple handles Java updates thru Software Update, so I can't install specific packages. I am running a version of 1.5, however:

Code: Select all
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03-333-9M3125)
Java HotSpot(TM) Client VM (build 1.5.0_22-147, mixed mode, sharing)
Smashbox
 
Posts: 5
Joined: Wed Nov 02, 2011 8:44 pm

Re: Launching on OSX

Postby Smashbox » Wed Nov 02, 2011 9:58 pm

OK found a solution in case any Mac users have this same problem:

In "Java Preferences I shifted the preferred order of Java versions thusly:

Image
Smashbox
 
Posts: 5
Joined: Wed Nov 02, 2011 8:44 pm

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 5 guests