Unable To Run Tshark Command Using Runtime Environment On Ubuntu

Sep 19, 2014

I am trying to run tshark command using runtime environment in java on ubuntu . My code is as follows :-

try {
String destip = map1.get((String) innObj.get("value"));
Runtime run = Runtime.getRuntime();
String tshk = "/usr/bin/tshark -r /home/pratibha/Desktop/vox.pcap -Y "ip.dst == "
+ destip
+ " && http" -T fields -e tcp.port -e col.Info";
Process pr = run.exec(tshk);

[Code]...

map1 is hashmap which contains the destination ip adress When i run the above code the exit code for process (pr) is 1 and hence the tshark command is not executing properly.

View Replies


ADVERTISEMENT

Unable To Run Tshark Command In Java On Ubuntu

Sep 19, 2014

I am trying to run tshark command using runtime environment in java on ubuntu . My code is as follows :-

try {
String destip = map1.get((String) innObj.get("value"));
Runtime run = Runtime.getRuntime();
String tshk = "/usr/bin/tshark -r /home/pratibha/Desktop/vox.pcap -Y "ip.dst == "
+ destip
+ " && http" -T fields -e tcp.port -e col.Info";
Process pr = run.exec(tshk);

[code]....

map1 is hashmap which contains the destination ip adress.When i run the above code the exit code for process (pr) is 1 and hence the tshark command is not executing properly.

View Replies View Related

Fatal Error Has Been Detected By Java Runtime Environment

Jul 8, 2014

While executing my application i came across with this unexpected error which i don't know why?

#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fdcacd79a9, pid=4980, tid=7724
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [ntdll.dll+0x79a9]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit: [URL} .....
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

View Replies View Related

Registry Refers To Nonexistent Java Runtime Environment Installation

Mar 13, 2015

I was having trouble running some Java programs (not my own) in Windows XP, and in the process I uninstalled and installed JRE versions 6, 7, and 8, one at a time, probably in the order 7, 8, 7, 6, 7. The program that had the original problem only worked in V6, but some other programs stopped working. I went back to V7, and those other programs still didn't work. The message was "the registry refers to a nonexistent java runtime environment installation". The only advice I could find with Web searches was to reinstall the JRE. Needless to say, that didn't work.
 
So I looked at the registry, and I found that there were still references to V8, which had been uninstalled. The first was
 
HKEY_CLASSES_ROOTjarfileshellopencommand - (Default) = "C:Program FilesJavajre1.8.0_31binjavaw.exe" -jar "%1" %*
 
The folder re1.8.0_31 doesn't exist, so I changed it to jre7. That didn't work.
 
Then I found
 
HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment - CurrentVersion = 1.8
 
I changed this to 1.7, and deleted some following entries such as
 
HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment1.8 - JavaHome = C:Program FilesJavajre1.8.0_31
 
retaining entries such as
 
HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment1.7 - JavaHome = C:Program FilesJavajre7
 
That worked!
 
So, there is a bug in the installer(s): if you uninstall V8 and install V7, the 'CurrentVersion' isn't set correctly, with the result that the registry points to a non-existent folder. The V8 uninstallation should delete these entries, or the V7 installation should change them.

View Replies View Related

Error - Could Not Find Required Version Of Java(TM) 2 Runtime Environment In (null)

Jun 30, 2014

I have installed and tested j2se jdk8 u5 on my Windows 7 64 bit laptop and successfully tested in Eclipse with a quick Hello World.

JAVA_HOME = C:Program FilesJavajdk1.6.0_25

When I try to install j2ee jdk7 sdk7 I get

Error: Could not find the required version of the Java(TM) 2 Runtime Environment in '(null)'

View Replies View Related

Unable To Play Video In JPanel Using VLCJ In Ubuntu 13.04

Sep 15, 2014

I am trying to play video in JPanel using vlcj in ubuntu, there is no error. My project builts successfully. but do not plays video. when i run code JFrame comes for a while. when i use same code in windows. it plays video and works successfully, but not in ubuntu.

In output window , it show following

A fatal error has occured in java runtime environment. (and so many things.)

Following is my code : (i am using vlcj-3.0.1)

import com.sun.jna.NativeLibrary;
import java.awt.BorderLayout;
import java.io.File;
import javax.swing.JFrame;
import javax.swing.JPanel;
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;

[Code] ...

Which path to give for vlc player in ubuntu. there are more than 5 folders with name vlc. one is in /usr/share/ and other is in /etc/ and so on.

View Replies View Related

Execute Ping Command Using Runtime

Nov 3, 2014

I'm trying to run a ping command but all I manage to do Is open a new cmd window.I'm not sure how to add the ping command to the String[].

import java.io.*;
class callcmd{
public static void main(String[] args){
try {
String[] command={"cmd", "/k","start","ping 192.168.10.9" };
Process process=Runtime.getRuntime().exec(command);
}
catch (IOException e) {
e.printStackTrace();
}
}
}

View Replies View Related

Unable To Compile Codes Using Command Prompt

Feb 9, 2014

I have installed java and I am not able to compile codes using command prompt.... what are the correct settings so that I can proceed further ....

Capture.JPGCapture2.JPG

View Replies View Related

Unable To Get GPA Of Student As Command Line Argument

Feb 15, 2015

I'm writing a Java program to get the gpa of a student as a command line argument. Then display the class of the degree according to some criteria. Here is my code. But it says "ArrayIndexOutOfBoundsException :0". How can I fix this?

public class Stgpa
{
public static void main(String[] args)
{
double gpa= Double.parseDouble(args[0]);
if(gpa>=3.6)
System.out.println("Class of the degree is: First Class Hons");
else if(3.6>gpa && gpa>=3.4)

[Code]...

View Replies View Related

Unable To Compile One Of Selenium WebDriver Files To Run From The Command Line

Apr 24, 2015

I'm trying to compile one of my Selenium WebDriver .java files to run from the command line. Since it's just one file, I only need to compile the file into a .class file to run it from the cmd line. I don't need to make a .jar file.

The .java file runs fine inside Eclipse, so now I need to make it run from the windows command line.

I tried compiling it using

javac -classpath C:WDJarFilesselenium-server-standalone-2.42.2.jar TasksCreateAssignments.java

but got this error

TasksCreateAssignments.java:23: error: package org.apache.poi.hssf.usermodel does not exist

how can I can fix that?

View Replies View Related

API To Invoke Terminal In Ubuntu

Jun 5, 2014

I am trying to build and IDE for NASM in Java for Ubuntu. There are other IDE's for NASM but they are in C or C++. So i thought i should try making one in Java. Well I am done with the GUI part.

How should i link the NASM compiler to the IDE.
Or
There is another way like "DEV C++ IDE" does in Windows is that it invokes the CMD and runs it in that so i could try doing something like that by invoking the TERMINAL in Ubuntu and running it in that. Does java have an API for this purpose.

View Replies View Related

How To Install Java 8 On Ubuntu 14.04

Apr 19, 2014

I used Ubuntu 13.10 on a Chromebook and Java7 and Java8 both worked nicely. Not on Ubuntu14.04, however.

I can try

sudo apt-get install openjdk-7-jdk
javac -version
java -version

… and it tells me 1.7.0_51 IcedTea etc. I haven't found an OpenJDK version of Java8, so I tried the usual technique of unzipping the Oracle download into /usr/java (which I have created and given “campbell” ownership of).

campbell@xxxxx:~$ /usr/java/jdk1.8.0_05/bin/java -version
bash: /usr/java/jdk1.8.0_05/bin/java: cannot execute binary file: Exec format error
campbell@xxxxx:~$ /usr/java/jdk1.7.0_55/bin/java -version
bash: /usr/java/jdk1.7.0_55/bin/java: No such file or directory

Same download in my home directory as I had last week. I repeated the download and got the same error. It is different from the error for Oracle Java7, which I haven't actually got installed at the moment.

I shall probably revert to Ubuntu13.10 for a bit.

View Replies View Related

Running Java App With SQLite On Ubuntu

Nov 12, 2014

I have built a Java app that uses SQLite (sqlite-jdbc-3.8.7.jar). Running the jar file on windows works as expected however, trying to run it on Ubuntu Server 14.04 has turned into quite a task!

I put together a brand new machine in VirtualBox for testing. I installed Java (sudo apt-get install default-jre) and have installed SQLite (sudo apt-get install cl-sql-sqlite3 sqlitebrowser). I created a new sub-directory within my home directory and copied over the jar file. From terminal, I then run the command: sudo java -jar ProductionView.jar and I receive a java.lang.unsatisfiedlinkerror. For troubleshooting, within the app, before making a connection to the db, I have printed out the location of where the db is to be created and it is correct (see attached pic). Is there more that needs to be configured before I can run this app on Ubuntu? I have posted the relevant code below :

(AppDatabasePath() is what is printed in the image...).

public static String AppDatabasePath() {
return AppPath() + APP_NAME + ".db";
}
public static String AppDatabase() {
return "jdbc:sqlite:" + AppDatabasePath();

[Code] .....

View Replies View Related

Why Command Prompt Does Not Recognize Java As A Command

Jul 22, 2014

I am trying to execute a program from the command prompt. I type java -jar zuul.jar (zuul is the name of my project) and I get a message that java is not recognized as an internal or external command. What do I do wrong?

View Replies View Related

Compiling Multiple Java File Using Terminal In Ubuntu 12.04

Feb 11, 2015

I am new in java. I executed a java program using eclipse. the program contain two java file. when i try to run it using terminal in Ubuntu. Two files are not linking. it shows error. i am attaching all the data.

It shows the following error

regex2string.java:83: error: cannot find symbol
str = randomstr.nextString(2000);
^
symbol: variable randomstr
location: class regex2string
1 error

[Code] ...

View Replies View Related

Accessing File On Remote Ubuntu Machine Using Java

Mar 3, 2015

From java running on Windows, I need to access a file on a remote Ubuntu machine. I use the following:

URL U = new URL ( "http://" + SERVER_IP + ":" + SERVER_PORT + "/" + ClsName + ".class" );

where:

SERVER_IP is the Ubuntu IP address obtained from any site that shows the IP address of the machine you are using.SERVER_PORT is the Ubuntu port where the server is listening.

Now:

Do I need to modify this code any further?Do I need to configure the Windows and/or Ubuntu machine(s) for this to work? 

View Replies View Related

How To Set Environment Variables

Apr 13, 2014

I am new in this programming language, java. I have a problem after I set my path ";C:Program Files (x86)Javajdk1.7.0_51in". I made a simple program but an error occurred. Here's the screenshot.....

Attached image(s)

View Replies View Related

How To Send Command To Command Line

Jun 19, 2014

I simply cannot understand and find how to send a command to Command Line from Java.OK I can Open DOS:

1. Process p=Runtime.getRuntime().exec("cmd /c start");

2. Now How to "cd C:" + Enter ?

3. send another command "mvn clean install" + Enter

View Replies View Related

EJB / EE :: Use Asynchronous Annotation In Distribute Environment

Jul 18, 2014

Can we use EJB @Asynchronous annotation in distribute environment. I know we can use it but I want to know its Advisable or not. Because It's not advisable to manage user thread in Distribute environment like EJB container .Earlier if we want to make Asyn call then we use JMS. But now they added @Asynchronous annotation with Future Class to achieve the same result.

View Replies View Related

Environment Independent Single WAR Generation

Oct 8, 2014

I have a project which has a set of configuration files, where each configuration file represents an environment specific configurations. In other words, I have 3 environments, development, staging, and production. The configuration for each environment is different, e.g. DB name, url etc.

Whenever I want to deploy the same code, on each environment, I have to manually generate environment specific .war file, so that it has environment specific configuration file in it.

What I am looking for is a kind of solution where i have to compile only once in maven and it generates only one .war file, which I can use on every environment. In other words, i want the environment specifi application server/tomcat to identify which configuration to pick.

That way, I'll be sure that we are deploying and testing the same .war file on every environment/application server.

How can i restructure the application to achieve this functionality?

View Replies View Related

How Wait And Notify Works In Multithread Environment

Aug 26, 2014

Flow of this program?

public class ThreadA {
public static void main(String [] args) {
ThreadB b = new ThreadB();
b.start();
synchronized(b) {

[Code] ...

View Replies View Related

Input Ten Words And Output Them Backwards In MSDOS Environment

Sep 4, 2014

how would a program code look like, input ten words and output them backwards in a msdos environment. My code this far is:

package baktext;
import java.util.*;
import java.io.*;
import java.awt.*;
//public static String baklänges(String s) {
//}
public class Baktext {

[Code] ....

View Replies View Related

JavaFX 2.0 :: How To Create Off Screen Images By Canvas In Multi-thread Environment

Feb 25, 2015

I want to create off-screen images by Canvases in multi-thread environment.
 
I know that I use methods of GraphicsContext2D to draw on Canvas. Can I do this on Canvas which is not added to Scene ?
 
How can I get an image from a canvas after I invoke GraphicsContext2D methods? Can I get images in multi-thread environment ?

View Replies View Related

Could Program Fail With Race Condition By Concurrent Threads In A Multi Thread Environment

Feb 18, 2014

I have a task of returning US holiday based on the given date and this utility will be used in a multi thread environment. I have written as below, how to know if my code breaks at any given point by multiple threads

Declared Enum

public enum Holiday {
CHRISTMASDAY("Christmas Day"),
GOODFRIDAY("Good Friday"),
INDEPENDENCEDAY("Independence Day"),
LABORDAY("Labor Day"),
NONE("None");

[code]...

I tried to test this with few concurrent threads, and noticed that the DB call is made for the very first time or when the year being requested is not same as the cached year. But I wanted to see, if this is properly synchronizing and would not fail in any case. My intention is to make a singleton HolidayCalendar, and also synchronized well enough so that every thread using this class gets the required data without blocking each other.

View Replies View Related

Getting RunTime Exception ClassCastException

Feb 28, 2014

i am getting runtime Exception Saying classCastException .here is my code where i am getting classcastException.

public class ModifyDetailsServlet extends HttpServlet {
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

[code]....

View Replies View Related

Runtime Error On View Contacts

Feb 9, 2015

why get a runtime error when choosing option 2 after adding a contact?

Main:

package contactlist;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

[code]....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved