OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: Mark Szkolnicki on January 15, 2017, 11:58:51 pm

Title: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 15, 2017, 11:58:51 pm
Hi all!

I was testing some of the Java programs that Joop has been linking on his site (http://joopn.home.xs4all.nl/os2ecs/indexe.htm). He has done some excellent work there, and should be congratulated, for testing and getting a lot of Java programs to run successfully on OS/2 / eCS at the moment and hopefully ArcaOS in future.

I posted here, because I've ran into an interesting issue related to two of the Java games that run successfully on eCS - BioGenesis and the Free Colonization (FreeCol) game.

I have two  standalone eCS v2.1 partitions on the machine where I've installed both games. The games are on a separate partition from either of the OS's as is the Java installation (160GA5).  I've created a CMD file for each of the games, and placed it in the directory with the respective game, and then run it from a program object on the desktop.

When I run the OS from one of the partitions, both games open and run successfully, no problem - running the OS from the other partition however, neither game opens at all, although it looks like Java has run, executing the command file, and watching the results.

As the command file is essentially running the same Java 6 installation on the same partition, I don't think the problem is with Java. Looking at the CONFIG.SYS files on both OS partitions I don't see any difference, Java wise, that would have a bearing on the issue, so was wondering if anything else within the OS may have a bearing on this. All the other Java programs I am testing work successfully using the same command files from either eCS OS partition.

The partition that is not working with those particular two Java programs was reinstalled recently, so there maybe something different there.

As I've not spent a lot of time playing with Java programs, I'm not familiar with how the current Java 6 accesses the OS, so no idea as to what may be needed or may be missing. Was just curious whether anyone else has run into this (including Joop, if your looking in)

Anyway, if anyone has any bright ideas, I'd be interested and Best!

Mark
Title: Re: Java program works in one partition but not the other on same machine
Post by: xynixme on January 16, 2017, 01:35:19 am
When I run the OS from one of the partitions, both games open and run successfully, no problem - running the OS from the other partition however, neither game opens at all, although it looks like Java has run, executing the command file, and watching the results.

I'm not using anything you've mentioned and I haven't seen any command file, but did you reboot between attempts? Did the first successful executions create or change some file (setup/INI/EA/high-score), which still refers to the previous partition? Does it work when you use the same drive letter and directory structures?
Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 16, 2017, 02:03:01 am
Did you install all the prerequisites? libc065 or libc066 and forwarder, gcc446.dll or gcc1.dll and forwarder and odin? If using yum, perhaps share your Unixroots.
Also look in popuplog.os2 in the root of the non-working install
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 16, 2017, 03:16:33 am
When I run the OS from one of the partitions, both games open and run successfully, no problem - running the OS from the other partition however, neither game opens at all, although it looks like Java has run, executing the command file, and watching the results.

I'm not using anything you've mentioned and I haven't seen any command file, but did you reboot between attempts? Did the first successful executions create or change some file (setup/INI/EA/high-score), which still refers to the previous partition? Does it work when you use the same drive letter and directory structures?

Hi Andre!

Yes, I did reboot between attempts. I have not actually tried to play either game at the moment, as I was assuring myself that the Java program came up on the partition in question. AFAIK, looking in both of the program directories, and in the location specified by JAVA_HOME in CONFIG.SYS, I see no files created related to either program.

Not having used many Java programs, I'm not sure if INI or CONFIG files are created to store settings, where they would reside, but I have assumed they would be either in the directory for the program, or the location specified by JAVA_HOME

By same drive letter and directory structures I assume you mean for both the JAVA 6 location and the programs in question.

While the OS partitions are different (Drives D: and F: respectively) the Java 6 installation is the same on both (located on Drive E:) and the programs reside on Drive G:

But that does get me thinking about the JAVA_HOME setting .................

Thanks for the suggestions, Andre and Best!

M

Title: Re: Java program works in one partition but not the other on same machine
Post by: xynixme on January 16, 2017, 03:48:38 am
I'm not sure if INI or CONFIG files are created to store settings, where they would reside, but I have assumed they would be either in the directory for the program, or the location specified by JAVA_HOME

Something like that, yes. FWIW, I've just started Jetris (different OS version, different Java, different game) for the first time and it stores its data in the %HOME%\.jetris directory.

So you could try to delete relevant entries under %HOME% too, if such a directory was created by the games. Nevertheless it's more likely that there's a problem with a missing "program" file (Java, requirements) indeed.

HTH.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 16, 2017, 04:06:20 am
Did you install all the prerequisites? libc065 or libc066 and forwarder, gcc446.dll or gcc1.dll and forwarder and odin? If using yum, perhaps share your Unixroots.
Also look in popuplog.os2 in the root of the non-working install

Hi Dave!

First of all a Happy New Year to you!

Since this was a new install of the eCS v2.1 partition, I did take the time to install ANPM, at once, to bring files to the latest level in the UNIXROOT structure immediately. I had been wondering if some libraries may be missing that the Java 6 runtime may require.

I know for a fact that all of the libc (0.6.6-30), gcc-fwd and gcc1 libs (4.9.2.1-3) and odin libs (0.8.9-1) are present, as I need them for various of the programs (including yours) that are currently at the latest versions, I also have SDL (1.2.15-5) and libQT4 (4.7.3.2-1) libraries installed. I mention the last two as all the aforementioned libraries are the usual culprits for getting programs which are not specifically written for pure OS/2 / eCS to run.

Also would you know Dave, whether any Java programs which may create INI or CONFIG files would store them anywhere outside of their own directories or other than in the location specified by JAVA HOME? Andre previously had a good suggestion related to possible created program files, but I could not find any anywhere.

And come to think of it, I do know of one difference with the partition that was newly installed - I was experimenting with creating a separate UNIXROOT on my shared SYSTEM partition (Drive E:), so SET UNIXROOT is pointing to E: there, and its where ANPM installed all the files, for the partition where the two Java programs don't run.

Could that affect the GA5 version of Java 6?

In regards to popuplog.os2, nothing startling there - I had a pesky little problem with a little network game program that I'm fond of playing called qNetWalk, and was trying a number of things with that to get it working again, so it  showed up multiple times in popuplog.

I traced the problem there to qNetWalk not liking any of the SDL12.dll files past the 2008 version (5/11/2008 188,402 bytes). Installing that file locally in the qNetWalk directory seems to have solved that while keeping the latest SDL12.DLL for other reasons.

Best!

M

Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 16, 2017, 04:55:21 am
As André said, most store their configuration etc in %HOME%, often in a directory/file that starts with a dot (hidden on *nix systems).
Did you check your config.sys for references to other Java installs, things like CLASSPATH?
You could always test by wrapping your Java program(s) in a script to point at your other UNIXROOT along with BEGINLIBPATH and PATH.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 16, 2017, 06:52:11 am
As André said, most store their configuration etc in %HOME%, often in a directory/file that starts with a dot (hidden on *nix systems).
Did you check your config.sys for references to other Java installs, things like CLASSPATH?
You could always test by wrapping your Java program(s) in a script to point at your other UNIXROOT along with BEGINLIBPATH and PATH.

Hi Dave!

Had a look in the HOME path (X:\HOME\DEFAULT) specified for both OS partitions and there are indeed entries in a .config directory (and actually outside of it as well - many programs are not following strict UNIX conventions). While many of the QT4 programs I use have config or INI files there, I saw no indications that any of the Java programs held settings (or any other data) there.

No CLASSPATH statements are there other than the ones originally put in by eCS at the time of installation - the same statements are present in the CONFIG.SYS for both partitions.

I don't know whether this would perform the same function, but for the partition where the programs did not come up, I briefly edited the CONFIG.SYS to direct SET UNIXROOT to the other partition, rebooted and  briefly tested whether the behaviour changed - the same thing occurred as previously. I also tested in the opposite direction, setting UNIXROOT for the partition where the programs do come up to the shared E: drive and rebootedi. Both programs still ran, despite using the test UNIX framework on Drive E, instead of the one on the partition.

As I normally don't spent a lot of time writing Rexx or other command files, I assume by your reference to a script that I could modify the current command file, to add a "SET UNIXROOT" statement at the beginning prior to the JAVA related statements. I could do that, but, if the tests I did above showed no difference, would it be of any value?

Best!

Mark

Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 16, 2017, 08:59:36 am
It's the LIBPATH that's most important. Something like
Code: [Select]
set UNIXROOT=x:
set PATH=x:\usr\bin;%PATH%
set BEGINLIBPATH=x:\usr\lib
set LIBPATHSTRICT=T

Changing x as needed and run at a cmd prompt then try running the Java program from the same cmd prompt. You could even just type the above into a cmd prompt
Title: Re: Java program works in one partition but not the other on same machine
Post by: ivan on January 16, 2017, 12:03:23 pm
Quote
Had a look in the HOME path (X:\HOME\DEFAULT) specified for both OS partitions and there are indeed entries in a .config directory (and actually outside of it as well - many programs are not following strict UNIX conventions). While many of the QT4 programs I use have config or INI files there, I saw no indications that any of the Java programs held settings (or any other data) there.

That is understandable if you are using the parameter -Duser.home=<path to java program> when starting the java program because that tells the program to put every thing in its directory.

Something that also helps is NOT having the home directory on the boot partition.  Our test machine has the home directory on drive G and have it listed as such in the config.sys of the 4 versions of OS/2 we can boot from.  We are also now going to try and see of putting all of the unix dlls into one directory on that drive, and listing it in the LIBPATH will work (if it does it will simplify testing).
Title: Re: Java program works in one partition but not the other on same machine
Post by: xynixme on January 16, 2017, 02:08:26 pm
We are also now going to try and see of putting all of the unix dlls into one directory on that drive, and listing it in the LIBPATH will work (if it does it will simplify testing).

Thread-drift: if you record which apps requires which DLL, then you should be finer than fine. I guess the list of exceptions (not a CPU's) to be tested isn't that long. Some apps require a specific version of a DLL, and most of those apps are older than current DLL versions.

Sometimes it does help to avoid installers. A recent example is the WarpIN version of the browser Links. It's bad and it's evil, unless you really want to meet the devil of e.g. JPEG.DLLs. Nevertheless the install script of Links can be used to create an own INSTALL.CMD, with Dave's earlier LIBPATHSTRICT and BEGINLIBPATH added to the object's settings. In my case it's an added bonus that I don't have to backup both the whole install package and the installed files anymore.

Let's return to Java...
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 16, 2017, 06:47:58 pm
It's the LIBPATH that's most important. Something like
Code: [Select]
set UNIXROOT=x:
set PATH=x:\usr\bin;%PATH%
set BEGINLIBPATH=x:\usr\lib
set LIBPATHSTRICT=T

Changing x as needed and run at a cmd prompt then try running the Java program from the same cmd prompt. You could even just type the above into a cmd prompt

Actually I tried that, Dave, and it was a no go - but I will file away the advice, as it may come in useful for another issue I'm examining. By the way was set LIBPATHSTRICT=T supposed to be "T" or changing "X" as needed (I tried it either way - no difference)

After a good nights sleep, I solved the problem this morning - and the solution may be a quirk or bug in the programs involved.

Reading the requirements for Java 6 GA5, from both your note, and the instructions made me wonder what was installed on the partition that worked. It was installed three years ago and has had numerous libraries added to it, prior to our using the UNIX framework of installation, I found all the requisites there (which I should probably clean up sometime to avoid DLL conflicts), including GCC446,dll, the LIBc's in \eCS\dll  and Odin ............ but not on the new partition.

I tried out having just the GCC and LIBc in the partition - no difference

In summary, it needed the ODIN libraries to be installed on the boot partition.

Once they were there, both programs started up - and without even a boot to load the new LIBPATH from CONFIG.SYS, which was interesting.

I then remmed out the ODIN statements afterwards to see if I could reproduce the problem - and again both programs started up!

To verify this, I went to another machine, where I had installed a new eCS 2.2 partition with the UNIXROOT also on the E: SYSTEM partition on that machine, started up the same programs, with the same parameters, and couldn't get the programs to run. Installing ODIN on that boot partition again eliminated the problem (and yes removing references to ODIN in the CONFIG.SYS and rebooting again the programs still started up)

I have a number of Java programs now, and they all have started up and ran without any problems with Java 6, with the ODIN libraries installed in the UNIX framework in either configuration (ie. located either on the boot partition or on the shared SYSTEM partition. I can only conclude that there is some quirk or bug in these two programs which need to know that certain dll's are present, for whatever reason, on the boot partition, even if they don't use them (or perhaps they would be important in playing the game, as I having tried playing either yet.). Not being a programmer, I'm not sure of the intricacies of why this would occur - being a troubleshooter by profession I only know only that it solved this particular problem.

If that is indeed the solution, I expect anyone installing all libraries to a UNIXROOT on the boot partition using YUM or ANPM would never notice this issue But this was an interesting little troubleshooting problem.

If you or others have any questions let me know.

Best and Thanks for the guidance!

Mark
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 16, 2017, 06:53:41 pm
We are also now going to try and see of putting all of the unix dlls into one directory on that drive, and listing it in the LIBPATH will work (if it does it will simplify testing).

Thread-drift: if you record which apps requires which DLL, then you should be finer than fine. I guess the list of exceptions (not a CPU's) to be tested isn't that long. Some apps require a specific version of a DLL, and most of those apps are older than current DLL versions.

Sometimes it does help to avoid installers. A recent example is the WarpIN version of the browser Links. It's bad and it's evil, unless you really want to meet the devil of e.g. JPEG.DLLs. Nevertheless the install script of Links can be used to create an own INSTALL.CMD, with Dave's earlier LIBPATHSTRICT and BEGINLIBPATH added to the object's settings. In my case it's an added bonus that I don't have to backup both the whole install package and the installed files anymore.

Let's return to Java...

Hi Andre!

Just wanted to give you a note of thanks in addition to Dave. Your suggestions and his gave me some idea of where to look to solve the problem, which I think is a quirk or bug most wouldn't encounter.

But I always find these discussions useful, as after 26 years of using this operating system, I'm still amazed at how much more there is to learn.

Best, Sir!

Mark
Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 16, 2017, 07:08:58 pm
Sounds like installing Odin with YUM/RPM didn't initialize the registry.
The OpenJDK is ported from Windows and uses the Odin libraries instead of the real Windows libraries. Being a Windows clone (sorta), things depend on the registry.
Be easy to test, move \os2\system\USER.DAT and \os2\system\USER.DAT out of the way. Open REGEDIT2 which will create a very minimal registry and test. IIRC the old Odin install would add a bunch of stuff to the registry. Beware that other Windows ports such as some Flash versions also use the registry.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Pete on January 16, 2017, 07:41:05 pm
Hi Ivan

...
 We are also now going to try and see of putting all of the unix dlls into one directory on that drive, and listing it in the LIBPATH will work (if it does it will simplify testing).


I have 1 "unix libs" directory, K:\DLLS,  that I share between 3 eCS installations and is on the libpath in all 3 eCS installations. It contains gcc/libc + all dll files required to run current Seamonkey, OpenOffice, VirtualBox and other software.

It certainly makes sure that all eCS installations are "in step" - no more booting to a different volume and finding something does not work due to outdated/missing dll file(s).  :-)

I have not had any problems with this setup to date.


Regards

Pete
Title: Re: Java program works in one partition but not the other on same machine
Post by: ivan on January 16, 2017, 10:27:45 pm
Thanks for that Pete.

We tried it this afternoon and, as you say, it works but we also found that some of the older programs are not happy with the new slimmed down forwarder dlls and require the old dlls to work (so far placing the old dlls in the directory with the programs and having the dot at the beginning of the LIBPATH has fixed that).
Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 16, 2017, 10:59:34 pm
The only potential problem is the odd one that actually uses @UNIXROOT to find its configuration such as fontconfig which currently loads its configuration from @UNIXROOT\etc. It should fall back to %HOME% but I think it may currently be broken and even if not, the config would have to be put there as well. It also by default puts its cache under @UNIXROOT\var and I believe falls back to the root of the directory its installed on.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 17, 2017, 12:26:46 am
Quote
Had a look in the HOME path (X:\HOME\DEFAULT) specified for both OS partitions and there are indeed entries in a .config directory (and actually outside of it as well - many programs are not following strict UNIX conventions). While many of the QT4 programs I use have config or INI files there, I saw no indications that any of the Java programs held settings (or any other data) there.

That is understandable if you are using the parameter -Duser.home=<path to java program> when starting the java program because that tells the program to put every thing in its directory.

Something that also helps is NOT having the home directory on the boot partition.  Our test machine has the home directory on drive G and have it listed as such in the config.sys of the 4 versions of OS/2 we can boot from.  We are also now going to try and see of putting all of the unix dlls into one directory on that drive, and listing it in the LIBPATH will work (if it does it will simplify testing).

Hi Ivan!

As I found Joops example Java command files quite useful in setting up all of the Java Programs I currently use (which include some that are not linked to his website), I did indeed use -Duser.home=<path to java program>. I was not aware of its exact usage, so thanks for the explanation.

Looking in the directories for both of the programs with strange behaviour, I could see no INI or config files created within the directory, but, looking at the problem earlier this morning, found that I needed the ODIN libraries present directly on the boot partition that was accessing the UNIX framework on a different partition.

But your post raises some very interesting questions, Sir, as , while some of us have been using multiple partitions for ages, either for software development or testing, or in my case as insurance, as my business runs on eCS and needs the OS avaiable for work as all times, I expect more users may be setting up multiple OS partitions in future, especially with the impeding roll-out of ArcaOS, which, as in the case of most early stage OS's, may not be totally ready for prime time at the beginning.

I was curious on your views of the following:

1) in the case of the parameter -Duser.home=<path to java program>, could that also be used as a statement in a command file to set-up and run , say, QT4 programs, to store config, INI or setting data for the program in question, within its own directory?

2) I noted in the two separate HOME\DEFAULT directories on this machine (and two more on my test machine), multiple .directories (.config, .dssaver, .local, as well as other various ,program directories, all containing INI's, configs, setting files, etc. etc.). As there are various incarnations of OS/2 and eCS, with ArcaOS pending, and all of them slightly different in set-up, would it be even feasible to have one home directory for all (I guess you could say "One Ring to rule them all", in Lord of the Rings parlance). I don't know, if changes are being made constantly to the one HOME directory, whether accessing it from more than one OS, could, shall we say, be chaotic.

3)I would see having all the DLL's being in a UNIX framework on a separate partition, accessed by multiple OS partitions as a useful timesaving  solution, from a maintenance standpoint. However, as I learned by accident today, there may be quirky programs that still want libs in specific locations on the boot partition, despite what the LIBPATH says.

Any thoughts on 1) to 3), Ivan, (or anyone)? It would be convenient, to have everything in one place servicing multiple partitions, for expert users that need it. But is it feasible?

