All Questions
47 questions
1
vote
3
answers
2k
views
Bash script to start java spring boot application from SSH
I have a simple bash script file, which is triggered from pipeline job ( via SSH ).
The deploy.sh contains more or less something like this:
cd /apps && java -jar "-Dspring.profiles....
1
vote
1
answer
2k
views
Refer another Java version in a systemd service file
I have an application which requires JAVA_HOME environment to be set for a successfull running. On the RHEL server, however the current version of java points to "openjdk version "1.8.0_302&...
0
votes
0
answers
23
views
My variable seems to change when passed into a CLI [duplicate]
I am attempting to use a java based program, CRFVoter, for text mining. I called and executed the script as specified.
[user]$ java -jar CRFVoter.jar
usage: CRFVoter GPRO
Command Line Tool for ...
1
vote
2
answers
10k
views
-bash:: /bin/bash: bad interpreter: Operation not permitted
I recently replaced adoptopenjdk-13 with adoptopenjdk-16. I have a script file that uses the tool by name, so I changed it from 13 to 16. Its new contents:
#!/bin/bash
if [ -z ${JAVA_OPTS+x} ]
then
...
-1
votes
2
answers
730
views
How to get all the contents of df -h command as string
I want to have a CRON job which calls a Java program to send a mail if disk space is more than 80%.
Along with it, I want to send the contents of the df -h command also. What I did was create a ...
0
votes
1
answer
161
views
CLASSPATH error while configuring JAVA Environment (Java Development Kit)
After installing JAVA(JDK) whenever I reboot the system or switch to normal user a message is displayed:
bash: ${AUTO_CLASSPATH_DIR}: invalid variable name
bash: ${AUTO_CLASSPATH_DIR}: invalid ...
0
votes
0
answers
109
views
command is not getting executed, if started by service
I have a java programm with an update function. This function simply starts the jar and then stops itself. If i start the programm manually to test the update function, it works just fine. But if i ...
6
votes
4
answers
26k
views
How to do HmacSHA256 using openSSL from terminal?
I need to perform the following Java snippet using OpenSSL from the command line:
private byte[] hmacSha256(byte[] key, byte[] payload) throws GeneralSecurityException {
Mac mac = Mac....
1
vote
1
answer
3k
views
-bash: ./java: Permission denied
I'm trying to run Java on my web server (that is only rented). I downloaded the JRE from java.com and unpacked it in a local folder in my home directory.
I changed the permissions of the bin/java ...
0
votes
2
answers
3k
views
Unable to build using Java OpenJDK 14. /bin/sh: javac: command not found
I've been tasked to work on updating a Java program that hasn't been touched for years and I'm running into issues building it using the latest version of Java OpenJDK 14.0.1.7-2 on Centos 7. When I ...
1
vote
1
answer
1k
views
Bash script to split logs based on file size
I'm working on a .bash script that kicks off a Java program, logs the sysouts to an 'outfile', then appends the log results for historical purposes to a 'archive' zip. My current script is like below.....
6
votes
2
answers
14k
views
setting JAVA_HOME and PATH with update-alternatives
EDITED
The question was more about bash script them java environment and thanks for those whom had the patience and spare the time to reply me. I am much obliged.
As for the Java environment I started ...
0
votes
1
answer
749
views
bash file contain executable/binary code
I found this tool and when I downloaded it is a bash executable that contains binary code.
First of all I didn't know this is possible. Does anyone know who this can be done? Also I am not sure how ...
1
vote
1
answer
599
views
Why does my bash terminal startup run the same set of commands twice?
I'm on a Mac and whenever I start up my terminal app the initial startup prints the following:
Picked up _JAVA_OPTIONS: -XX:MaxPermSize=4G -Xmx4G
Java HotSpot(TM) 64-Bit Server VM warning: ignoring ...
1
vote
2
answers
3k
views
Java major version check in bash script
I've just installed Kafka following tutorial. It doesn't start because of sh script error:
$ sudo kafka-server-start.sh /etc/kafka.properties
/opt/Kafka/kafka_2.12-1.1.0/bin/kafka-run-class.sh: line ...