From: Digest <deadmail>
To: "OS/2GenAu Digest"<deadmail>
Date: Mon, 1 Dec 2008 00:01:01 AET-10EDT,10,1,0,7200,4,1,0,7200,3600
Subject: [os2genau_digest] No. 1749
Reply-To: <deadmail>
X-List-Unsubscribe: www.os2site.com/list/

**************************************************
Sunday 30 November 2008
 Number  1749
**************************************************

Subjects for today
 
1   Java programming : Peter Moylan <peter at pmoylan dot org>
2  Re:  Java programming : Voytek Eymont" <voytek at sbt dot net dot au>
3  Re:  Java programming : Simon Coulter <shc at flybynight dot com dot au>
4   Accessing Access(Jet) Databases : John Angelico" <talldad at kepl dot com dot au>
5  Re:  Java programming : Peter Moylan <peter at pmoylan dot org>
6  Re:  Java programming : Peter Moylan <peter at pmoylan dot org>
7  Re:  Java programming : Peter Moylan <peter at pmoylan dot org>

**= Email   1 ==========================**

Date:  Sun, 30 Nov 2008 20:52:44 +1100
From:  Peter Moylan <peter at pmoylan dot org>
Subject:   Java programming

Has anyone ever written a Java program under OS/2? I've just tried a 
simple "Hello World" program and it failed. The exact sequence of 
commands was

    javac HelloWorld.java
    java HelloWorld.class

and the error message was

    java.lang.NoClassDefFoundError: HelloWorld/class

I suspect some sort of environment variable problem. Looking at my 
CONFIG.SYS, it looks as if the "javac" command has run the version 1.3.1 
compiler, but some other environment variables are probably pointing me 
to the version 1.1 directory. The CONFIG.SYS does not seem to contain 
any reference at all to the latest installed version, namely version 1.4.2.

This suggests to me that
 (a) the installer is mixing up the versions; and
 (b) old versions are not being deleted when newer versions
       are installed; and
 (c) the bugs have never been found because nobody has ever
      used Java for OS/2.

If anyone can point me to a counterexample to (c), I'd be grateful.

-- 
Peter Moylan                          peter at pmoylan dot org
                                      http://www.pmoylan dot org

----------------------------------------------------------------------------------
 

**= Email   2 ==========================**

Date:  Sun, 30 Nov 2008 21:19:26 +1100 (EST)
From:  "Voytek Eymont" <voytek at sbt dot net dot au>
Subject:  Re:  Java programming


<quote who="Peter Moylan">

> reference at all to the latest installed version, namely version 1.4.2.

where does one get 1.4.2 ?
I'm still on 1.3.1 (I think)


> (c) the bugs have never been found because nobody has
> ever used Java for OS/2.
> If anyone can point me to a counterexample to (c), I'd be grateful.

JStreet then PolarBar Mailer
also, TCPIP config tool
and, sync tool for palm from Brad

JStreet/PolarBar is a fully featured mail client

-- 
Voytek

----------------------------------------------------------------------------------
 
**= Email   3 ==========================**

Date:  Sun, 30 Nov 2008 21:48:28 +1100
From:  Simon Coulter <shc at flybynight dot com dot au>
Subject:  Re:  Java programming


On 30/11/2008, at 8:52 PM, Peter Moylan wrote:

> If anyone can point me to a counterexample to (c), I'd be grateful.

Usual cause of this error is CLASSPATH not set correctly. It needs to  
include the directory containing your HelloWorld.class file and any  
directories containing classes used by your class. Likely cause is  
either no CLASSPATH environment variable defined or it does not  
include the current directory (presuming that's where your class file  
is located).

Note also that the external name of the class must match the internal  
name and it needs a main with the correct signature.

Regards,
Simon Coulter.
--------------------------------------------------------------------
    FlyByNight Software         OS/400, i5/OS Technical Specialists

    http://www.flybynight dot com dot au/
    Phone: +61 2 6657 8251   Mobile: +61 0411 091 400        /"\
    Fax:   +61 2 6657 8251                                   \ /
                                                              X
                  ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



----------------------------------------------------------------------------------
 

**= Email   4 ==========================**

Date:  Sun, 30 Nov 2008 21:59:23 +1000 (AEST)
From:  "John Angelico" <talldad at kepl dot com dot au>
Subject:   Accessing Access(Jet) Databases