Best!

Mark
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on January 17, 2017, 12:44:28 am
Hi Ivan

...
 We are also now going to try and see of putting all of the unix dlls into one directory on that drive, and listing it in the LIBPATH will work (if it does it will simplify testing).


I have 1 "unix libs" directory, K:\DLLS,  that I share between 3 eCS installations and is on the libpath in all 3 eCS installations. It contains gcc/libc + all dll files required to run current Seamonkey, OpenOffice, VirtualBox and other software.

It certainly makes sure that all eCS installations are "in step" - no more booting to a different volume and finding something does not work due to outdated/missing dll file(s).  :-)

I have not had any problems with this setup to date.


Regards

Pete

Hi Pete!

You may have seen my post to Ivan already, but your post raises a question, regarding the multipartiiton issue, whether running OS/2, eCS, Jave, QT4, SDL or other programs. As you are using one directory of libraries to service three installations, have you ever run into an issue where any of the programs you use would refuse to run when your using any of the boot partitions in question, with that configuration?

I first of all don't know if all the eCS installations are the same program version, or whether you have different versions on the machine for testing or development purposes.

Being static libraries which are not constantly changing (like INI's or Config files) I expect the answer would be "No". But curious anyway and Best!

Mark

Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 17, 2017, 01:54:18 am
I've been using the same HOME directory for years, starting with Warp V4 and haven't had any problems.
I've also never had Odin installed on any boot partitions and shared it amongst various installs.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Pete on January 17, 2017, 03:11:44 am
Hi Mark

No, no problems, all applications relying on those libraries work from all 3 installations - 1 eCS2.1 and 2 eCS2.2b2.

I don't know about your "static libraries" comment as the "nixy" libraries involved do tend to get updated fairly often ie installing the latest OpenOffice and Support package updated some of the DLL files used by Seamonkey and VirtualBox. I do agree they do not get updated as often as an ini file might though.

I am currently looking at merging the 3 \ecs\dll directories into 1 but am also considering archiving my eCS2.1 installation as I seem to have both eCS2.2b2 installations running well and have not used 2.1 much recently. Merging the remaining 2 eCS2.2b2 \ecs\dll directories should not be too difficult  ;-)


