Skip to content

Tag: linux

File.exists doesn’t find the file in /usr/sbin folder

I have a very strange problem, I have a code that check if the gluster cli tool is installed, on a Manjaro distribution it works. But the problem is that this code will return false on my Gentoo : ls -ailh /usr/sbin/gluster 17555959 -rwxr-xr-x 1 root root 454K 1 avril 16:02 /usr/sbin/gluster I tried to find another way to find

How does java guarateee reserved memory

Checking for memory usage by stack using this command: I can see that reserved memory is different from committed. Reserved is about 1MB (default for stack). Committed in fact is physical reserved. I read that java save memory for stack while is not totally used. Running command like top I can see just committed usage. What does java/SO do in

Program to find from where the program is called

The requirement is very simple, I want to write a simple hello world program or anything so the program knows about its execution parent. For eg. Since I am from a Java background I will give a Java example. I want to write a jar that runs and outputs the following: Running from command line: but when running from

Unable to get PATH to be set for all users

Trying to get OpenJDK 17 installed for Pufferpanel. User pi can do java -version fine however Pufferpanel gets bash: java: command not found My /etc/profile and /etc/profile.d/ have these lines: In addition JAVA_HOME=”/usr/lib/jvm/jdk-17.0.1+12″ is set in /etc/environment Full permissions have been given for and the JAVA_HOME folder with chmod 777. The user pufferpanel now can run the script however

Installing jenkins on Linux Mint 20.2

I’ve Linux Mint 20.2 Cinnamon and I tried to install jenkins. Detailed steps for installation is as below: 1. Installing java – installed via apt I’ve also added JAVA_HOME in ~/.zshrc which gives: 2. Installing jenkins I’ve tried with different versions of java, yet the same error. What am I doing wrong? Related solutions that I tried, but failed: [1],

Why after that I quit a Spring Boot application in a Linux shell (by CTRL+Z) a process still listen on the 8080 port? (the port used by my application

I am working on a Spring Boot application running it on a Linux machine. It is a batch application containing Spring Boot Admin tool listening on the 8080 port. I have the following “problem”: I run it into my shell for the first time using this command: it correctly start and I can access to the Spring Boot Admin tool

JDK11 getFreeSpace and getTotalSpace from File is not matching df

I am seeing df -h giving output like below But if I do the same from java like below It is printing like below Can someone let me know why is this discrepancy in disk utilization? Environment Ubuntu 18.04 Java – Zulu OpenJDK 11.0.11 Answer As I also mentioned in the comments, the primary reason is that getFreeSpace seems to

Install Java 16 on Raspberry Pi 4

I have tried multiple releases from here using : But after java -version I always get: Which means I have chosen the wrong release/architecture. Is there a release that works with Raspberry Pi’s or is there another way to install Java 16? Answer Answering my own question. cd [minecraft directory here] wget tar xzf OpenJDK16U-jdk_arm_linux_hotspot_2021-05-08-12-45.tar.gz export PATH=$PWD/jdk-16.0.1+4/bin:$PATH java -version