Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
1 answers
37 views
VM with Rocky Linux OS going down after every two weeks
We were running a set of Java processes on an RHEL box. There was one or two particular services that used to go down due to OOM killer after every 2-3 weeks. We used to get alerts, and it was restarted. Recently we switched to the Rocky Linux 9.5 version. Now once every two weeks the whole VM is go...
We were running a set of Java processes on an RHEL box. There was one or two particular services that used to go down due to OOM killer after every 2-3 weeks. We used to get alerts, and it was restarted. Recently we switched to the Rocky Linux 9.5 version. Now once every two weeks the whole VM is going down. RSS memory used by the same set of processes is going up very rapidly, and after 2 weeks, the VM crashes. We enabled NativeMemoryTracking=detail but could not find the reason for why RSS is going so high. We have seen heap usage by Java processes is within the Xmx value, and the processes never crashed due to OutOfMemoryError. I can give more details if required. I wanted to ask if I can tune some kernel parameters so that RSS is within limits and/or the machine should not crash. My issue is the same as the bug reported below. https://bugs.java.com/bugdatabase/view_bug?bug_id=8188130 In my case in the NMT log, I can see thread memory allocation is increasing rapidly, and after 10 hours of running the application, it grows to 12 GB. I am using openjdk. openjdk version "1.8.0_402" OpenJDK Runtime Environment (Zulu 8.76.0.18-SA-linux64) (build 1.8.0_402-b06) OpenJDK 64-Bit Server VM (Zulu 8.76.0.18-SA-linux64) (build 25.402-b06, mixed mode)
Navneet Mishra (21 rep)
Jul 30, 2025, 09:46 AM • Last activity: Jul 31, 2025, 10:49 PM
0 votes
1 answers
3390 views
How to schedule to run testng.xml file on terminal on linux environment?
I have scripted a Selenium automation testcase. I have generated the testng.xml file which should be executed on the linux terminal at a particular time of my need. Say I want to schdule to execute the testng.xml file on terminal at 11pm everyday.
I have scripted a Selenium automation testcase. I have generated the testng.xml file which should be executed on the linux terminal at a particular time of my need. Say I want to schdule to execute the testng.xml file on terminal at 11pm everyday.
Kasturi Rajamanikkam (1 rep)
Nov 16, 2018, 08:49 AM • Last activity: Jul 25, 2025, 06:06 AM
3 votes
2 answers
8820 views
Java 21 binaries fail to execute on Raspberry Pi OS 64-bit (aarch64)
I'm not able to install Java 21 on Raspberry Pi 5. I downloaded ARM versions from OpenJDK and Oracle, but neither works for me. When typing `./java`, it prints: `No such file or directory` (*I'm sure I'm in the right directory.*) I cannot find any repository I can use to install Java 21, and I need...
I'm not able to install Java 21 on Raspberry Pi 5. I downloaded ARM versions from OpenJDK and Oracle, but neither works for me. When typing ./java, it prints: No such file or directory (*I'm sure I'm in the right directory.*) I cannot find any repository I can use to install Java 21, and I need a newer version of Java than 17 for my projects written in Java 21. file ./java output:
./java: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV),
dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for
GNU/Linux 3.7.0, not stripped
ldd ./java output:
java: not a dynamic executable
Do you have any idea how I can install Java 21 on Raspberry Pi 5? How to reproduce: * **OpenJDK**: From the website ([https://jdk.java.net/21/](https://jdk.java.net/21/)) I downloaded the version for Linux / AArch64, unpacked it, and tried to run the java executable from the unpacked bin directory using the java command inside that directory. * **Oracle JDK**: I downloaded it from the website ([https://www.oracle.com/pl/java/technologies/downloads/](https://www.oracle.com/pl/java/technologies/downloads/)) , version for ARM64 Compressed Archive, and did exactly as with the OpenJDK version. The distribution is the default for Raspberry Pi 5: Raspberry Pi OS 64-bit (based on Debian). Output for find / -name java -type f -exec ls -l {} \; 2>/dev/null:
bloodlex@raspberrypi:~/Download/jdk-21.0.1/bin $ find / -name java -type f -exec ls -l {} \; 2>/dev/null
-rwxr-xr-x 1 bloodlex bloodlex 70792 10-05 15:44 /home/bloodlex/Download/jdk-21.0.1/bin/java
Output for file /bin/ls:
bloodlex@raspberrypi:~/Download/jdk-21.0.1/bin $ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3,
BuildID[sha1]=73a3ba02d9f4bf3632cbebe139c6a844ca5076d3, for GNU/Linux 3.2.0, stripped
Output for uname -a:
bloodlex@raspberrypi:~/Download/jdk-21.0.1/bin $ uname -a
Linux raspberrypi 6.1.0-rpi6-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.58-1+rpt2 (2023-10-27) aarch64 GNU/Linux
Bloodlex (131 rep)
Nov 27, 2023, 02:37 PM • Last activity: Jul 22, 2025, 06:04 PM
5 votes
1 answers
2656 views
Java SDK on NixOS for IntelliJ
I have recently installed NixOS on my machine, for Java development I have added IntelliJ CE 14.1.5 and the Oracle JDK 8. However IntelliJ does not automatically recognize the path to the Java SDK readlink -f $(which java) /nix/store/...-oraclejdk-8u60/bin/java when selecting /bin/ in the "Select Ho...
I have recently installed NixOS on my machine, for Java development I have added IntelliJ CE 14.1.5 and the Oracle JDK 8. However IntelliJ does not automatically recognize the path to the Java SDK readlink -f $(which java) /nix/store/...-oraclejdk-8u60/bin/java when selecting /bin/ in the "Select Home Directory for JDK" it does not accept it. I have been searching around for some time now but I can't really find the right stuff to get it working. Any help is appreciated.
user138984 (51 rep)
Oct 17, 2015, 05:54 PM • Last activity: Jul 19, 2025, 10:04 AM
3 votes
1 answers
3568 views
Setting classpath for Java
I was trying to use a tool a tool written in java called "fastqc" (for people who are interested in [what is fastqc][1]. when I tried typing the command :" fastqc" I got the error: Exception in thread "main" java.lang.NoClassDefFoundError: uk/ac/babraham/FastQC/FastQCApplication Caused by: java.lang...
I was trying to use a tool a tool written in java called "fastqc" (for people who are interested in what is fastqc . when I tried typing the command :" fastqc" I got the error: Exception in thread "main" java.lang.NoClassDefFoundError: uk/ac/babraham/FastQC/FastQCApplication Caused by: java.lang.ClassNotFoundException: uk.ac.babraham.FastQC.FastQCApplication at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) when someone had similar previously,some one suggested that in similar case, I need to set the class path to the directory which contains FastQC installation : and depending on having a standard class path or non-standard classpath on my machine, I need to append existing classpath like: java -Xmx250m -classpath /usr/local/FastQC uk.ac.bbsrc.babraham.FastQC.FastQCApplication or java -Xmx250m -classpath /usr/local/FastQC:$CLASSPATH uk.ac.bbsrc.babraham.FastQC.FastQCApplication Since my directory which contains the FastQC is /u32/myusername/Tool/FastQC so I tried both: java -Xmx250m -classpath /u32/myusername/Tool/FastQC uk.ac.bbsrc.babraham.FastQC.FastQCApplication and java -Xmx250m -classpath /u32/myusername/Tool/FastQC:$CLASSPATH uk.ac.bbsrc.babraham.FastQC.FastQCApplication but none of them seemed to work. Did I mess something up? I am not sure about what -Xmx250m means, with or without it, the path setting did not work. Sorry for my ignorance. Any idea or suggestion appreciated.
Jun (541 rep)
Aug 6, 2016, 08:02 AM • Last activity: Jul 12, 2025, 10:06 PM
0 votes
1 answers
4272 views
Error: could not open `user_jvm_args.txt`
This is my first time making a bash script into a service and I'm running into an error where the service fails because it can't open a text file that is used for java arguments (user_jvm_args.txt). I assume there's some sort of permissions issue going on, but I'm at a loss. Anything helps as I'm tr...
This is my first time making a bash script into a service and I'm running into an error where the service fails because it can't open a text file that is used for java arguments (user_jvm_args.txt). I assume there's some sort of permissions issue going on, but I'm at a loss. Anything helps as I'm trying to get better and learn. Thanks! Here's the service file:
[Service]
ExecStart=/home/ethan/ATM9-Server/run.sh
Here's the run.sh bash script:
#!/usr/bin/env sh

java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.1.3/unix_args.txt "$@"
Here's the user_jvm_args.txt file that is in the same folder as the run.sh script:
# Xmx and Xms set the maximum and minimum RAM usage, respectively.
# They can take any number, followed by an M or a G.
# M means Megabyte, G means Gigabyte.
# For example, to set the maximum to 3GB: -Xmx3G
# To set the minimum to 2.5GB: -Xms2500M
# A good default for a modded server is 4GB.

-Xms1G
-Xmx10G
-XX:+UseG1GC
-XX:+ParallelRefProcEnabled
-XX:MaxGCPauseMillis=200
-XX:+UnlockExperimentalVMOptions
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-XX:G1NewSizePercent=30
-XX:G1MaxNewSizePercent=40
-XX:G1HeapRegionSize=8M
-XX:G1ReservePercent=20
-XX:G1HeapWastePercent=5
-XX:G1MixedGCCountTarget=4
-XX:InitiatingHeapOccupancyPercent=15
-XX:G1MixedGCLiveThresholdPercent=90
-XX:G1RSetUpdatingPauseTimePercent=5
-XX:SurvivorRatio=32
-XX:+PerfDisableSharedMem
-XX:MaxTenuringThreshold=1
Most of those are defaults, and the only ones I changed were -Xms and -Xmx. Here's the that error occurs as it shows in the logs:
Nov 03 15:44:43 ATM9-Server-Temp systemd: Started run.service.
Nov 03 15:44:43 ATM9-Server-Temp run.sh: Error: could not open `user_jvm_args.txt'
Nov 03 15:44:43 ATM9-Server-Temp systemd: run.service: Main process exited, code=exited, status=1/FAILURE
Nov 03 15:44:43 ATM9-Server-Temp systemd: run.service: Failed with result 'exit-code'.
EChumley1310 (1 rep)
Nov 3, 2023, 09:04 PM • Last activity: Jun 30, 2025, 10:04 AM
2 votes
3 answers
5712 views
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] while running spoon.sh in ubuntu
When I am running `spoon.sh` file in Ubuntu I am getting the following error: [santosh@sbx data-integration]$ ./spoon.sh /home/decathlon/Pentaho-5.0.1/data-integration org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt....
When I am running spoon.sh file in Ubuntu I am getting the following error: [santosh@sbx data-integration]$ ./spoon.sh /home/decathlon/Pentaho-5.0.1/data-integration org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source) at org.eclipse.swt.widgets.Display.create(Unknown Source) at org.eclipse.swt.graphics.Device.(Unknown Source) at org.eclipse.swt.widgets.Display.(Unknown Source) at org.eclipse.swt.widgets.Display.(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:582) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134) Could anyone please help me in resolving the same?
Santosh (21 rep)
Jul 1, 2014, 07:23 AM • Last activity: Jun 26, 2025, 07:06 PM
0 votes
1 answers
2210 views
Everytime I try run anything Android studio related Java-related errors show up
for example when I run sdkmanager this error displays: ``` Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema at com.android.repository.api.SchemaModule$SchemaModuleVersion. (SchemaModule.java:156) at com.android.repository.api.SchemaModule. (SchemaModule....
for example when I run sdkmanager this error displays:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
	at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
	at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
	at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
	at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
	at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 5 more
and If I want to run any flutter code on my android device this error occur:
Launching lib/main.dart on VOG L29 in debug mode...
Checking the license for package Android SDK Build-Tools 30.0.3 in /opt/android-sdk/licenses
Warning: License for package Android SDK Build-Tools 30.0.3 not accepted.
Checking the license for package Android SDK Platform 31 in /opt/android-sdk/licenses
Warning: License for package Android SDK Platform 31 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-31 Android SDK Platform 31
     build-tools;30.0.3 Android SDK Build-Tools 30.0.3
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html 

  Using Android SDK: /opt/android-sdk

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org 

BUILD FAILED in 17s
Running Gradle task 'assembleDebug'...                             18.1s
Exception: Gradle task assembleDebug failed with exit code 1
I also tried fixing the errors by acpeting licences but that also wouldn't work.
Xichao (1 rep)
Jan 25, 2023, 08:31 PM • Last activity: Jun 25, 2025, 11:08 PM
0 votes
1 answers
5782 views
JAVA OPTS Xms Xmx MetaspaceSize MaxMetaspaceSize relationship with server resources
I have just started working with jboss application servers and recently we had a problem when trying to deploy an application in a new test server (RHEL 7), it happened that, when starting the jboss service (jboss eap 7.1) with the application in the deployment area, the server began to freeze, that...
I have just started working with jboss application servers and recently we had a problem when trying to deploy an application in a new test server (RHEL 7), it happened that, when starting the jboss service (jboss eap 7.1) with the application in the deployment area, the server began to freeze, that is, it began to respond extremely slowly and it was necessary to turn it off, we solved the problem simply by adding more cpu and ram, in the configuration (standalone.conf) there are these parameters: JAVA_OPTS="-Xms4096m -Xmx4096m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m Could you give me a brief explanation of the meaning of each one and its relationship with the memory and cpu of the server? Is there any rule or recommendation to take into account to configure these parameters and server resources? Thanks in advance.
miguel ramires (9 rep)
Jul 11, 2022, 11:01 PM • Last activity: Jun 11, 2025, 04:05 PM
1 votes
2 answers
2311 views
How do I run Jenkins with a specific working directory and a specific user account?
I am executing below jenkins.war with below command jenkins -jar jenkins.war But I want to specify to use below path while executing the war `/data/jenkins` and it should run as `jenkins` user . Right now it is getting executed as `root` user and under `/root` directory How can I achieve that ?
I am executing below jenkins.war with below command jenkins -jar jenkins.war But I want to specify to use below path while executing the war /data/jenkins and it should run as jenkins user . Right now it is getting executed as root user and under /root directory How can I achieve that ?
Zama Ques (3376 rep)
Mar 19, 2019, 03:13 AM • Last activity: May 15, 2025, 04:01 AM
0 votes
2 answers
1927 views
Java programs not running in terminal
I have java 8 installed on fedora 20. Any java program runs perfectly fine via eclipse but when I run the same program on terminal it reports an error saying 'could not load main class' . what could be the problem? I wrote a simple helloworld program named hello.java and executed on eclipse. Then I...
I have java 8 installed on fedora 20. Any java program runs perfectly fine via eclipse but when I run the same program on terminal it reports an error saying 'could not load main class' . what could be the problem? I wrote a simple helloworld program named hello.java and executed on eclipse. Then I opened terminal and moved to the folder containing the hello.class in eclipse workspace and typed ' java hello '. But it said 'error:could not load main class'. Also as I said I have installed and I use oracle java 8.
Aditya Gupta (1 rep)
Jun 29, 2015, 07:29 AM • Last activity: May 10, 2025, 11:08 AM
0 votes
1 answers
3967 views
CentOS 6.6; java 7: libjli.so cannot be found
**Background:** I have written a Java program to capture network packets. The code uses a wrapper API around `libpcap` and works nicely – as long as I run the program via **sudo**. I am now trying to figure out how to set up things so that I can run the program as a "regular" user. Ultimately, it wi...
**Background:** I have written a Java program to capture network packets. The code uses a wrapper API around libpcap and works nicely – as long as I run the program via **sudo**. I am now trying to figure out how to set up things so that I can run the program as a "regular" user. Ultimately, it will be run on a system where I **do not** have sudo privilege. After some investigation, a possible solution has been found that involves setting capabilities that provide privileged access in a specific way. Part of this involves setting the capabilities CAP_NET_RAW and CAP_NET_ADMIN to ei (e.g., sudo setcap 'CAP_NET_RAW=ei CAP_NET_ADMIN=ei' program). **The Problem:** So, I have done this for the java command on my system. Unfortunately, this has created a problem (which has been asked about by many in various forums) where, when java is invoked, the following message is displayed: >java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory This library does indeed exist and shows up in the list of libraries for the java command.
$ sudo find / -name libjli.so -print
/opt/jdk1.7.0_79/lib/amd64/jli/libjli.so
/opt/jdk1.7.0_79/jre/lib/amd64/jli/libjli.so
/usr/java/jdk1.7.0_79/lib/amd64/jli/libjli.so
/usr/java/jdk1.7.0_79/jre/lib/amd64/jli/libjli.so
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.35.x86_64/lib/amd64/jli/libjli.so
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.35.x86_64/jre/lib/amd64/jli/libjli.so
$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Jun 22  2015 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 25 Jun 22  2015 /etc/alternatives/java -> /opt/jdk1.7.0_79/bin/java
$ ls -l /opt/jdk1.7.0_79/bin/java
-rwxr-xr-x. 1 uucp 143 7718 Apr 10  2015 /opt/jdk1.7.0_79/bin/java
$ ldd /usr/bin/java
	linux-vdso.so.1 =>  (0x00007fff3f3fa000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003150c00000)
	libjli.so => /usr/java/jdk1.7.0_79/lib/amd64/jli/libjli.so (0x00007ff56d563000)
	libdl.so.2 => /lib64/libdl.so.2 (0x0000003151000000)
	libc.so.6 => /lib64/libc.so.6 (0x0000003150800000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003150400000)
BTW, I am using the Java 7 JDK, not the OpenJDK. So, what's wrong here? Everything seems to be in place, yet it can't find what it needs. Does the fact that there are two versions of Java on the machine have anything to do it? Is there some other weird situation? Based on my searches, this problem has been encountered by many, but I couldn't seem to find a reason, nor a solution. Can anyone help with this? **UPDATE #1** Well, after a little more investigating, it appears that the problem is due to a "feature" in Java. The link below includes another link that gets to heart of the matter. Problem to launch java at Debian: “error while loading shared libraries: libjli.so” with the embedded link Why setuid java programs don't work . Based upon what I read in these, it would seem that running java with specific capabilities enabled is not allowed. Perhaps that will change at some point, with an improvement to Java security. If anyone knows about this, or more importantly, knows that a solution has been provided, please comment.
Joseph Gagnon (101 rep)
May 17, 2018, 02:10 PM • Last activity: May 7, 2025, 12:02 PM
1 votes
1 answers
3018 views
What types of threads does Java/JVM use from Linux OS's perspective?
A developer friend of mine recently asked the question: On a Linux system when a Java application runs which has threads, how do these threads appear to the underlying Linux OS? So what are Java threads?
A developer friend of mine recently asked the question: On a Linux system when a Java application runs which has threads, how do these threads appear to the underlying Linux OS? So what are Java threads?
slm (378955 rep)
Oct 26, 2019, 04:03 AM • Last activity: May 6, 2025, 04:03 PM
1 votes
2 answers
26621 views
How to fix Picked up _JAVA_OPTIONS: no options listed on Linux?
This issues is on Manjaro Deepin 15.9 linux DE. When I run java -version in terminal it outputs this: Picked up _JAVA_OPTIONS: java version "11.0.2" 2019-01-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode) But if...
This issues is on Manjaro Deepin 15.9 linux DE. When I run java -version in terminal it outputs this: Picked up _JAVA_OPTIONS: java version "11.0.2" 2019-01-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode) But if the command is run with sudo it outputs it normal **without** the Picked up _JAVA_OPTIONS: message ! I managed by placing unset JAVA_OPTIONS in /etc/environment , /etc/profile and ~.bashrc to remove the message from terminal. But the message still shows up in Netbeans when I run a project. Also I run Netbeans as sudo just to check will it show then and it didn’t. I tried removing some software from Linux which I didn’t need or believe made it was causing the message (because I read the few posts about software being an issue), but nothing changed. Message not showing in sudo makes me believe maybe root user doesn’t have something installed that normal user has which is producing this message. This message is visible in live preview of Manjaro Deepin on bootable usb!
J.DoeDoeJ (11 rep)
Jan 19, 2019, 03:47 PM • Last activity: May 4, 2025, 02:08 PM
0 votes
2 answers
2082 views
How to redirect Java thread dumps from "kill -3" to a custom file instead of "catalina.out"
I used to take thread dumps using: ``` kill -3 `pidof java` ``` This creates thread dumps in `catalina.out`. How can I get that output into a different file instead of `catalina.out`? Usually, the `kill` command doesn’t output to stdout or stderr, so we can't capture it by redirecting script output...
I used to take thread dumps using:
kill -3 pidof java
This creates thread dumps in catalina.out. How can I get that output into a different file instead of catalina.out? Usually, the kill command doesn’t output to stdout or stderr, so we can't capture it by redirecting script output or using exec at the beginning. Is there any way to do this?
SAGAR Nair (317 rep)
Dec 12, 2018, 10:56 PM • Last activity: Apr 29, 2025, 03:11 PM
0 votes
1 answers
2357 views
attach to tty running a process
I have a systemd service file that runs a java program in another tty [Unit] Description=java program After=network-online.target [Service] Type=simple ExecStart=/usr/bin/java -cp "/home/user/someclass.jar" Restart=always RestartSec=10 StandardInput=tty-force StandardOutput=inherit StandardError=inh...
I have a systemd service file that runs a java program in another tty [Unit] Description=java program After=network-online.target [Service] Type=simple ExecStart=/usr/bin/java -cp "/home/user/someclass.jar" Restart=always RestartSec=10 StandardInput=tty-force StandardOutput=inherit StandardError=inherit TTYPath=/dev/tty10 TTYVTDisallocate=yes TTYReset=yes TTYVHangup=yes [Install] WantedBy=multi-user.target The program waits for input in the tty, I can change to that tty by using Ctrl+Alt+F10 or using chvt 10 and I'm able to interact with the program. Now I want to send input and get output from that tty without changing my current tty. I tried using screen and all I get is a blank screen and. I tried using script which succeeded if I run bash in that tty but fails If i run a java program
MOHAMMAD RASIM (530 rep)
Mar 6, 2018, 11:18 AM • Last activity: Apr 25, 2025, 02:03 PM
1 votes
2 answers
3794 views
"No X11 DISPLAY variable was set [...]" when using java.swing
When I'm trying to run a Java GUI application from the command line, I get: ```none Exception in thread "main" java.awt.HeadlessException: "No X11 DISPLAY variable was set, or no headful library support was found, but this program performed an operation which requires it," ``` I keep getting this er...
When I'm trying to run a Java GUI application from the command line, I get:
Exception in thread "main" java.awt.HeadlessException:
"No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,"
I keep getting this error whenever I try to run code with java.swing GUI components. $DISPLAY is set to :0 and java --version gives me openjdk 19.0.1. edit: I tried to run java Main with either wayland or xorg but I get the same error.
CocoaPowder (11 rep)
Jan 25, 2023, 10:11 AM • Last activity: Apr 23, 2025, 03:06 AM
2 votes
2 answers
2441 views
Is installing openjdk-21-jdk on Debian 12 from jdk.java.net .deb safe, if its openjdk-21 package looks not working on Debian tracker?
Because Java 25 LTS is coming soon (September 2025) and I've not even yet installed Java JDK 21 LTS (September 2023), I've attempted to do so with a `sudo apt install openjdk-21-jdk` on my Debian 12. But it failed with a `package not found` message. Its package isn't available yet on Debian 12: [ope...
Because Java 25 LTS is coming soon (September 2025) and I've not even yet installed Java JDK 21 LTS (September 2023), I've attempted to do so with a sudo apt install openjdk-21-jdk on my Debian 12. But it failed with a package not found message. Its package isn't available yet on Debian 12: [openjdk-21](https://tracker.debian.org/pkg/openjdk-21) (except on sid). I'm considering downloading it from [https://jdk.java.net/archive/](https://jdk.java.net/archive/) as a tar.gz of 21.0.2 (build 21.0.2+13) version (at the cost of forgetting apt commands to handle Java, and writing on my agenda to check manually for updates there) But I'm fearing this: Won't the .deb included in this .tar.gz break my system if I attempt to install it, if the dedicated openjdk-21-jdk package for Debian 12 cannot be created for years?
Marc Le Bihan (2353 rep)
Apr 20, 2025, 01:55 AM • Last activity: Apr 20, 2025, 06:49 PM
1 votes
1 answers
16756 views
JAVA_HOME should point to a JDK not a JRE
If anyone can help me with this, it would mean a lot as I've seen similarly answered questions for windows but not many or Linux. I am running I am running Linux mint 20.2 (Uma). I have a problem where trying to run my maven project, I get the error ``` The JAVA_HOME environment variable is not defi...
If anyone can help me with this, it would mean a lot as I've seen similarly answered questions for windows but not many or Linux. I am running I am running Linux mint 20.2 (Uma). I have a problem where trying to run my maven project, I get the error
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
I have since fully uninstalled java and maven and set up JDK17 and the JAVA_HOME
$ echo $JAVA_HOME
/usr/lib/jvm/jdk-17.0.2
Along with setting the profile
$ grep JAVA_HOME /etc/profile

JAVA_HOME=/usr/lib/jvm/jdk-17.0.2
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
And .bashrc
$ grep JAVA_HOME ~/.bashrc

JAVA_HOME=/usr/lib/jvm/jdk-17.0.2
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
I also found a
.sh
file in the
/etc/profile.d/
that was redirecting JAVA_HOME to the old JDK and have since deleted it. But even after all of this the problem pressies, I don't know if something is still redirecting JAVA_HOME to the old JDK or I didn't set it up correctly, I also don't know where to look if something is redirecting it or if I have an alias for
since I'm not adept to Linux fully and I haven't used to this system in a while to backtrack my changes. If anyone has any input on how to solve this problem, it would be greatly appreciated. Thank you all in advance.
SaltySwan (11 rep)
Feb 19, 2022, 04:39 PM • Last activity: Apr 10, 2025, 11:05 AM
0 votes
0 answers
61 views
Salesforce2Hadoop cannot find enterprise.wsdl file despite being in folder
I'm running on CentOs 6.9 and I'm trying to run the Salesforce2Hadoop program found [here](https://github.com/datadudes/salesforce2hadoop). I already have the enterprise.wsdl file within the folder but I am receiving this error: Exception in thread "main" java.io.FileNotFoundException: /Desktop/Sale...
I'm running on CentOs 6.9 and I'm trying to run the Salesforce2Hadoop program found [here](https://github.com/datadudes/salesforce2hadoop) . I already have the enterprise.wsdl file within the folder but I am receiving this error: Exception in thread "main" java.io.FileNotFoundException: /Desktop/Salesforce2Hadoop (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at java.io.FileInputStream.(FileInputStream.java:93) at scala.xml.Source$.fromFile(XML.scala:22) at scala.xml.factory.XMLLoader$class.loadFile(XMLLoader.scala:50) at scala.xml.XML$.loadFile(XML.scala:60) at co.datadudes.wsdl2avro.WSDL2Avro$.convert(WSDL2Avro.scala:98) at co.datadudes.sf2hadoop.SFImportCLIRunner$.handleCommand(SFImportCLIRunner.scala:48) at co.datadudes.sf2hadoop.SFImportCLIRunner$.delayedEndpoint$co$datadudes$sf2hadoop$SFImportCLIRunner$1(SFImportCLIRunner.scala:39) at co.datadudes.sf2hadoop.SFImportCLIRunner$delayedInit$body.apply(SFImportCLIRunner.scala:10) at scala.Function0$class.apply$mcV$sp(Function0.scala:40) at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) at scala.App$$anonfun$main$1.apply(App.scala:76) at scala.App$$anonfun$main$1.apply(App.scala:76) at scala.collection.immutable.List.foreach(List.scala:381) at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35) at scala.App$class.main(App.scala:76) at co.datadudes.sf2hadoop.SFImportCLIRunner$.main(SFImportCLIRunner.scala:10) at co.datadudes.sf2hadoop.SFImportCLIRunner.main(SFImportCLIRunner.scala) In Terminal, I typed this: [SmallsRashad@Rashad Salesforce2Hadoop]$ java -jar sf2hadoop.jar init -u rashad.smalls@theremigroup.com -p ******** -b /base/path -w /Desktop/Salesforce2Hadoop./enterprise.wsdl -s /path/to/state-file Name What am I doing wrong? SN: I omitted the password for obvious reasons.
Shad (1 rep)
Feb 12, 2018, 02:47 PM • Last activity: Apr 6, 2025, 07:43 AM
Showing page 1 of 20 total questions