söndag 29 december 2013

Java Developer's Kit

Tiny update for Java developer's

On the JAmiga support forum on amigans.net I've added a little note on a developer's package available on AmiUpdate:

On AmiUpdate you can find an update consisting of a few developer's files. There's a new Java compiler, a simple example, as well as documentation.

Just update your system, go to JAmiga:Documents/Developer.guide, and you're just minutes away from compiling your own applications.

I'll try to add more info on how you can use it with various third-party jar files.

New year's resolution?

I managed to get this tiny update out before the year has ended. Next year, I'll try to be better in getting stuff out there. Even it's only small things. I've been a bit too silent the last two months, but other things in life has taken up my time.

Over and out. And a happy new year!

måndag 4 november 2013

JAmiga 1.2

JAmiga 1.2 is currently in os4depot's upload queue. After its been approved and uploaded, I will add the update to AmiUpdate -- so you who already have v 1.1 installed can wait for the AmiUpdate update.

This is a full release: all required components are in the archive. Future updates of the individual components will be available with AmiUpdate as usual.

Change log

  • Added support for java.io.Console in javanio.library
  • Changed drawer hierarchy of JAmiga files in order to ease update and maintainability
  • Minor fixes in jamvm
  • New default and regular icons from Mason
  • The environmental variables (BOOTCLASSPATH and LD_LIBRARY_PATH) are no longer needed

Thanks to all of you

I'd like to, in no particular order, thank you all who have contributed in any way to JAmiga. To mention a few:

  • Joel Edberg for testing (and constant nagging me for updates)
  • Thomas Blatt for the first set of icons
  • Martin Mason Merz for the 2nd set of icons, including DefIcons
  • All you kind lovely amigans for support, cheering and donations! Without you, my work would be profoundly pointless!

And, of course, credit where credit is due. This is a continuation of the original JAmiga effort, by Peter Werno and André Dörffler. Even though there has been lots of changes, and it now also sports the JamVm JVM by Robert Lougher.

Nope, now I have to press "Publish" -- the os4depot upload has been approved!

torsdag 17 oktober 2013

Continuing mauve testing

