Author Topic: Java program works in one partition but not the other on same machine  (Read 23474 times)

ivan

  • Hero Member
  • *****
  • Posts: 1561
  • Karma: +18/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #15 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).

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4812
  • Karma: +101/-1
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #16 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.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #17 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
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #18 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

Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4812
  • Karma: +101/-1
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #19 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.

Pete

  • Hero Member
  • *****
  • Posts: 1295
  • Karma: +9/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #20 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



xynixme

  • Guest
Re: Java program works in one partition but not the other on same machine
« Reply #21 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.

ivan

  • Hero Member
  • *****
  • Posts: 1561
  • Karma: +18/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #22 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.

Joop

  • Hero Member
  • *****
  • Posts: 633
  • Karma: +5/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #23 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

Greg Pringle

  • Full Member
  • ***
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #24 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 ===

« Last Edit: January 17, 2017, 09:47:25 pm by Greg Pringle »

ivan

  • Hero Member
  • *****
  • Posts: 1561
  • Karma: +18/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #25 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?


Dave Yeo

  • Hero Member
  • *****
  • Posts: 4812
  • Karma: +101/-1
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #26 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, which seems broken and the suggestion to run Java -X for the non-standard options.

xynixme

  • Guest
Re: Java program works in one partition but not the other on same machine
« Reply #27 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.
« Last Edit: January 18, 2017, 06:25:01 am by André Heldoorn »

ivan

  • Hero Member
  • *****
  • Posts: 1561
  • Karma: +18/-0
    • View Profile
Re: Java program works in one partition but not the other on same machine
« Reply #28 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.

xynixme

  • Guest
Re: Java program works in one partition but not the other on same machine
« Reply #29 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.
« Last Edit: January 18, 2017, 05:27:21 pm by André Heldoorn »