Hi all.

I have been given a CD of potentially useful stuff, but inevitably it
seems, it's a Win-only thing.

I nearly gave up on the spot, but noticed a reference to mdb (ie. Microsoft
Database = Access) files.

The stuff I want is in the .mdb files. The (not pretty, not ugly maybe
pretty ugly) stuff like VB scripts and ocx button controls I can do
without.

If I could run an install on a Win box, I wonder if I could zip up the
unpacked collection, and move it over to eCS? But that would only be
worthwhile IF I had a way of reading mdb files.

I have OOo 2.4 but the Base component locks up my desktop. I have tried to
find stuff in the Help to explain if it can read MS-Access files natively,
but it certainly isn't explained in words of one syllable, so I am still
not sure.




Best regards
John Angelico
OS/2 SIG
os2 at melbpc dot org dot au or 
talldad at kepl dot com dot au
___________________
----------------------------------------------------------------------------------
 

**= Email   5 ==========================**

Date:  Sun, 30 Nov 2008 22:29:11 +1100
From:  Peter Moylan <peter at pmoylan dot org>
Subject:  Re:  Java programming

Simon Coulter wrote:
>
> On 30/11/2008, at 8:52 PM, Peter Moylan wrote:
>
>> If anyone can point me to a counterexample to (c), I'd be grateful.
>
> Usual cause of this error is CLASSPATH not set correctly. It needs to 
> include the directory containing your HelloWorld.class file and any 
> directories containing classes used by your class. Likely cause is 
> either no CLASSPATH environment variable defined or it does not 
> include the current directory (presuming that's where your class file 
> is located).
>
> Note also that the external name of the class must match the internal 
> name and it needs a main with the correct signature.
Thank you. Adding the current directory to the CLASSPATH did indeed 
solve the problem.

That still leaves a puzzle. My CLASSPATH is now

SET 
CLASSPATH=.;C:\JAVA11\LIB\SecMa.jar;C:\java11\Swing\swingall.jar;C:\java11\lib\classes.zip;.\.;C:\OS2\JAVAAPPS\LVMGUI.ZIP;C:\TCPIP\java;

where you'll see that all the references are to Java version 1.1 - the 
oldest version that I have installed. That leaves it undefined as to 
what we should be importing from later versions. It looks as if the 
installer for later versions has simply assumed that nobody would want 
any feature from the later versions. To top that off, my PATH variable 
seems to imply that  both the Java compiler and the Java runtime of 
version 1.3.1 will be invoked. It looks to me as if NOTHING from version 
1.4.2 ever gets used!

It also creates a greater mystery. In the Modula-2 compiler that I use, 
the paths to the various things that need to be found are defined by a 
file XC.RED that is found in the current project directory. As an 
example, the XC.RED for the project I'm now working on is as follows:

xc.msg = $!
xc.cfg = $!
*.tem  = $(XDSDIR)/bin
*.lib  = d:/os2tk45/lib;/dev1/inet/lib;$(XDSDIR)/lib/x86
*.sym  = sym;$(XDSDIR)/sym/x86
*.def  = def;/dev1/inet/def;/dev1/general/def;/pmos2/def
*.mod  = src;/dev1/inet/src;/dev1/general/src;/pmos2/src/vio;/pmos2/src
*.ob2  = .
*.prj  = .
*.obj  = obj
*.rsp  = .
*.mkf  = .
*.res  = .
*.doc  = doc
*.ipf  = doc

You'll see that some search paths are global, but the majority are 
local. The essential point here is that - as with any programming 
language - some library stuff is in global directories, and some is in 
project-dependent directories. This is a pretty basic point. Now, Java 
is a newer programming language than Modula-2, but it appears that its 
search paths are set in a way that can only be changed by rebooting. (Or 
- admittedly - by setting up a new command shell environment; but that's 
a pretty tedious way of proceeding.) I find it hard to believe that a 
modern programming language is relying on a really primitive (obsolete?) 
dependence on environment variables. What am I missing?

-- 
Peter Moylan                          peter at pmoylan dot org
                                      http://www.pmoylan dot org

----------------------------------------------------------------------------------
 

**= Email   6 ==========================**