Regards

Pete


Title: Re: Java program works in one partition but not the other on same machine
Post by: xynixme on January 17, 2017, 04:05:38 am
1) in the case of the parameter -Duser.home=<path to java program>, could that also be used as a statement in a command file to set-up and run , say, QT4 programs, to store config, INI or setting data for the program in question, within its own directory?

-D will be a parameter, processed or ignored by random EXEs, in an undefined way. It's not a feature of the OS. There is a generic solution. Create a WPProgram object to execute the EXE, and append "SET HOME=<path to program>" to the WPS setup string of the WPProgram object. Or add it to a CMD file. This should override CONFIG.SYS' setting.

I'm using the default, single %HOME% setting, but I'm not creating backups of e.g. a new high score. A few apps with an own, different HOME directory are using the SET-method.
Title: Re: Java program works in one partition but not the other on same machine
Post by: ivan on January 17, 2017, 12:01:11 pm
André, since we are generally talking about JAVA programs and where they store their data, the -D parameter is specific to that.  I don't think that anyone would be foolish enough to try and use it with any other OS/2 program.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Joop on January 17, 2017, 08:23:49 pm
As I found Joops example Java command files quite useful in setting up all of the Java Programs I currently use
Thank you  ;D
(which include some that are not linked to his website)
Interesting, which one?
1) in the case of the parameter -Duser.home=<path to java program>, could that also be used as a statement in a command file to set-up and run , say, QT4 programs, to store config, INI or setting data for the program in question, within its own directory?
-Duser.home is a Java thing, will not work with QT or any other none Java program.
2) I noted in the two separate HOME\DEFAULT directories on this machine (and two more on my test machine)...
You have to set that up in your config.sys file with SET HOME=[drive:]\HOME\DEFAULT. Having more can confuse programs.
3)I would see having all the DLL's being in a UNIX framework on a separate partition, accessed by multiple OS partitions as a useful timesaving  solution, from a maintenance standpoint. However, as I learned by accident today, there may be quirky programs that still want libs in specific locations on the boot partition, despite what the LIBPATH says.
I have an OS/2 machine, not an Unix machine, so no Unix framework. Well sort off, because if you run Gimp you get some directories with Unix names and fontconfig does the same. But all are NOT on the OS/2 drive.

