- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Running a Java program in the background
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 08:49 AM
тАО01-03-2011 08:49 AM
@sys$common:[java$60.com]java$60_setup.com
and then
java -jar MyProgram.jar
The problem of course is that the program only runs as long as the terminal window is open. I am not that familiar with OpenVMS, but from what I have read it would seem to fall under the realm of the SUBMIT command.
Basically I want to be able to run the "java -jar MyProgram.jar" in the background and keep it running forever. Also, the "java" command doesn't run without the environment command being run first. So what would I need to do in OpenVMS to accomplish say running this program at startup and keeping it running?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 09:24 AM
тАО01-03-2011 09:24 AM
Solution$@sys$common:[java$60.com]java$60_setup.com
$ java -jar MyProgram.jar
and then submit it from sys$manager:systartup_vms.com like
$ submit/noprint runmyjava
or
$ submit/noprint/user=me disk$user:[me]runmyjava
But be aware: the java program must not do any graphic (X11) operations, unless You create a presistent Xwindows display, and set the batch procedures display to it before starting the java program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 11:21 AM - last edited on тАО11-10-2011 02:14 PM by Kevin_Paul
тАО01-03-2011 11:21 AM - last edited on тАО11-10-2011 02:14 PM by Kevin_Paul
Re: Running a Java program in the background
Thanks Joseph,
I ended up doing almost exactly what you said. I found an old thread that showed me some similar stuff too (Thanks to Rick Retterer there as well). I created a .COM file which works great and am looking to just change it using a submit command instead of a run/detach command like I found in that thread.
http://h30499.www3.hp.com/t5/System-Management/start-a-process/m-p/4510831#M25351
I'm going to combine both of your suggestions. Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2011 07:35 AM
тАО01-07-2011 07:35 AM
Re: Running a Java program in the background
(I'm showing example in a generic format without document code)
made a myapp.com file, which actually executes my java program containing the following:
$ set NoOn
$ write sys$output "Java process starting..."
$ @sys%common:[java$60.com]java$60_setup.com
$! define java$classpath here if necessary
$! show log java$classpath
$ set def sys$common:[myappdir]
$ java -jar MyApp.jar
$ write sys$output "Java process exiting..."
$ exit
and then created a myapp_startup.com file to run the process as a batch process in the background: (which puts it in a batch queue i created)
$ Node_Name = F$GetSYI ( "NodeName" )
$ If F$Search ("sys$common:[myappdir]myapp.com" ) .nes. ""
$ Then
$ Log_file = "sys$common:[myappdir]''Node_Name'_myapp.log"
$ Submit/Notify/Noprint/Log="Log_File'/USER=SYSTEM -
/Queue='Node_Name'$Batch sys$common:[myappdir]myapp.com
$ EndIf
$ Exit
This runs my app in the background inside of a batch queue, which can be monitored by a show sys/b command