måndag 26 augusti 2013

Whose line is it anyway?

Its been a while since an update. I've however not been entirely idle. I've updated to the latest GNU Classpath CVS version, which only added the java.io.Console class. But I found the Console class to be needed by the egit Git Hub client. Sadly, egit also requires some annotation stuff found in the not yet implemented "javalangreflect" library. Its a library with only one method in it, so it shouldn't be a biggie. Its just a matter of, well, doing it.

Commas and colons

Furthermore, I've been looking at running the Eclipse Java Compiler, ECJ. Now, don't get your hopes up on the Eclipse mentioning -- its only the compiler, no GUI stuff. But it can compile new Java source, i.e. generics and stuff, and is not limited to Java 1.4, like the old Jikes. However, with my move to the latest GNU Classpath (and some other organizational changes), ECJ won't compile things correctly.

This either due to something not being correctly configured in the new Classpath, or due to the classpath misbehaving. In order to work, Java needs to know where to find all the Java classes. Usually you can set this using the ENV variable CLASSPATH. In order to set a list of directories to search for classes, you use some sort of delimiter between the directories. In JAmiga this is comma.

CLASSPATH=JAmiga:jvm/classes,Work:classpath,
A classpath with two (actually three) directories to search for classes.

The GNU Classpath and jamvm are (or were), like everything else, mostly Unix/Linux and Windows oriented. They use either colon, or semicolon to separate classpath directories, for Unix/Linux and Windows respectively. Now, Amiga's device separator is colon, so colon can't be used. Semicolon could be used... but the way GNU Classpath and jamvm detects that a system is f.i. Windows, is based on the simple occurrence of a colon, sometimes a backslash, and sometimes the fact that it doesn't seem to be a Unix path at all. So using semicolon would sometimes suggest a Windows system (and, inherently, only allowing device names consisting of one character like in C:). Therefor I thought it better to simply "invent" a new standard, using comma. To make matters worse, sometimes files are referenced using an URI, meaning we have even more colons, like "file:Work:classpath/", or "file://Work:classpath/". More often than seldom, I see lines like "file:JAmiga:jvm/classes/Work:classpath/" being interpreted as one directory. Its a mess, really.

The dotted line

I don't know if the whole classpath-colon-slash-backslash mess, is the real culprit to ECJ not running. There are also known issues with the "dot" device, i.e. the current directory marker. The CLASSPATH ENV variable usually ends with a dot, so that the current directory is included in the search. Using f.i. "JAmiga:classpath,Work:other/classes,." should include three directories in Java's class search. However, in the Amiga world, this doesn't work, since the dot does nothing special in the Amiga OS (its just a non-existing file). A possible workaround for AmigaOS 4 would be "JAmiga:classpath,Work:other/classes,CURRDIR:". However, that will actually search for stuff in "CURRDIR:/", which is nothing else than the parent directory of CURRDIR -- if you know your Amiga DOS, you'll know that the last slash is what Windows and Unix calls "..", i.e. the parent directory. And this last slash is added on a line nestled in various for loops looking for slashes and colons, trying to both determine Windows- or unixness, as well as formatting the path correctly. And after a hard day's work... for loops and slashes really becomes a jungle.

Trying to find whose line it is... usually only makes me waste hours on youtube looking at stuff like this:

Whose line can really consume hours.

torsdag 1 augusti 2013

(J)Ami(ga)Update

I've managed to draw a nice new icon for JAmiga! This is what I've been doing the last few days since my silly release:

Finally, I deliver some quality work. If you'd like to have this really nice eye-candy, just download the latest release.

No, seriously, that icon looks like something my lolcat managed to draw in PPaint trying to pet the Logitech (which is not far from the truth). With the help from Joel Edberg, Thomas Blatt was persuaded to draw me some really nice icons, and JAmiga can now boast with fancy icons. How they look? Well, download the update below to see.

Not only pretty pictures

This release also includes support for AmiUpdate, so you'll get freshly squeezed JAmiga automatically!

Besides AmiUpdate, these are the other changes in this new first real release.

  • New script, JAmiga:JAmiga, which holds the release version. Executing this script will show you the currrent status of your JAmiga installation -- invaluable information for me when looking for errors. Besides the script spitting out various settings and assigns, it'll also try and start a tiny Java application, only to show you that it works (or not).
  • Fixed the "Filer:" assign in jamvm
  • Changed versioning of jamvm. The previous pre-release of jamvm had version 1.5.4, just like jamvm really has. I've now changed this, so the 1.5.4 version is reported in the full version string, and the Amiga jamvm version is reported as 1.1. I hope this doesn't pose problems in future AmiUpdates (since 1.5.4 is higher than 1.1)
  • Removed debugging from javanio.library making it less slow.
  • And, of course, the new shiny icons!

Java application seen working

Now, my ill-fated Twitter client isn't really the killer application we all wanted, I guess. But other stuff has been reported working:

  • The reason for fixing javanio.library, was primalrily that it caused problems running Smushit, as reported by asymetrix over at amigaworld.net. With my tiny fix it now actually works. It turned out that writing the smushed files took too long time, timeing out the Yahoo server.
  • Chris_Y reported that jasypt (some sort of encryption thingie) worked, after giving it some proper command-line love.

It's really nice to see the amigans eagerness in trying out JAmiga. I will myself try a few things I've been looking at running, and hope that you all keep up the good work! I will keep on reporting what has been seens working.

Enough rambling, show me the download!

You can install this 1.1 version over your current installation, or to a clean system.
If you have the 0.1.0 version installed, you can uncheck the GNU Classpath choice -- nothing has changed there.
Follow the link below to download. Unpack the archive with UnArc (lha sometimes misses the the flags for the scripts)

And keep an eye on AmiUpdate!