I have a drive with OS/2 with a directory OS2 with ONLY OS/2 things. Everything else which is needed is going to the ecs directory. So all needed libs and so on are in \ecs\dll. You need to set it right in your config.sys, but that is once and you don't have to look at it ever again. If you have a new whatever.dll for running nextlevelfirefox, then you place it in ecs\dll. Ready.

I have on my programs drive all versions of ODIN. They are installed in a directory called ODIN-xxx where xxx is the version. I have one directory called ODIN-empty. That one contains the subdirectory structure. With a new version of ODIN I create a new ODIN-xxx directory and copy from the ODIN-empty the structure to this new ODIN-xxx directory.
Next I have an ODIN directory, this directory is set in the config.sys. This directory contains the working copy of ODIN. If I want to test with an older ODIN version, than I copy the working directory to the directory ODIN-old. Then I compare the ODIN directory with the directory of an older ODIN version in order to see what I have to delete. Normally only the directory \ODIN\system32 needs to be erased and copied from the old version. In this way I can switch from ODIN versions in a very short time. I don't have to  adjust or change anything else because nothing changed, directories are still the same. The only thing I run is the program odininst.exe.

With Java its not very different. I have all Java versions next to each other, it doesn't bite so to speak. Also I run Java programs using different Java versions on different drives. That's why I use command files. With this setup I can run any Java version with any ODIN version. So read my site carefully, some combinations are not  good. Best is to use  ODIN 0.8.9 (2013-02-17) and Java Version 1.6.0 Build 27 GA5 (2013-02-17).

