Skip to main content

All Questions

Tagged with
0 votes
1 answer
70 views

Java code with java.util.Scanner gets "[1]+ Stopped" when run with '&' (in background)

I wrote a program that supports interactive commands. I use java.util.Scanner for the input. This program is also allowed to be run in background and in this case the Scanner is not necessary. So I ...
Oopssss's user avatar
  • 65
0 votes
2 answers
173 views

Using string parameter in bash script failt

I need to create a few certificates and wanted to write a small bash script for this. First of all, I don't have much experience with creating my own bash scripts. I wanted to pass the most important ...
Husker's user avatar
  • 81
0 votes
0 answers
217 views

How to increase timeout limit of a specific job in kubernetes

I need to call an API via curl command inside a shell file which is taking more than 2min. to complete the entire process and bring back the status response. As a result, the pod gets into error state ...
Meenal's user avatar
  • 147
1 vote
1 answer
62 views

Recreating nohup.out

I'm a new to a Linux, I've encountered an issue. What I've done: i have created the shell script which runs jar file that inside have the System.out.println - prints. Then I ran the sh using: "...
Arnold Mr ARNOLD Charyyev's user avatar
2 votes
1 answer
111 views

new Line not recognized in shell script on Linux

I wrote a shell script on the Linux Ubuntu server. And I want to run a shell script on Java. Running the shell script inside the Linux server changes the way I wrote it, but not through Java. I'll ...
hannah's user avatar
  • 33
0 votes
2 answers
78 views

What is my java location and how can I point maven to it?

I am a UI dev with no experience in Java whatsoever. However, I have a dilema. > / % java --version openjdk 15.0.1 2020-10-20 OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.1+9) OpenJDK 64-...
paulalexandru's user avatar
0 votes
2 answers
531 views

How can I kill a just started Java process in shell script?

I have this simple script where I execute a .jar file and I'd need its PID for killing it after the sleep command: java -jar test.jar &> output.txt & pid=$! sleep 10 The problem is: the PID ...
e.tavecchio's user avatar
0 votes
2 answers
166 views

Docker image build fails to explode jar

I'm trying to create a multi-stage Dockerfile FROM openjdk:11.0.7-jre-slim-buster AS build ... additional commands RUN mkdir -p target/exploded && (cd target/exploded; jar -xf ../*.jar) But ...
Diego Nieto's user avatar
0 votes
1 answer
635 views

make javac compiler compile faster

I am trying to compile 5000+ java files (a lot of these Java files contains inner class). When I use this command mvn clean install -DskipTests It takes around 15-16 minutes. I am using Java 8 and ...
willy's user avatar
  • 255
0 votes
3 answers
1k views

Download multiple files from URL to a particular path in linux using curl command (Shell Script)

URL return list of files separated by comma example URL : http://sometimesdownload.com/list_of_files To get list of files curl -0 http://sometimesdownload.com/list_of_files Output of above curl ...
Kamal Chopra's user avatar
0 votes
4 answers
785 views

Get the Java version in specific format using bash

My Java version is: openjdk version "1.8.0_312" OpenJDK Runtime Environment (build 1.8.0_312-b07) OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode) How can I get the Java version in ...
user15566016's user avatar
0 votes
1 answer
611 views

Java installation using shellscript

I am new to shell scripting and I am looking for a way to install java 1.8 on centos machine such that if java 1.8 is already exists then script will skip the installation AND if any other version of ...
user15566016's user avatar
2 votes
1 answer
4k views

Check if an alias exist in keystore

I am new to shell scripting, I have a script that is used to import cert and import keystore using keytool. This script is inside a Pod, there are times when I have to restart my pod and sometimes ...
scoutjohn13's user avatar
1 vote
1 answer
2k views

Java Runtime.exec() works for some command but not others [duplicate]

I am doing an exercise related to Runtime.exec(), I understand that Runtime.exec is not a shell interpreter, that's why I execute "bash -c 'command'" instead, but for some reason, I can ...
catmandx's user avatar
  • 145
0 votes
2 answers
607 views

Runtime.exec("echo 2") gives error=13, but why?

I try to run commands using Java. This is the class: package test; import java.io.IOException; public class Test { public static void main(String[] args) throws IOException { Runtime....
Grim's user avatar
  • 2,058

15 30 50 per page
1
2 3 4 5
27