This page is a wiki. Please login or create an account to begin editing.


18 posts / 0 new
Last post
m68k's picture
Offline
Joined: 2016 Dec 30
How to start a JAR file on 68k MacOS 8?

Hello Folks,

how can I start a simple JAR file (no EAs) on MacOS 8.1 68k?

Comments

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

I don't think it would be an easy thing to do on 68k Mac OS 8.1. The "Apple Java Applet Runner" supplied with RunTime 2.0 doesn't run .jar files, AFAICT.

68k Java Runtime aside, I think the only possible way is to run it via a browser or the Applet Runner, using HTML code to launch the Java files (extracted from the .jar), in a local page you load. And even then it may not work, depending on the Jar file's version of Java it depends on. The final 68k Runtime (v2.0) is based on Apple's implementation of Sun's Java v1.1.3

You might be better off finding a Java emulator and running the jar from that in your Android device.
- I'm assuming that you're wanting to run this Java Jar from within Basilisk II on an Android OS?

m68k's picture
Offline
Joined: 2016 Dec 30

Yup, correct. I'll be starting a new book project and the only good gen progs I can find are in Java.

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

Getting back to this old topic as I found a clipping file in my storagage jar of things that may be useful one-day...

It may be possible to run a jar file on 68k Mac OS. You need to install MRJ SDK 2.0.1 (final MRJ SDK that will run on 68k Mac OS's - and 68040 only, at that) and the Java Runtime v2.0, if you don't have the runtime installed already.

DL #1 on that page has the runtime 2.0 and a preview release of the SDK, so grab both DL's #1 & #2 if necessary and install the runtime from DL 1 and the final SDK from DL #2.

You may have both the runtime and the SDK installed anyway, in which case, skip to the hint I found:

Macintosh and jar files
This page assumes you want to run a .jar file directly, on your Macintosh, without splitting it up in any way.

First you have to have the "MRJ SDK", and the Macintosh Java Runtime. Then you have to find "JBindery".

In the Command Menu, where it says Class, you enter the name of the main program. For example, "jdrill", "CFclient", or some other classname.

Then pull down the 'ClassPath' submenu, click on 'Add .zip file', and select the .jar file you want. Then click "Run".

You can create an application by selecting the 'FILE' menu, then 'Save As...'. Once you've done that, you can double click on the icon to execute the java crossfire client.

If you have any suggestions, comments, or "hey, it works on platform xxx, cool", drop me a line! phil@bolthole.com

The JBindery he mentions, is part of the SDK install which you need to run and then follow the instructions starting below "JBindery", quoted above.

Unfortunately your .jar file will probably need to be compiled pre Sun's Java v2.0 in order to work and the 68k Mac Java runtime is based on Sun's Java v1.1.3, so likely any jar file you have will need to be pretty old. So, YMMV.

adespoton's picture
Offline
Joined: 2015 Feb 15

I used to run Java 2.0 on my 68K Mac, and it wasn't long before jarfiles stopped running, as everyone moved to AWT which it didn't support. By the time SWT was upgraded and people moved back, 2.0 was history, and so it was also incompatible.

So if you've got a non-GUI jarfile that's 2.0 compatible, it should run. Otherwise... you'll have more luck re-compiling it as HTML5 and getting an HTML5-compatible 68k browser.

cbone's picture
Offline
Joined: 2011 Sep 17

Oh yeah!! sign me up for an HTML5-compatible 68k browser! How much does/will it retail for? Wink

adespoton's picture
Offline
Joined: 2015 Feb 15

Before or after inflation? Laughing out loud

cbone's picture
Offline
Joined: 2011 Sep 17

Rolf Facepalm only you, lol Wink

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

I used to run Java 2.0 on my 68K Mac

You mean Mac's Java RunTime and SDK version 2.x there? I'm assuming.

adespoton's picture
Offline
Joined: 2015 Feb 15

Yes, I was shortening, and lost some cromulent data in the process.

m68k's picture
Offline
Joined: 2016 Dec 30

How did you manage to do this? I tried following those instructions above, but no matter what I enter I always get "Class not found" as an error. And I did look up the jar file's content to make I got it right and it was for an old Java 1.x release.

adespoton's picture
Offline
Joined: 2015 Feb 15

My memory's fuzzy, but I seem to recall that main.class wasn't loaded by default on 68k Java; you needed to explicitly declare it in the code and then call it with the runtime.

Are you trying to run a jar file, or a folder of class files?

m68k's picture
Offline
Joined: 2016 Dec 30

Trying to run a Jar file (early FreeMind versiin).

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

The clue is above up in that green highlighted quote

In the Command Menu, where it says Class, you enter the name of the main program. For example, "jdrill", "CFclient", or some other classname.

To find the right classname, I started up a Java jar file in an OS that can actually run it.
In the following example, I'm running the Java version of HJ Split in Mac OS X.

The name of the main Java app is encircled here, in redThe name of the main Java app appears in the menu. Click to zoom in:

So to run this one in the SDK I needed to enter as the Class name: haku.app.hjsplit.HJSplit

Incidentally this Java app, although it failed to run in the classic SDK, it was well written enough to gracefully inform me that the Mac's Java version was too low as it required a minimum (Sun) Java version 2.0 to run, before exiting cleanly.

m68k's picture
Offline
Joined: 2016 Dec 30

Thx man - made a screen shot of your post as a "manual". Btw, is MJK v2.01 identical to Sun's Java 2.0.1?

Jatoba's picture
Offline
Joined: 2018 Apr 16

No, sadly not, and your confusion is very understandable. Here is how it breaks down:

Java's first release was 1.0. Later on, they updated it to 1.1. After this, Sun released Java 1.2, and here's the confusing part: They branded version 1.2 as "Java 2", even though:
- It's the third main version (1.0, 1.1, 1.2);
- It's not version 2.0 (even today, Java's most modern versions for modern systems are still internally 1.x).

Apple's own Java implementation follows a different version number and versioning scheme, so they don't match Sun's Java at all. Sadly, MRJ 2.x doesn't mean neither "Java 2" nor "Java 1.2".

The latest 68040 and PPC implementations correspond to the 1.1.x family (PPC is only slightly more up-to-date). I'm not sure what the latest versions for earlier 68k processors (68030 being of particular interest due to 24-bit ROM compatibility) correspond to, though. (With any luck, also 1.1.x, but it would be sad if not even that.)

Hopefully I could clear up any confusion. Wikipedia also currently illustrates this briefly here.

m68k's picture
Offline
Joined: 2016 Dec 30

Thx for the info but I am not even gonna try to get past the "MRJ 68k = Java 1.1" part. I got headaches enough from last night as it is. Shock

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

Smile
The final classic Mac OS Java releases were:

For 68k = to Sun Java version 1.1.3
For PPC = to Sun Java version 1.1.8