Its a while ago that I played both games. If you run into problems than you can try to find out what is wrong by adding 2>biogenesis-bugs.txt (as an example) to the end of the line starting with java ...... If you have used javaw its a good time to erase the "w". With java... you see more if you start the command file in an os/2-ecs session. If the java program has problems you get a file ----bugs.txt. The top error is the one which is responsible for the error. All other errors are in most cases a logic follow up because of that error.
Biogenesis doesn't store anything. If you have used my example of the command file, then verify if the directories are correct for your system. Always use "-Duser.home=[drive:]\javaprogram" right after java or javaw. This forces the java program to store all files in own directory. So if you want to erase the program you only have to delete one directory. There are some exceptions with programs which unpack in memory and use the home structure. The program "Mars Simulation Project" is such a program. You can add what you want, but the program doesn't see it.
Freecol also doesn't have user files. It was a bit of a problem to run it, but I changed the command file a long time ago. Its now java -Xmx512M -Duser.home=[drive:]\freecol -jar FreeCol.jar --no-intro $1 $2 $3 $4 $5 $6 $7 $8 $9. Be sure to have the --no-intro, because the intro can stall your system. It might be that you use a different drive/directory setup.
It can be wise to add "SET CLASSPATH=" in your command file, this is true for Biogenesis, I didn't used it with Freecol.