Slowly but surely I'm working through the mauve suite. Currently, focus is on java.io.
Yesterday I got these fails:
FAIL: java.io.File.ReadMethods
FAIL: java.io.File.ExecuteMethods
FAIL: java.io.File.newFileURI
FAIL: java.io.File.WriteMethods
FAIL: java.io.File.URI
FAIL: java.io.File.security
FAIL: java.io.File.UnicodeURI
FAIL: java.io.File.createFile
FAIL: java.io.File.newFile
FAIL: java.io.File.emptyFile
FAIL: java.io.RandomAccessFile.security
After running these tests:
gnu.testlet.java.io.File.canWrite
gnu.testlet.java.io.File.ReadMethods
gnu.testlet.java.io.File.ExecuteMethods
gnu.testlet.java.io.File.newFileURI
gnu.testlet.java.io.File.WriteMethods
gnu.testlet.java.io.File.URI
gnu.testlet.java.io.File.security
gnu.testlet.java.io.File.list
gnu.testlet.java.io.File.listFiles
gnu.testlet.java.io.File.UnicodeURI
gnu.testlet.java.io.File.createFile
gnu.testlet.java.io.File.newFile
gnu.testlet.java.io.File.jdk11
gnu.testlet.java.io.File.emptyFile
gnu.testlet.java.io.CharArrayReader.OutOfBounds
gnu.testlet.java.io.CharArrayReader.MarkReset
gnu.testlet.java.io.CharArrayReader.ProtectedVars
gnu.testlet.java.io.CharArrayReader.SimpleRead
gnu.testlet.java.io.StringReader.Test
gnu.testlet.java.io.FilterInputStream.MarkReset
gnu.testlet.java.io.FilterInputStream.SimpleRead
gnu.testlet.java.io.RandomAccessFile.security
gnu.testlet.java.io.RandomAccessFile.randomaccessfile
gnu.testlet.java.io.RandomAccessFile.jdk11
gnu.testlet.java.io.RandomAccessFile.setLength
gnu.testlet.java.io.PushbackInputStream.Unread
gnu.testlet.java.io.PushbackInputStream.ProtectedVars
gnu.testlet.java.io.PushbackInputStream.BufferOverflow
gnu.testlet.java.io.FileDescriptor.jdk11
gnu.testlet.java.io.Serializable.ParentReadResolve
gnu.testlet.java.io.Serializable.readResolve
gnu.testlet.java.io.Serializable.ParentWriteReplace
gnu.testlet.java.io.Serializable.MySerializable
gnu.testlet.java.io.Serializable.BreakMe
gnu.testlet.java.io.Serializable.MyBreakMe
gnu.testlet.java.io.Serializable.BreakMeTestSer
gnu.testlet.java.io.FileWriter.jdk11
gnu.testlet.java.io.Writer.Test
gnu.testlet.java.io.ObjectStreamClass.DefinedNotStatic
gnu.testlet.java.io.ObjectStreamClass.DefinedNotFinal
gnu.testlet.java.io.ObjectStreamClass.Test
gnu.testlet.java.io.ObjectStreamClass.NotSerial
gnu.testlet.java.io.ObjectStreamClass.Serial
gnu.testlet.java.io.ObjectStreamClass.C
gnu.testlet.java.io.ObjectStreamClass.A
gnu.testlet.java.io.ObjectStreamClass.B
gnu.testlet.java.io.ObjectStreamClass.ProxyTest
gnu.testlet.java.io.ObjectStreamClass.Defined
gnu.testlet.java.io.SequenceInputStream.Test
gnu.testlet.java.io.FileInputStream.security
gnu.testlet.java.io.FileInputStream.fileinputstream
gnu.testlet.java.io.FileInputStream.read
gnu.testlet.java.io.BufferedInputStream.ZeroRead
gnu.testlet.java.io.BufferedInputStream.MarkReset
gnu.testlet.java.io.BufferedInputStream.Skip
gnu.testlet.java.io.BufferedInputStream.BigMark
gnu.testlet.java.io.BufferedInputStream.ProtectedVars
gnu.testlet.java.io.BufferedInputStream.SimpleRead
gnu.testlet.java.io.OutputStreamWriter.jdk11
gnu.testlet.java.io.LineNumberInputStream.Test
gnu.testlet.java.io.FilterReader.MarkReset
gnu.testlet.java.io.FilterReader.SimpleRead
gnu.testlet.java.io.Reader.Test
gnu.testlet.java.io.ObjectInputStream.registerValidation
gnu.testlet.java.io.ObjectInputStream.readResolve
gnu.testlet.java.io.ObjectInputStream.ReadResolveHelper
gnu.testlet.java.io.ObjectInputStream.security
gnu.testlet.java.io.ObjectInputStream.TestObjectInputValidation
gnu.testlet.java.io.ObjectInputStream.ClassLoaderTest
gnu.testlet.java.io.LineNumberReader.Test
gnu.testlet.java.io.LineNumberReader.mark
gnu.testlet.java.io.LineNumberReader.Test2
gnu.testlet.java.io.ByteArrayInputStream.MarkReset
gnu.testlet.java.io.ByteArrayInputStream.ProtectedVars
gnu.testlet.java.io.ByteArrayInputStream.SimpleRead
gnu.testlet.java.io.ObjectOutputStream.StreamDataTest
gnu.testlet.java.io.ObjectOutputStream.useProtocolVersion
gnu.testlet.java.io.ObjectOutputStream.security
gnu.testlet.java.io.BufferedReader.boundary
gnu.testlet.java.io.BufferedReader.MarkReset
gnu.testlet.java.io.BufferedReader.mark
gnu.testlet.java.io.BufferedReader.SimpleRead
gnu.testlet.java.io.StreamTokenizer.commentchar
gnu.testlet.java.io.StreamTokenizer.misc
gnu.testlet.java.io.StreamTokenizer.newline
gnu.testlet.java.io.StreamTokenizer.WordWhiteChars
gnu.testlet.java.io.StreamTokenizer.Test
gnu.testlet.java.io.StreamTokenizer.slashslash
gnu.testlet.java.io.StreamTokenizer.slashstar
gnu.testlet.java.io.InputStreamReader.hang
gnu.testlet.java.io.InputStreamReader.utf8
gnu.testlet.java.io.InputStreamReader.getEncoding
gnu.testlet.java.io.InputStreamReader.jdk11
gnu.testlet.java.io.InputStreamReader.except
gnu.testlet.java.io.BufferedWriter.Test
gnu.testlet.java.io.DataInputStream.readLine
gnu.testlet.java.io.DataInputStream.ReadStream2
gnu.testlet.java.io.DataInputStream.ReadReference
gnu.testlet.java.io.DataInputStream.ReadStream
gnu.testlet.java.io.DataInputStream.ReadReference2
gnu.testlet.java.io.FileReader.jdk11
gnu.testlet.java.io.PushbackReader.Unread
gnu.testlet.java.io.PushbackReader.BufferOverflow
gnu.testlet.java.io.PrintWriter.checkError
gnu.testlet.java.io.PrintWriter.jdk11
gnu.testlet.java.io.InputStream.Test
gnu.testlet.java.io.CharArrayWriter.BasicTests
gnu.testlet.java.io.CharArrayWriter.ProtectedVars
gnu.testlet.java.io.ByteArrayOutputStream.subclass
gnu.testlet.java.io.ByteArrayOutputStream.write
gnu.testlet.java.io.OutputStream.Test
gnu.testlet.java.io.PipedReaderWriter.Test
gnu.testlet.java.io.PipedReaderWriter.PipedTestWriter
gnu.testlet.java.io.ObjectInputOutput.OutputTest
gnu.testlet.java.io.ObjectInputOutput.LoopSerializationTest
gnu.testlet.java.io.ObjectInputOutput.SerTest
gnu.testlet.java.io.ObjectInputOutput.Compat2
gnu.testlet.java.io.ObjectInputOutput.Compat1
gnu.testlet.java.io.ObjectInputOutput.Test
gnu.testlet.java.io.ObjectInputOutput.Deserializable
gnu.testlet.java.io.ObjectInputOutput.SerBase
gnu.testlet.java.io.ObjectInputOutput.SerializableLoopB
gnu.testlet.java.io.ObjectInputOutput.ProxySerializationTest
gnu.testlet.java.io.ObjectInputOutput.InputTest
gnu.testlet.java.io.ObjectInputOutput.SerializableLoopA
gnu.testlet.java.io.ObjectInputOutput.ExtTest
gnu.testlet.java.io.ObjectInputOutput.HierarchyTest
gnu.testlet.java.io.BufferedOutputStream.Test
gnu.testlet.java.io.BufferedOutputStream.helper
gnu.testlet.java.io.BufferedOutputStream.interrupt
gnu.testlet.java.io.PipedStream.PipedStreamTestWriter
gnu.testlet.java.io.PipedStream.receive
gnu.testlet.java.io.PipedStream.Test
gnu.testlet.java.io.PipedStream.close
gnu.testlet.java.io.FilePermission.simple
gnu.testlet.java.io.FilePermission.traversal2
gnu.testlet.java.io.FilePermission.traversal
gnu.testlet.java.io.FilterWriter.MyFilterWriter
gnu.testlet.java.io.FilterWriter.write
gnu.testlet.java.io.StringBufferInputStream.MarkReset
gnu.testlet.java.io.StringBufferInputStream.ProtectedVars
gnu.testlet.java.io.StringBufferInputStream.SimpleRead
gnu.testlet.java.io.FileOutputStream.append
gnu.testlet.java.io.FileOutputStream.fileoutputstream
gnu.testlet.java.io.FileOutputStream.security
gnu.testlet.java.io.FileOutputStream.write
gnu.testlet.java.io.FileOutputStream.jdk12
gnu.testlet.java.io.StringWriter.Test
gnu.testlet.java.io.FilterOutputStream.write
gnu.testlet.java.io.PrintStream.subclass
gnu.testlet.java.io.PrintStream.encodings
gnu.testlet.java.io.Utf8Encoding.WriteRead
gnu.testlet.java.io.Utf8Encoding.mojo
gnu.testlet.java.io.Utf8Encoding.ReadReference
gnu.testlet.java.io.DataOutputStream.writeUTF
gnu.testlet.java.io.DataOutputStream.WriteRead2
gnu.testlet.java.io.DataOutputStream.WriteRead
And, tonight I fixed these issues:

java.io.File.ReadMethods
java.io.File.ExecuteMethods
java.io.File.WriteMethods
So, slowly, but surely. Even though most of these errors aren't show stoppers, they still need to be fixed.

söndag 29 september 2013

File me a river

I finally found what was wrong, and why ECJ couldn't compile like it should. I missed my modifications made to jva.io.VMFile, the native layer between Java files and Amiga files. With this in place, ECJ can now compile correctly. So, no more need to use jikes.

Connecting the dots

However, the file handling is not entirely solved just yet. I'm still pondering on how to solve the dot file, ".", denoting the current directory. I think it's a rather silly little marker; to me as an amigan it serves no real purpose. It just sits there. On unix, a path like "/dev/./././" is really just "/dev/". So, I don't really see the point (pun intended).

Picture stolen from bigactivities.com

Anyhow, I think I have to handle it somehow, since there'll probably be a few applications assuming that it works (amongst them jamvm). The "/dev/" example also leads me to one such unix-amiga inconsistency. In the mauve test suite, a test exists involving files and URI's. The test wants the URI of file "/dev/tmp" to be just "/dev/tmp" (or rather the URI "file://dev/tmp"), whereas the current JAmiga implementation happily tries to make that into "file://SYS:System//dev/tmp/", when I guess it really should be just "file://dev/tmp/" (internally represented as "dev:tmp/"). And where AmigaDOS thinks the path "SYS:System//Utilities", really is "SYS:Utilities", JAmiga thinks its just "SYS:System/Utilities".

