Installing Apache tomcat using bash script using Java - java

Hi I'm planning to devolep a APP that will install install programs using bash commands Ie to install tomcat
apt-get install tomcat7
Is it possible to achieve it programmatically using Java

Use Runtime.exec() method to run external command. For more refer: http://www.tutorialspoint.com/java/lang/runtime_exec.htm

Related

How to install Git on the standard openjdk docker image?

Recently started upgrading my app from JDK 8 to 17.
My build infrastructure uses docker containers. Previously, I was using openjdk:8u322-jdk. So I bumped the docker image to openjdk:17.0.2-jdk, but things've changed drastically.
There's no Git installed by default now, I think the underlying OS has changed and the default CMD is "jshell", whatever that is o_O
I don't want to spend time faffing about creating my own docker image with the needed tools installed.
At the end of the day, I just need to run two commands on the build container: git clone and gradlew.
What do I need to run to get Git installed so I can run a git clone and gradlew?
microdnf install git to install git.
Need to execute bash explicitly if you want to connect and run commands.

How do I build and run a Java Swing application on a Chromebook?

What steps are needed to build and test a Java Swing application on a chromebook using Crostini?
The following steps allowed me to build and run a Java Swing app from a chromebook.
After enabling Linux on my chromebook, I ran the following commands in a terminal to install java, maven, and an X11 server.
sudo apt install x11-apps
sudo apt-get install openjdk-8-jdk
sudo apt install maven

How to launch ios_webkit_debug_proxy using java code

I am able to run Appium server from Java code. But wanted to know how can I
check if iPhone is connected to a Mac and if connected, then launch ios_webkit_debug_proxy using Java code
Any pointer or suggestion would be highly appreciated.
If you havn't installed ios-webkit-debug-proxy install it via homebrew by executing below commands
brew install ideviceinstaller ios-webkit-debug-proxy
Once installed you can start it by using Java Process builder and execute it.
Sample here

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

java install tomcat as service

I'm planning to develop an application installer which, as a part of installation, installs Apache Tomcat on Linux. Does anyone know how can I programmatically install Tomcat as service on Linux.
Best
If you have Tomcat installed already, you probably need to put a start up script for Tomcat in /etc/init.d
This article has a decent start up script.
http://www.howtogeek.com/howto/linux/installing-tomcat-6-on-ubuntu/
Tomcat7 (Stable release 2011 January) For Debian-base: Tested in Ubuntu 14.04.
Install Tomcat7:
sudo apt-get install tomcat7 tomcat7-docs tomcat7-admin
sudo apt-get install libtomcat7-java tomcat7-common tomcat7-examples
Start the tomcat server:
sudo service tomcat7 restart
Check whether the the tomcat is running or not by access the URL http:/127.0.0.1:8080 in browser or in terminal:
w3m http://127.0.0.1:8080
More...
If you are on a debian-base distribution, just type
sudo apt-get install tomcat6 tomcat6-admin tomcat6-examples
and you'll have a tomcat fully functional (example for Ubuntu 10.04)

Categories