If the program runs without any trouble then you can switch from java to javaw.

I hope this will give some ideas to solve your problems.

Regards,
Joop
Title: Re: Java program works in one partition but not the other on same machine
Post by: Greg Pringle on January 17, 2017, 09:44:00 pm
Never heard of such a thing.
I have been programming in Java for OS/2 since 1997. Continuously.
The only reason for a drive (partition) change to effect the program is if there is something hard coded in the program.
A bad class to determine drive and directories can give odd results when not using the "preferred" drive.

here is a setup to fix a bad install of java.
add a line at the end to start your java program.
(also change the path the java1.6 as needed)

@REM ===
SET CLASSPATH=
SET JAVA_HOME=D:\java16\jre
SET SWING_HOME=D:\java16\jre
SET PATH=D:\java16\jre\bin;D:\java16\bin;%PATH%
set BEGINLIBPATH=D:\java16\jre\bin;D:\java16\lib\dt.jar;D:\java16\lib\jconsole.jar;D:\java16\lib\tools.jar;%BEGINLIBPATH%
SET LIBC_HOOK_DLLS=D:\java16\LIB;%LIBC_HOOK_DLLS%
SET INCLUDE=D:\JAVA16\INCLUDE;
SET LIB=D:\JAVA16\LIB;
@REM ===

Title: Re: Java program works in one partition but not the other on same machine
Post by: ivan on January 18, 2017, 12:54:57 am
While we are talking about starting java programs here I have a text file that I use to populate a program object (one day I will work out how to use rexx to take that text file and create all the program objects).

An example of part of that file follows:

                                           diy-circuit

C:\OPENJDK6-GA3\BIN\JAVAW.EXE
-Duser.home=h:\java-apps\diylc-3-23-0 -Xms138m -Xms512m -Dorg.diylc.scriptRun=true -jar diylc.jar
H:\JAVA-APPS\DIYLC-3-23-0

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

                                       BlueJ
                                       
F:\OPENJDK6-SDK\BIN\JAVA.EXE
-Duser.home=h:\java-apps\bluej -Dawt.useSystemAAFontSettings=on  -cp h:\java-apps\bluej\lib\bluej.jar;f:\openjdk6-sdk\lib\tools.jar bluej.Boot
****

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

                                    Watermarker
                                   
