All Questions
399 questions
0
votes
2
answers
67
views
Running a java application via a systemd service doesn't see additional directories (Rocky Linux)
I am trying to make a local machine restart to the new version control build of my java application. Let me run you through the flow:
.jar file is uploaded via ssh to a directory
a service is running ...
-1
votes
1
answer
74
views
Passing commands to a running app from command-line [closed]
I have a Java-app (Spring Boot) that is running permanently.
I need to pass arguments and commands to it - not directly at startup but during lifetime.
E.g. empty logs or reopen database
I like to do ...
-2
votes
1
answer
168
views
Is there an alternative way to run succesfully a .java program without commenting the package name line?
I created a simple java program on netbeans and it working just fine when I execute it within the Netbeans IDE. However, this is the issue I'm dealing with:
I'm getting this error when running the ...
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 ...
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-...
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 ...
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 ...
0
votes
0
answers
25
views
Different behavior on Running Unix Commands from Java on GitBash Windows and Linux
I am trying to run some Unix commands by using Java on both Windows GitBash and Linux bash (AWS EC2 instance).
Code is here Open git bash using ProcessBuilder and execute command in it
However, the ...
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 ...
-2
votes
1
answer
219
views
Calling static jave method from .sh file
I have a jar files that holds a lot of classes, in each class there are static methods that I have to call from a shell script.
I have a function class for each module, this class aggregates all the ...
0
votes
1
answer
69
views
Running command in linux environment fails
I am trying to execute a command via Runtime.getRuntime().exec().
When i run the following command in my linux bash it works fine.
Command: bash -c "npm -v"
But when i try to run it with ...
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 ...
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 ...
0
votes
0
answers
18
views
JAVA_HOME is empty and PATH is default inside the screen/script [duplicate]
I installed java 18 using this tutorial: https://computingforgeeks.com/install-oracle-java-18-on-ubuntu-debian/
Scripts (.sh) running at reboot from crontab doesn't have any JAVA_HOME and default PATH ...
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 ...