Annoying.

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!

torsdag 25 juli 2013

A silly release

Downloads available

So, I haven't done much lately on JAmiga, but I'd thought I at least give you something to play with. I've prepared an archive with everything you need to install a Java environment on AmigaOS 4.

And first of all: its still considered beta!

Here are the downloads:

Bugs

  • If you have installed JAmiga on a drive with international characters in it, like "Hårddisk", AmigaOS will ask you to insert the disk "H?rddisk". You can either assign "H?rddisk" to the real "Hårddisk", or alter your user-starup, and assign JAmiga to the partition name, like DH1:. I guess this also applies for drawers with international names.

Installation

The installation of the main JAmiga archive is pretty straight forward. Just unpack and stat the installer. The "installation" of the silly Twitter client is also easy - just unpack to wherever you want it.

Actually a silly release

I say silly Twitter client, because it is. To be totally honest, this entire release is a bit silly, at least from a user perspective. Not that JAmiga doesn't work - it does indeed work. Only that we don't have so much content to play with. My hope is however that someone with some Java skills will start developing, or find some novel stuff we can run. The source code for my silly Twitter client is included. And you get a Java compiler in the installation! So its only a matter of starting to develop and do stuff better!

Running the silly client

After you've installed JAmiga, you can download and unpack the Twitter client.

Start the Twitter client by double click the JAmigaTwitter.jar file.

You'll be asked for input. This first time you can simply run it, and you'll eventually be presented with some info on how to make it do stuff. Notice the "eventually" - depending on your machine it might take a while to start it, and there's no splash screen. (On my A1XE it starts in 5 seconds, and on my X1000 in like 3 seconds.)

The first you have to do is to allow the Java Twitter client to access your data.
Double click JAmigaTwitter.jar again. But this time, enter "auth" at the end of the input.

After running it this time, JAmiga Twitter will... well... its actually up to you to see what it'll do. But you will need to log into your Twitter account and give access to the "JAmigaTwotter" (sic!) client.

You can of course start the JAmiga from the Shell. You simply point to your JAR file from the java.script:

1.System:> JAmiga:java.script DH1:SillyApps/JAmigaTwitter.jar

With the client you can post status updates on your wall (or whatever it's called on Twitter), fetch your status (Ousp. Just noticed that you can't fetch your own status, some sort of bug), and do query searchs. The query search returns some sort of HTML, and searching for Amiga will only get you spanish people looking for girls.


Searching for geeky amiga stuff is hard...

What's next?

I will continue to update and improve JAmiga, as well as create some Java content. Even if I named this a silly release, I wanted to get it out there for you to test and play with. Hopefully all you Amiga Java coders will find it nice to play with. I will try to produce some tutorials on how to get started coding little Java applications. If you have questions, don't hesitate to ask me.