C:\OPENJDK6\BIN\JAVAW.EXE
-Duser.home=h:\java-apps\watermarker3-0 -Xmx512m -jar watermarker3-0.jar
H:\JAVA-APPS\WATERMARKER3-0

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

                                      PDFSaM
                                     
C:\OPENJDK6\BIN\JAVAW.EXE
-Duser.home=h:\java-apps\pdfsam -Xmx256m -jar pdfsam-2.2.2.jar
H:\JAVA-APPS\PDFSAM

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

                                       jPDFTweak
                                       
C:\OPENJDK6\BIN\JAVAW.EXE
-Duser.home=h:\java-apps\jpdftweak -Xmx256M -jar jpdftweak.jar %*
H:\JAVA-APPS\JPDFTWEAK

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

                              StoryBook
                             
C:\OPENJDK6-GA3\BIN\JAVAW.EXE
-Duser.home=h:\java-apps\storybook -Xmx192m -jar lib/storybook.jar
H:\JAVA-APPS\STORYBOOK

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

As you cab see it is very simple and it works for all the java programs we use.

@Greg. 
It sounds as if you are the java expert si I have a question.  Where can I get a list of all the parameters that can be used, things like -D(I assume there are more parameters than user.home but what are they) and -X(there has to be a list somewhere) and any others?

Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 18, 2017, 03:01:49 am
@Ivan, Have you tried the obvious, java -help or better java -help | less?
This also leads to the URL, http://java.sun.com/javase/reference (http://java.sun.com/javase/reference), which seems broken and the suggestion to run Java -X for the non-standard options.
Title: Re: Java program works in one partition but not the other on same machine
Post by: xynixme on January 18, 2017, 06:19:31 am
I have a text file that I use to populate a program object (one day I will work out how to use rexx to take that text file and create all the program objects

Can you attach a few "complicated" binary samples, preferably with different types (e.g. several DOS settings) of settings? I'm willing to look at it, without promising anything. It may be easy, depending on what you've done and what you're using.

I install almost everything with Rexx, without overdoing it. 10 INSTALL.CMD files, at the moment. This includes quite a few Rexx'ified and improved or customized un-WarpIN'ed  packages. I did consider using DATABASE.TXT entries, but actually it's easier to insert "SET HOME=..." in a CMD file than to append such a made-up line to a text file, and next process such a text file. The Rexx-part is almost always identical: many SysCreateObjects, SysCreateShadows and some SysSetObjectDatas.

My INSTALL.CMD files have no use for other people, other that finding out how to install StarOffice 5.1 when you've restored all files. The files are too customized, including #%$^!*&#@ DLL management (SET LIBPATHSTRICTs, and so on). It was never my goal to create a generic alternative install procedure, and it won't become my goal. It will recreate well over 90% of all objects, and I'll save at least one day when I have to install from scratch. This result still can be improved by about half a day, but I'm not overdoing it.
Title: Re: Java program works in one partition but not the other on same machine
Post by: ivan on January 18, 2017, 01:02:02 pm
Hi Dave, I did that ages ago and got very frustrated.  For example it just gives   -D<name>=<value> set a system property  but I want a list of the <name> and possibly the <value>.   The -X gives a little more information but again no actual solid details.  One od the things that started me looking was the fact that a couple of the java programs always start full screen and on a 28" monitor that is overkill.  There has to be some parameter that sets maximum size but, so fat I haven't found it.


André, again we are talking about JAVA programs and I gave an example of what we use.  With program objects setup that way it just requires a double click to start them.  Yes, we could use CMD files but why do so when simple program objects do the job.  All I am considering is using rexx to automate the process rather than using cut and paste.
Title: Re: Java program works in one partition but not the other on same machine
Post by: xynixme on January 18, 2017, 05:23:09 pm
Yes, we could use CMD files but why do so when simple program objects do the job.  All I am considering is using rexx to automate the process rather than using cut and paste.

This doesn't really answer my question, and my own OS/2 Rexx apps tend to have the extension CMD. And those files are text files.For example all of my WPINSTALL.CMD files. I already knew that my CMD files were Rexx files... :D One could as well create a JAVAINST.CMD (text) file immediately, so you don't have to copy & paste twice. Rexx code to generate a JAVAINST.CMD is far more complicated than a JAVAINST.CMD. I started to append what you were considering, but other people will also have to copy & paste your earlier post correctly to be able to see what the more important final result looks like, so I have deleted it again.

So far one would need one copy & paste template line, FWIW, to account for provided examples:

Code: [Select]
CALL SysCreateObject "[paste stripped first line here]","<WP_DESKTOP>","EXENAME=[paste second non-blank line];PARAMETERS=[paste third line here];STARTUPDIR=[fourth one]"

Or, without the insert-heres:

[code]CALL SysCreateObject "","<WP_DESKTOP>","EXENAME=;PARAMETERS=;STARTUPDIR="

Leave out ;STARTUPDIR= if there's no STARTUPDIR (your text database: invalid path, like ****).

After copying & pasting (once, per item):

Code: [Select]
CALL SysCreateObject 'WPProgram','Jetris v1.04','<WP_DESKTOP>','EXENAME=D:\PROGRAMS\JAVA142\BIN\JAVAW.EXE;PARAMETERS=-jar jetris.jar;STARTUPDIR=D:\JAMES\JETRIS'
CALL SysCreateObject 'WPProgram','Night Vision','<WP_DESKTOP>','EXENAME=D:\PROGRAMS\JAVA142\BIN\JAVAW.EXE;PARAMETERS=-jar nvj.jar;STARTUPDIR=D:\JUNIVERSE\NVSN'

And so on. The overhead of RxFuncAdd'ing SysCreateObject and ";ICONFILE=" is excluded, and so is error checking. It can be a disadvantage that the lines are longer than your better readable text file. Your format is more pleasing to the eyes. An advantage is that you have to copy & paste once, by appending a new line to this text/CMD/Rexx file. The Rexx code isn't that hard, you're typically using just one function with about the same settings.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Dave Yeo on January 18, 2017, 06:52:42 pm
@Ivan, poking around the openjdk site, the best I found was http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html (http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html) which is basically the same as -help outputs.
You can also pass help to the Java program you're running, some such as jphoto have quite a list. Just edit your batch file, use java rather then javaw and add -help to the end of the line launching the jar (or after the jar), perhaps piping through less. Launch in a console.
Title: Re: Java program works in one partition but not the other on same machine
Post by: xynixme on January 18, 2017, 07:02:04 pm
a couple of the java programs always start full screen and on a 28" monitor that is overkill.  There has to be some parameter that sets maximum size but, so fat I haven't found it.

https://docs.oracle.com/javase/tutorial/extra/fullscreen/displaymode.html (https://docs.oracle.com/javase/tutorial/extra/fullscreen/displaymode.html) and e.g. [ur]http://www.java2s.com/Tutorials/Java/java.awt/DisplayMode/Java_Tutorial.htm[/url] do suggest that the Java app controls the display mode (within the borders of the OS, hardware and graphic driver), as usual. Contact the author of the Java app, with a RFC to be able to reduce the part of the screen and/or the display mode the app is using? In theory Java apps should be able to deal with a smaller virtual screen indeed, basicly, instead of always fully using the real size of the screen. I'm not a Java programmer, so I don't know if a smaller virtual screen would be centered by default.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Greg Pringle on January 18, 2017, 08:47:27 pm
The java -X switches that relate to memory can really be ignored. They will not produce the results you expect. That is why documentation if often contradictory. Java will use the memory it needs up to the limits that the OS will supply. In the case of OS/2 the java implementation will go beyond the memory that will actually work. That is the case with 1.3 and especially with 1.6 The memory switches will not fix a java program which has excessive memory usage. In the past some have thought that the switches would help a program that is a pig to start as some server  programs have been. I don't agree. As I have said in another thread, there is a real problem with OS/2 Java 1.6 . The same problem is found in other VMs but is not universal. The problem is that when new Threads are started and ended there will be a memory leak. I designed a Thread pool which can easily be used by classes which fixes the problem. Of course you need the source and some knowledge to take advantage of it.
Title: Re: Java program works in one partition but not the other on same machine
Post by: Mark Szkolnicki on February 01, 2017, 07:30:52 pm
Hi Joop!

Was away for awhile and saw this post only on the weekend.


Quote from: Mark Szkolnicki on January 17, 2017, 12:26:46 am

    (which include some that are not linked to his website)

Interesting, which one?


In answer:

Art of Illusion v3.0.2 (although I haven't had time to test it it does run)

Stratego v0.7 (available on sourceforge, like some of the other programs you've linked)

Settlers of Catan (Solitaire version) v1.9.8 - (available on sourceforge) - it does come up, but haven't tried to play it as of yet.

I can send you the settings info if you wish - they are pretty standard, using our OpenJDK 6 GA5

After getting Colonization to run, played the intro, but then was getting an increasing "screeching sound' as I was reviewing the settings for a new game - will try the CMD file settings you suggested including disabling the intro, and see what happens.

Your post was very detailed (something I appreciate in this twitter obsessed world) so I will need to review it more thoroughly, and let you know if I have any other questions or comments.

In the meantime, a fine week to you, and thanks for taking the time and effort  to inform the community related to Java Programs which work for us on our operating system of choice!

Best!

Mark