Date:  Sun, 30 Nov 2008 22:41:48 +1100
From:  Peter Moylan <peter at pmoylan dot org>
Subject:  Re:  Java programming

Voytek Eymont wrote:
> <quote who="Peter Moylan">
>
>   
>> reference at all to the latest installed version, namely version 1.4.2.
>>     
>
> where does one get 1.4.2 ?
> I'm still on 1.3.1 (I think)
>   
I think version 1.4.2 was distributed with eCS version 1.2. Presumably 
it can be downloaded from the eCS web site. It's possible, though, that 
you can't access it unless you have an active eCS support subscription.

Not that it matters. I have version 1.4.2 on my hard disk, but as noted 
elsethread I think that the executables that are actually invoked are 
the 1.3.1 ones, and the library files are from version 1.1. In other 
words, people who have version 1.4.2 installed are not actually using 
it; they're using older versions.

I've also discovered that Sun has pulled a Microsoft trick. The text 
from which I'm learning the language insists that you need version 5.0 
of Java (or better). It seems, however, that "version 5.0" really means 
"version 1.5.0". They renumbered to make the numbers look better, just 
as Windows NT was first released as version 3.51 (to give it a higher 
number than "Warp 3").
>
>   
>> (c) the bugs have never been found because nobody has
>> ever used Java for OS/2.
>> If anyone can point me to a counterexample to (c), I'd be grateful.
>>     
>
> JStreet then PolarBar Mailer
> also, TCPIP config tool
> and, sync tool for palm from Brad
>
> JStreet/PolarBar is a fully featured mail client
>
>   
Yes, but those are applications that, as far as I know, were first 
developed on other operating systems before being ported to OS/2. What 
I'm interested in finding out is whether any existing Java application 
was developed on OS/2 before being ported to another system. I guess 
that the TCP/IP config tool qualifies, but I think that that's a Java 
1.1 application. Now that I think of it, the palm sync tool might also 
qualify, but again I think it's a Java 1.1 application.

 From what I've deduced from CONFIG.SYS, it still looks to me as if 
nobody has ever debugged the most recent OS/2 versions of Java. The 
environment variables in CONFIG.SYS suggest to me that version 1.1 was 
tested, but that nobody bothered to check the updates.

-- 
Peter Moylan                          peter at pmoylan dot org
                                      http://www.pmoylan dot org

----------------------------------------------------------------------------------
 

**= Email   7 ==========================**

Date:  Sun, 30 Nov 2008 22:53:18 +1100
From:  Peter Moylan <peter at pmoylan dot org>
Subject:  Re:  Java programming

Peter Moylan wrote:
> That still leaves a puzzle. My CLASSPATH is now
>
> SET 
> CLASSPATH=.;C:\JAVA11\LIB\SecMa.jar;C:\java11\Swing\swingall.jar;C:\java11\lib\classes.zip;.\.;C:\OS2\JAVAAPPS\LVMGUI.ZIP;C:\TCPIP\java;
Aha! I've just noticed something that perfectly illustrates what I 
mentioned in another message. This CLASSPATH includes the LVMGUI 
directory. In other words, EVERY Java application gets to search a 
directory that belongs to one project. A directory that should have been 
private to LVMGUI project. There is nothing global about that directory. 
It should have been omitted from the global CLASSPATH.

I have argued elsewhere that environment variables are a symptom of 
obsolescent operating systems. Why? Because they promote 
PROJECT-SPECIFIC data to the status of GLOBAL variables. That's bad for 
two reasons. First, because once you've installed a few applications 
your PATH blows out to an unreasonable size. (That's very obvious in 
older versions of Windows. In newer versions you instead put 
program-specific data into a global registry, which is just as bad; but 
that's another subject.) Second, because information that is supposed to 
be private is instead made public. That's not merely a confidentiality 
violation; it's much worse. It means that EVERY application has to worry 
about conflicts with every other application. Not just the presently 
installed applications, but every conceivable future application.

Now, Java is supposed to be a modern programming language. For that 
reason, I refuse to believe that it uses environment variables. Whoever 
ported it to OS/2 has screwed up.

-- 
Peter Moylan                          peter at pmoylan dot org
                                      http://www.pmoylan dot org

----------------------------------------------------------------------------------
 

