Skip to content

Tag: java

How to start java program with hidden terminal

How can i create shell script for linux, Which will start my java program and then exit itself Like:- create new process with no terminal-> java “Test”. exit terminal itself. i have tried with Fork and exec but i couldn’t get any of it please help me Answer I solved this by using Python s…

How to find file creation date in linux using java?

I need to get file creation date in linux machine using java. Many workarounds worked good in windows but failed in linux. Need a way to get file creation time in linux. Please note that my linux machine has java6 installed. Any help is much appreciated. Thanks in adavance. Answer You can use stat command in …

Flush/Clear System.in (stdin) before reading

At work, we have 5 RFID readers attached to a PC running Linux. The readers are all recognized as keyboards and send their input (what they read form the Chip) as an key-input-event sequence. To be able to tell which reader send what sequence, I’m doing a raw-read over /dev/input/XX and get their input …

One to one mapping of Java Thread to Linux thread (LWP)

Is there a one to one mapping between Java Thread objects and OS threads (Lightweight processes). That is, if I have a Thread object, can I always identify precisely one associated OS thread, and will I always have the same associated OS thread? In general this is OS and JVM dependent, so I’ll restrict …

How to set CLASSPATH in Linux to let java find jar file?

Under Linux I am trying to run a jar file as follows: while having CLASSPATH set to any of the following (the file is located at /home/user/plantuml.jar): In either case, no matter how I define CLASSPATH, the java command gives an error Unable to access jarfile plantuml.jar. What am I doing wrong here? Answer…

What’s the correct way of installing jdk on linux

I am running the debian based Crunchbang linux system and i want to install the Oracle JDK (not openjdk) on my system. I’ve spent some time to google for it, but i was not able to find a clear description of how to install (and configure) it. So here are my questions: WHERE is the correct/best location …