Can't get anything to work on a mac

None of the applets on the 4k website work on my OS X 10.5 Intel MacBook, and the only minification I can get to work is ProGuard - no Pack200 or anything thelike. :frowning:

Any tips from fellow mac developers?

What version of Java is it running?

Cas :slight_smile:

1.5.0_26 from Apple Inc.

I consistently get the following error on Firefox 3.6.12 as well as Chrome and Safari:
General exception:
java.lang.ClassNotFoundException: V.class
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:145)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:667)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:786)
at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1873)
at jep.AppletFramePanel.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:715)
at sun.applet.AppletPanel.run(AppletPanel.java:369)
at jep.AppletFramePanel.run(Unknown Source)
at java.lang.Thread.run(Thread.java:655)

I have also had no luck getting a homemade pack200’ed applet to load.

Minimum requirements for this years contest are Java 1.6/6.0, so its likely many will compile for that version.

If your on OS X 10.5 64bit Apple provide a Java 1.6 build which you should install.

Ah, but none of the applets on the 4k page work, even the 1.5 ones like VVVV. I have the 1.6 Java, but it seems to be very difficult to convince any browser to use it.

I know Java 1.5 on the Mac doesn’t support plugin2 and hence doesn’t read the html parameter telling java to get the pack200 version. I’m not certain that Java 1.6 on the Mac supports the parameter either. Ideally Java4k.com should support the pack200 protocol introduced with 1.5 as that does work on the Mac - I’m doing exactly that for testing my 4k entry for this year so it definitely can be made to work. I host the applet on my PC running Tomcat server and my Mac fetches Java 1.5 applets just fine.

It is beyond my comprehension why you would need a special addon in the web server in order to serve STATIC content! Only Sun could have created such nonsense, a nightmarish scenario of incompatibility and non-supported features, bound to invoke terror in the minds of sys admins.

I’ve googled these keywords, “pack200 apache”, and I haven’t found anything that hints what I need to do in my apache beyond what is already done, adding the correct http headers.

And the problem goes on unsolved… :-\

Just write a PHP script that does something like this :persecutioncomplex:


         $resourceBase = '/absolute/path/to/files/';
         $path = $_GET['path'];
         if(strpos($path, "..") !== FALSE) die('boo');
         if(strpos($path, "/") !== FALSE) die('boo');
         if(strpos($path, "\\") !== FALSE) die('boo');

         $ae = $_SERVER['HTTP_ACCEPT_ENCODING'];

         if ($ae != null && strpos($ae, "pack200-gzip") !== FALSE)
         {
            $file = $resourceBase . $path . ".pack.gz";
            header("Content-Encoding: pack200-gzip");
         }
         else
         {
            $file = $resourceBase . $path . ".jar";
         }
         // stream contents of $file to browser

What’s already been done? It’s definitely not to spec, because it sends me a pack200-gzip even if I don’t send an Accept-Encoding header (or if I send Accept-Encoding: none).

http://www.thrysoee.dk/pack200/ seems fairly straightforward, although I admit that I haven’t tested it.

My first post here (just registered to follow the discussions about java4k 2011).

I have Snow Leopard and it came with Java 1.6 (don’t ask me too many technical details though since I have been a Mac owner for about 48 hours and have never used OS X before).

Tried the two games (Before Z and Shrincube) in Safari and neither started. However in Opera both started (although both ran terribly throw; that might be because this computer is busy doing some updates).

I just switched these over from using “X.class” to just “X”, based on comments from other threads. Can you test to see if this works on Safari?

Both games work fine for me now.

They still don’t work for me, unfortunately. I wonder if Java version 1.6 has issues?

On second thoughts that’s probably because the .jar doesn’t exist. If the server is going to do things properly then I think you need either the upload page or a cron job to take uploaded .pack.gzs and convert them back into normal jars. Sigh. It’s never simple, is it?

same problem here, almost all games dont work on my mac…

core2duo
3gb ram
snow leopard
java 1.6
firefox and safari

you could try enabling/disabling out of process applets to see if it helps.

Do this by clicking Applications -> Utilities -> Java Preference -> select Out of Process or Within Browser Process, settings to see if it helps.

Once again Java compatibility seems to moving forward…

:-\

does not help…

there are working applets, maybe the coders of these applets could tell about how they make their apps mac-compatible!!?

working on my mac
4Kanabalt (what went wrong in firefox?)
CraftCraft
Mage Wars
Oh My Glob!
Before Z
ShrinCube
Graveyard 4k

error
Shift4k
Castlevania 4K
Super Mario Land 4K
Demon Attack 4K
Keystone Kapers 4K
Gradius 4K
Out Run 4K (please make it work on mac!!!)
Wolfenstein 4K
Jackal 4K

kevglass et al, can you enlighten us as to what you did differently than what’s in the Applet Template post?

I think maybe they just draw directly to the graphics context instead of swapping from another context?