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 script, which is pritty straightforward to
Tag: java
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 Linux to get various
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 this way. The problem with this
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
I’m working on XUbuntu 13.04 and developing swing applications. As I just wanted to try that application I ran into java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit on startup. I’ve found several questions about server/client vms and noticed that I have a server VM and that for Linux 64 there is no client VM anymore. But nevertheless IMHO this problem shouldn’t
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 the question to Linux with the
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 You have to supply the complete
How to distinguish same jars started from different directories?
I started several (eight) jar files with the same name from different directories and different config files. Now I have to kill a specific one. But neither jps and ps gives enough information to distinguish them. How could I find out which java process was started from which directory? Platform : linux (ubuntu server) Answer from the man page it
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 to install the
error=2, No such file or directory at java.lang.ProcessBuilder.start
I’m using Fedora 18 and JDK 1.7.13 installed in /usr/java. All executable files under bin folder have -rwxr-xr-x permission. I set both ANT_HOME and JAVA_HOME in my ~/.bashrc as: and I have a build.xml file which says: but after running ant I got this exception: /home/m/workspace/build.xml:58: Execute failed: java.io.IOException: Cannot run program “keytool” (in directory “/usr/java/jdk1.7.0_13/jre/bin”): error=2, No such file
How to send mail using Java in a Linux environment?
I have successfully sent mail using Java using apache james server in Windows. I have been trying to do the same in Linux, but couldn’t start the james server. I am a novice in Linux. Is james server really necessary for sending mails? If so how to start james server in Linux? Answer For sending emails in java you can