can .bat windows file can be configured on control-M - java

I have the java program which will be triggered from windows .bat file (having call to java program and requires JRE 1.6 on the client machine(calling machine) to run the java program.
Is that possible to configure this job on control-M? I am not sure how the control- M configuration of a job will be done, hence wanted to know if we will be able to install JRE 1.6 or above on the Control-M machine and is possible to run the .bat file from control-M.

Yes, It's possible to run a bat from Control-M and get the return code to stablish the ending state of the Job.
Complete information about how it works in the BMC Control-M Manual: http://www.scheduler-usage.com/document/Version/630/Books/MAW620300AG52365.pdf
JRE Must be installed in the machine before to work with good performance and with a correct environment.
You probably can check if JRE 1.6 is installed in the bat and install it but it's a complicated process with probably thirdparty tools and use of silent JRE install. Not recommended, it's better to have JRE installed as requirement to run the job.

Related

Install automatically Java 8 on Windows Server AMI

I am starting a Windows Server AMI and would need to have java 8 installed after boot. I already have an instance-setup.txt script to install the codedeploy-agent automatically (from here: http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-set-up-new-instance.html), but would need to install Java 8 at the same time. I have no idea how to automatize this though, did anyone manage to do it successfully by any chance ?
Thanks !
Emmanuel
The Java installers for Windows provide the ability to run an installation in silent mode via the command line or a script. If you package a Java installation executable with your deployment you can run a silent install like this:
jre-8-windows-i586.exe /s
Check out the documentation on Windows Installer Options for Java for more information and other available options: http://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_installer_options.html

GCJ: Java native code, won't run on other machines

I tried GCJ and it compiled fine. I tried both for Ubuntu and windows. The compiled file is running on my Ubuntu machine as well the .exe with wine. But if I tried to run in on my Ubuntu server I got this error:
error while loading shared libraries: libgcj.so.14: cannot open shared object file: No such file or directory
But I thought I would not need to install anything to run "native" code. I also could not run the .exe on a windows machine.
Could you please tell me why this is happening? Maybe I'm compiling wrong. I use this: gcj --main=Hello -o hello.exe Hello.jar for windows.
When you run an executable it is very common to need a shared library, whether you use Visual Studio .NET or Java or C++.
When you compile a program for a specific platform, it usually only works on that platform or similar. If you want to run this program on Windows, you need to compile it for windows.
BTW GCJ is pretty old and out of date. I suggest you use Java 7 or 8. This will avoid the need to install additional libraries and will run on Windows or Linux without re-compiling.

Make jar run in 32bit jre

How can I specify that in order to run a certain java application that I created you need to have 32 bit JRE installed on your system? Further how can I specify that the java application is to use the 32 bit JRE and not the 64 bit JRE if they are both installed?
Background:
I have created an application that uses a 3rd party 32 bit only library. The application can not run in a 64 bit JRE.
I am going to be distributing this application to a lot of computers in my company, so I need to be able to in code or in the export process, specify the required JRE.
I am using eclipse, Kepler to develop and build the java application.
The idea of java is always compile once and run everywhere, regardless of OS, cpu architecture etc, so you might be heading the wrong direction here.
But nevertheless here are some system properties you might / not find helpful. I've listed the property key and value I have when I check it (I run Oracle JDK on Win7 64)
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
sun.arch.data.model: 64
sun.cpu.isalist: amd64
To use any of those just do
String vmname = System.getProperty("java.vm.name");
You can't do it directly in Java, since you're in a running JVM at that point. My solution was to write a dos batch script to set the JAVA_HOME and add %JAVA_HOME%\bin at the front of the PATH. For example, I have sethome.bat which contains
#echo off
set "JAVA_HOME=c:\Program Files (x86)\Java\jre6"
set "PATH=%JAVA_HOME%\bin;%PATH%"
Then I use
call "%SERVICE_HOME%\sethome"
"%JAVA_HOME%\bin\java" -version
echo If this does not look correct press CTRL-C to cancel otherwise
pause
You cannot generally make sure what program runs your jar. I can pass the jar to acroread, or zip or whatever, and you can't do anything about it.
So, I'd just try to load the library, and do a proper error/exception handling. Who knows? Maybe your client has meanwhile replaced that library with a 64bit version, without you knowing about it? SO, this: loading, and if it won't aborting with a graceful eror message is the only sensible thing.

Installing JDK from self extracting bin on Cygwin

I want to install the JDK in cygwin on my windows machine. I am downloading the linux version of JDK from oracle site using wget command. Here is the list of commands I am running to install JDK:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64.rpm.bin
chmod a+x jdk-6u31-linux-x64.rpm.bin
./jdk-6u31-linux-x64.rpm.bin
All these instructions are same as suggested by Oracle for installing JDK over here but I am getting the following errors:
Firstly, those messages indicate that what you are trying to execute is an HTML document! In other words, the download has failed and given you an error page rather than an installer.
However, assuming that you succeed in downloading the (Linux) installer, it is unlikely that it will install properly, and there is about ZERO chance that the installed tools will run. Applications that have been compiled for Linux don't run on Cygwin.
What you need to do is to download and install the JDK for Windows, and then tweak your cygwin profile a bit. This page explains: http://horstmann.com/articles/cygwin-tips.html.
(If you Google for "java cygwin" there are various other tips for making Java work from Cygwin. However, in my experience there are a few rough edges ... due to the fact that the Windows Java utilities expect to have been called with windows-style arguments, pathnames, classpaths, etcetera.)

Check whether cygwin is installed & install if needed

I am trying to run shell scripts in Windows XP using Java. I found that we can run shell scripts using cygwin in Windows, but what if it is not installed on the system?
I want to check whether it is installed on machine, if it is not installed - add that software as a part of my application and install it.
If cygwin complains with windows installer standards then when you install it you should be able to find a registry entry for this program.
You should check the registry for something like localmachine/software/cygwin.... this validation can be done using RegistryKey class in c#.
To include this program as a dependency you must provide the way you are installing your app, visual studio windows installer? Inno installer?

Categories