Example One | Just an example ... |
Running Java Software on OpenVMSThings have been pretty quiet on my blog for the last few months. Of course, this doesn't mean things have been quiet with me. On the contrary, the blog has been neglected because I have been quite busy. So, here is the first of many posts covering the things that have kept me away. I don't know how many people reading this have ported Java applications to OpenVMS. However, if you haven't, it's generally a lot easier than you might think. Over time I have built up a bit of a "method" for getting Java software up and running quickly on OpenVMS. My biggest quibble with Java applications is that they often need many of the JAVA$* or DECC$* logicals to be configured. This often disrupts my environment, which I don't like. The only "POSIX-like" option I have configured in my login is When porting any software the first thing I do is check out what has been done for other platforms. Normally if the package is available on both Windows and a UNIX derivative there is enough of a cross-section to see what sort of things might need changing. Most Java packages are shipped with both a shell script and a batch procedure for running the software. Initially I tried using a DCL procedure to do the same thing. It seemed like the logical step to take. Unfortunately this didn't work out. While I don't specifically have a problem with DCL itself, it does have one rather large short-coming when attempting to write a procedure to start a Java application. The arguments, I use the $ mvn == "pipe def/u JAVA$DELETE_ALL_VERSIONS 1 ; " -
+ "def/u DECC$FILE_PERMISSION_UNIX 1 ; " - + "def/u JAVA$FORK_SUPPORT_CHDIR 1 ; " - + "def/u JAVA$FILENAME_CONTROLS 0 ; " - + "def/u DECC$ARGV_PARSE_STYLE ENABLE ; " - + "def/u DECC$EFS_CASE_PRESERVE ENABLE ; " - + "def/u DECC$EFS_CHARSET ENABLE ; " - + "java -classpath ""''classpath'"" ''f$trnlnm(""MAVEN_OPTS"")' " + "-Dclassworlds.conf=/m2_home/bin/m2.conf " - + "-Dmaven.home=/m2_home " - + """ org.codehaus.classworlds.Launcher""" The example above is the method I used for some time to get Java software started on OpenVMS. This method has two drawbacks. The first is that it requires the executing process to have its $ mvn == "spawn/nolog pipe set process/parse=extended ; " -
+ "@sys$manager:java$150_setup ; " - + "def JAVA$DELETE_ALL_VERSIONS 1 ; " - + "def DECC$FILE_PERMISSION_UNIX 1 ; " - + "def JAVA$FORK_SUPPORT_CHDIR 1 ; " - + "def JAVA$FILENAME_CONTROLS 0 ; " - + "def DECC$ARGV_PARSE_STYLE ENABLE ; " - + "def DECC$EFS_CASE_PRESERVE ENABLE ; " - + "def DECC$EFS_CHARSET ENABLE ; " - + "java -classpath ""''classpath'"" ''f$trnlnm(""MAVEN_OPTS"")' " - + "-Dclassworlds.conf=/m2_home/bin/m2.conf " - + "-Dmaven.home=/m2_home " - + """org.codehaus.classworlds.Launcher""" An advantage of using the $ cmd = "SPAWN/NOLOG PIPE SET PROCESS/PARSE_STYLE=EXTENDED ; " - [1]
+ "@<java-setup-procedure> ; " - [2] + "DEFINE <JAVA$-or-DECC$-logical> <value> ; " - [3] + "java <java-options-and-program>" [4]
It is important to remember that the above symbol works because of Extended DCL which is available on OpenVMS Alpha V7.3-2 and higher and all versions of OpenVMS I64. Prior to this DCL had the command line limit of 256 characters which would not allow this use of the PIPE command to work. Thankfully it is not really an issue as most Java software requires a recent version of OpenVMS and there is no Java for OpenVMS VAX. There are also no issues passing command line arguments as they tack right on to the end of the foreign command. Do also remember not to enclose the PIPE arguments in parentheses as any extra arguments will not be passed to the Java VM. The parentheses in a Something else you might notice in the example is the definition of JAVA$FILENAME_CONTROLS. I don't like many of the JAVA$* logicals, but this must be my least favourite. From what I can tell, this logical hails from a time when Java under OpenVMS ran on ODS-2 disks and UNX-style file names often needed a bit of extra munging. Fortunately, those days are over. I find it best to set this logical to 0 and use the DECC$* logicals to define how file names are handled. Otherwise a lot of unexpected transformations can occur to the file name before it is actually used. Maven on OpenVMSAt this time I am still working on the port. It is coming along exceptionally well. The following are a some of the more important tasks that have been acheived:
There is still much to be done, but a release of a largely working build system is imminent. To keep up to date with progress you can follow this blog (as you may already do) by signing up to the [RSS feed] as well as follow @tesneddon on Twitter for shorter, more frequent updates. |
As at: Sunday, 20 July 2025 17:21 Updated: Monday, 19 May 2014 11:41 (11 years ago) |