Ubuntu :: BASH Script To Get PID Of Java File?
Jun 18, 2011I have a simple bash script called run.sh:
Code:
java -jar /testing/run.java How do I get the Process ID and save it in a file called "PID"
I have a simple bash script called run.sh:
Code:
java -jar /testing/run.java How do I get the Process ID and save it in a file called "PID"
i'm brand new to linux and honestly don't know how to use it very well and i am trying to install java, following the directions is not working i am stuck at Code: chmod a+x jre-6u<version>-linux-i586-rpm.bin it says bash: version: No such file or directory i downloaded the software to the downloads folder firefox uses as default.
View 6 Replies View RelatedI've just installed java (jre-6u21-linux-i586.bin) on Red Hat 4.4 AS and issued this command to check the java version: java -versionand got :bash :java: command not found
View 4 Replies View RelatedI need to code a media streamer in java but I found out that I would need the java media framework to simplify the task. I downloaded the bin and need to export it into the files where my jdk packages are at by default. I'd rather not set my path variables because I'm not so good at interfacing with BASH. I just want to start nautilus in sudo and drag and drop like I did with my python packages. I am just having trouble locating the jdk lib.I'm not using openjdk but sun-jdk 1.6.18. My OS is Lucid. The package is JMF2.1.1e. I'm pretty sure I just need the just the lib files from it and none of the executable.
View 1 Replies View RelatedI have a bash script that calls a java class method. The method returns a string to the linux console when run independently. how can I assign the value from the java method to a variable in a bash script?running the script: java -cp /opt/my_dir/class.method [parameter]
output: my_string if added in a bash script:
read parameter
java -cp /opt/my_dir/class.method [parameter] | read the_output
echo $the_output
the above doesnt work, I also tried unsuccessfully:
the_output=java -cp /opt/my_dir/class.method [parameter]
the_output=`java -cp /opt/my_dir/class.method [parameter]`
java -cp /opt/my_dir/class.method [parameter] 2>&1
How can i get the output stored into the_output variable?
how can i run a bash script script by using java in rhel5... then please reply....i have vary good project in my mind.....
View 2 Replies View Relatedi am using front end as java and back end RHEL5.i am trying to calling a bash script with java. but i am facing problem.i am using following java coding to use call the bash script
import java.util.*;
import java.io.*;
public class b
[code]....
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END
[code]...
I am running a Java application on the command line bash terminal under Mint Debian. I have JDK1.6.0_22 installed 64-bit, and the OS is 64-bit too. I have a few JAR files in the directory and a few native LWJGL libraries. When I run the application using the command line, all works fine.
Lets assume my directory where the files are is called /home/riz/MyGame. I change to that directory and this is the command I use code...
I am new to Linux and I wanted to setup a dedicated game server on my notebook.
I've installed Ubuntu 9.04. I than created a directory named /home/phlex/kfserver. I downloaded the application binary from Steam. I changed the file permission with chmod +x hldsupdatetool.bin and now the file attributes are -rwxr-xr-x.
The problem is when I try to run the binary file. If I type ./hldsupdatetool.bin I get an error message "-bash: ./hldsupdatetool.bin: No such file or directory. It seems the OS can't find the file. I've downloaded the file several times thinking it may have been corrupt but it's not. I can delete the file, I can rename it and so the file is there. Sometimes Linux can be aggravating to use.
I have been messing with diff and grep for 2 days now without result
I am trying to match a file consisting of words to many separate other wordfiles in a specific directory. one by one.
What i want the script to do is to report how many matching words my main file has with every file in the directory, each in turn
setup:
Each of em are plain text files with 1 word per line
Output should be something like:
SCRIPT REPORT:
I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.
Should I be looking to concatenate the files into one file with the file names included, and then print them?
something like: -printfunction -printername < file*
I downloaded the jre tar.gz file unzipped it i have a directory now what? how to install this.
View 3 Replies View RelatedI installed jdk1.6.0_18 version. Please see below for the version.
[Code].....
didn't realise sun-java was in the repo so i downloaded via the java site and installed using their .bin file.So my question is how do i go about removing it?
View 3 Replies View RelatedI am a CS major and Iv'e been using vim with a custom rc file to do my editing... A professor suggested we can use kate with terminal for better speed so I thought I would give it a try. Unlike vim, geany, eclipse and others kate does not indent java code, for example after "{ <ENTER>" it should indent to the right 1 tab, but it does not, so I have to press <TAB> every time I go to new like, and I have to go back and forth for different statements...
This does not make things faster at all, Is this even possible? Any other editor suggestions that do not use GTK, but kde native Qt with terminal emulator?
I am using Ubuntu and just downloaded the jmonkey game engine. Everything appears to be in a single .sh file. I am not really sure how I am supposed to run this.
[URL]
I have a Java program (minecraft server) that needs to be run from the command line. The code is:
Code:
java -Xmx512M -Xms512M -jar minecraft_server.jar nogui
To make life easy (i've got the java file in a folder on the desktop) I want to have a shortcut (or similar) sitting on the desktop. I've tried
Code:
ln 'java -Xmx512M -Xms512M -jar minecraft_server.jar nogui' ./../minesraftserver
with single and double quotes but my unix command line skills are pretty basic and this is obviously incorrect.
I have a java.jar (PCGen) that only works correctly if I run it with sudo from the terminal. I have to cd into its directory and run it as
Code:
sudo java -jar pcgen.jar
I would like to use a menu launcher instead of having to use the terminal each time. I tried
Code:
sudo java -jar /path/to/file/pcgen.jar
No luck. This .jar only works properly if ran as root, is there any easy way to do this?
I have bound over the command line all for my work related jar files to my CLASSPATH
and can now execute the command javac HelloRDFWorld.java and there comes noerror messages. I assume javac command can be executed without any problems:
/workspace/JenaTutorial/src/main/java/tutorial$ javac HelloRDFWorld.java
/workspace/JenaTutorial/src/main/java/tutorial$
But there are still one problem; although my java file can run in Eclipse environment without any problems it does not run over the command line:
//workspace/JenaTutorial/src/main/java/tutorial$ java HelloRDFWorld.java
Exception in thread "main" java.lang.NoClassDefFoundError: HelloRDFWorld/java
Caused by: java.lang.ClassNotFoundException: HelloRDFWorld.java
[code]...
What's the easiest way for me to make a program that requests a file location and then tar balls it. I basically want to start making a simple method of using pv with tar (lzma).
View 8 Replies View RelatedI am using Fedora 11, and I installed Java using .rpm file, now I want to uninstall Java. How can I uninstall Java?
View 3 Replies View RelatedI'm fighting my way through JAVA. But have hit another wall. Basically I need to to set paths in java so it can set/read files/director for Linux,Mac and windows.
The tutorials I'm using says to do this through the FileSystems class eg
Code:
However this reports it is missing, so a look on line says I need the headers so I set them with
Code:
This gives the following error
This has me totally confused as the tutorial shows this and checking online shows this, do I need to link in libraries or something like that?
I'm using the latest Ubuntu 11.04 and netbeans.
How to enable java support in php.ini file.
View 1 Replies View Relatedcan i install Eclipse java ide from any .tar ,.gz or any other such file on my wubi 11.04
View 1 Replies View RelatedI can't seem to be able to save a file properly with java on the sheevaplug (ubuntu)
Here's my test-code:
Code:
try {
File f = new File("test.txt");
System.out.println(f.exists());
[Code]....
it seems to save the file, but nothing that is readable in ubuntu.
I'm using the openjdk-6-jre package by the way.
EDIT: NVM! Forgot to cd into the directory holding the jar before running, so it was working but it was saving to the $HOME dir...
I downloaded Java from the Java website, and went into the root to try and make it an executable file, and it says "chmod: cannot access `home/Non-Admin/Downloads/jre-6u25-linux-i586-rpm.bin': No such file or directory". Is there some sort of program I can install that will automatically turn the rpm.bin/.bin into an executable file?
View 8 Replies View RelatedI am thinking of appending something to each line in a text file with Java. I prefer not write a new file with content appended from the old one.That 'something' would probably be Time Stamp when the file is created (which is same for each line).I am not sure Java provide some easy way for it or not
View 3 Replies View Relatedi am trying to generate a linux executable data (bin data) from my java source code.
View 4 Replies View RelatedIf you are interested, Java SE 6 Update 24 is available. The Check Java Version link in my signature will tell you if you are up to date or not. The Update Java Version link in my signature will tell you how to obtain and install the latest version. The 32 bit version install directions are on the left side of that page and the 64 bit instructions are on the right side.
Just remember to remove the current version before installing the new one as it says in the instructions. The remove instructions are below the install instructions. Also, in Step 9 - "Now you'll want to tell the system, that there's a new Java version available." See the note below it that says if you get an error upon entering the command once, enter it a second time. I have to do that and sometimes forget. Just thought I would mention that. These instructions are already setup for version 6 update 24, but they can be modified for any update and they will work. I have been using these instructions for a couple of years and they work.