Executing Jar With Multiple Libraries

May 16, 2015

I am not necessarily 'new' to java, however I have always used NetBeans so I am not entirely sure how to do what I need with the terminal commands. I am trying to execute a java jar file(which works perfectly on windows) on the Raspberri Pi, essentially debian linux.

As I mentioned previously, I have a java jar file which I can execute on windows, but it depends on three other libraries, namely RXTX, MySQL, and JSON. I am not positive how to compile this into a jar, or execute it in debian.

This was how I attempted to load two of those libraries, however the last line is the error I received.

Direct copy from the terminal:

pi@raspberrypi ~/Desktop $ java -Djava.library.path=/usr/lib/jni -cp /usr/share/java/RXTXcomm.jar:/usr/share/java/mysql-connector-java-5.1.10.jar:. Automation_System.core.HAS

Error: Could not find or load main class Automation_System.core.HAS

Specifically, the problem seems to be that I cannot use the -cp flag to indicate classpaths, and the -jar flag indicating I am executing a jar in the same command. I am not sure how to point the compiler to my main class HAS in the core package of the jar, and also to the libraries referenced.

View Replies


ADVERTISEMENT

Executing A Program With Several Classes

Apr 29, 2015

I am working my way through "Head First Java" and typing the code in the book into Notepad++ as I go. In the first few chapters the code was simple and only had one class (main). Now the code has two or more classes. Originally I would compile the code in the Command Window by typing "javac" and the program's name. After it compiled I would execute the program by typing "java -classpath . " and the program's name. However, now when program has several classes I get the following error: Could not find or load main class. Below is a program I am having issues with... does it need to be saved as two separate files?

class DogTestDrive {
public static void main (String [] args) {
Dog one = new Dog();
one.size = 70;
Dog two = new Dog();
two.size = 8;

[Code] ....

View Replies View Related

Print Out Statement After Executing To ThreadPoolExecutor?

Jul 26, 2014

I'm trying to make a statement of elapsed time print out after I've executed everything with a ThreadPoolExecutor. What happens is that instead of printing out after all the iterations within the for each loop are done, it prints out the elapsed statement in the middle of the iterations or even in the beginning of the whole execute() method. Here is my code:

package com.atem;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
public final class Example {

[Code]...

View Replies View Related

Executing Perl Script From Java

Mar 17, 2014

How to correct these warning?

View Replies View Related

Jar Files Not Executing / Running Under Windows 8.1

Dec 14, 2014

I've just installed the last Java kit JDK plus netbeans and I've done my first project in Java. It is running perfect from command line<but is is difficult to execute each time from there my tests> but I couldn't run the jar file from windows with double click he jar file even I've spent 3 hour on google to find different methods (registry modifying, control panel/program running in windows, a patch file etc, ) ....

View Replies View Related

Loops (Unable To Predict Output Before Executing)

Jul 1, 2014

I have been writing some loops for some days now. I'm just unable to predict the output for the following different piece of code even though I wrote 'em

public class Numbers {
public static void main(String[] args) {
int numbers[] = {1, 2, 3, 20, 80, 200};
for(int i = 0; i < numbers.length; i++) {
System.out.println(numbers[i++] = 5);
}
}
}

View Replies View Related

Executing Java Class From SRC Folder In JSP Page?

Apr 14, 2014

I want to execute a class from src folder in JSP page. But i have receiving the error only..,

Java Code:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@page import="ServerInitiator" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

[Code] ....

My package structure is :

I have try by using the above, is their any perfect way to call this..

View Replies View Related

Executing Perl File From Resource Folder

May 27, 2014

I need to execute a perl file from a resource folder, So that i can able to run the perl file after changing the project to a jar file. And also i need to pass an argument also.

View Replies View Related

Class Not Found Exception While Executing XQuery Using Java

Aug 8, 2014

I am validating an xml file using XQuery in Java using XQJ API. When the query is triggered it is giving the ClassNotFoundException for orai18n.text.OraCollator. I have placed the orai18n-collation.jar file in MANIFEST.MF file and it is loaded in to the class path.

Not sure on why it is giving the exception.

The JDK i am using JDK1.7 and application server is weblogic.

View Replies View Related

How Does Threads Come Back To Ready State After Executing The Task

Mar 21, 2014

When a thread completes its execution, it will be destroyed.In Java thread pool implemenation, how does threads come back to ready state after executing the task.?

View Replies View Related

Getting UnknownHostException While Executing Java Class In Linux Machine

Oct 16, 2014

Find the error log here ......

[pccbuildmgr@svl-jbuild-d1 Logical_Versioning]$ java -jar VersionUpdate1.jar

Picked up _JAVA_OPTIONS: -Xmx10g -XX:MaxPermSize=10g

can get the values for 1.0

java.net.UnknownHostException: home
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)

[Code] ....

View Replies View Related

How To Use External Libraries

Dec 23, 2014

I need to build an application that can preform measurements. So I have a measuring device that can be connected through USB (with a rs232 converter aka VCP).The manufacturer provided me with two libraries:

C++ : a library (.lib) file and a header (.h) file
VB6 : a DLL (.dll) file and a list (.txt) with all the available functions

And also some demo code. Can't get the C++ code running with my Borland C++ 5.5 compiler but the VB6 code is working.What can I use to integrate into my java code.

View Replies View Related

How To Add Libraries To JCreator

Nov 18, 2014

I've been trying this for hours but it's not working. I'm trying to add the sea glass look and feel library to my project but I still get the error:

Exception in thread "main" java.lang.NoClassDefFoundError: List (wrong name: list)

What should I do? I've added the library to "project settings >Required Libraries" and did not forget to check the box. I've also imported the L&F so it can't be that.

View Replies View Related

OMR Class Libraries

Nov 22, 2011

I'm researching the viability of a project. One of the requirements is that a "play slip" will be used to read input. I've searched for open source Java libraries that utilize OMR's (optical mark reader) but to no avail. I have located a C library that fulfills the task- is there a way in Java to access/use non-native language libraries?

View Replies View Related

Incorporating Java Libraries?

Mar 11, 2014

I am responsible for an application which the developer did not build with ANT and also, he had the libraries sitting on his local machine.

Do you have any recommendations on what I should do with these libraries, knowing they were parcelled out and sitting on his local machine instead of in the project itself (Eclipse IDE workspace)?

I am building a script in ANT but don't really know what to do with his libraries. I did get a bunch of compilation errors earlier when I did not have the libraries, but now that I have them, I don't really know where to put them.

View Replies View Related

How To Install / Extract JEE Libraries

Feb 7, 2015

I'm trying to make my first servlet, however since I have only installed the Java SE, the javac compiler is complaining about missing packages (javax.servlet.http...)

I've realized now that I need javax.servlet jar or class files from Java EE, but after downloading java_ee_sdk-7u1.zip from Oracle here I'm not seeing any .sh or java_ee_sdk-7-jdk7-macosx-x64.sh installer (which I saw mentioned elsewhere). The oracle page only instructs to unzip the downloaded file, and searching for javax.servlet only reveals a few files which I'm not sure what to do with:

javax.servlet-api.jar,
javax.servlet.jsp.jar,
javax.servlet.jsp-api.jar,
javax.servlet.jsp.jstl.jar,
javax.servlet.jsp.jstl-api.jar,
javax.servlet.ServletContainerInitializer,

How do I go about installing the Java EE libraries I need? I am on a mac, and I'd like to do this without IDE, using the command prompt if necessary.

View Replies View Related

Using 3rd Party Libraries / APIs

Jun 8, 2014

I wrote my own class to represent univariate polynomials and it works fine, but I was quite sure I was reinventing the wheel, and should obviously like to extend my program's functionality using other kinds of mathematical object.

I've been looking and there are of course open source libraries available which contain everything I'd want to do myself, and more, and probably better, saving me a lot of work.

However the usefulness of this kind of library extends far beyond simple practice and would be invaluable in developing more complex applications.

If I were to plan to write an application that I would at some point in the future like to compile into an executable and sell, would I need to take care about any open source libraries used that the compiler relies on? If so, would it be possible at that stage to use just the API and write my own classes replicating the functionality to avoid breaking license agreements?

The library I'm looking at right now is distributed under the Apache license.

View Replies View Related

Importing Libraries To JSP Page?

May 5, 2014

I have been working on project (developing web interface for generating dynamic reports)for that i have downloaded  dynamic reports library and i want this library to be imported for  my project to jsp page on netbeans 7.2 how can i do it?

View Replies View Related

Java B-Tree Insert (no Libraries)

Apr 11, 2014

My task is to implement a B-Tree data structure in Java using no libraries.

My current problem is inserting when the root is full, thus the middle key goes to root.keys[0] and then it get the left and right side which are new Nodes separating and inserting their keys. My problem is that for some reason there is a random second number when in the root and secondly my boolean leaf is always false meaning it never detects that the Tree is deeper than root.

The coding makes sense to me and I have tried printing everywhere but still can't seem to find the problem.

public class BTree {
/*
1. You may not modify the public interface of this class. You may however add any additional methods and/or field which you may require to aid you in the completion of this assignment.
 
2. You will have to design and implement a Node class. The BTree should house Integer objects.
 
3. You will notice that there are some overloaded methods, some of which work for Integer objects and some with primitive type int. You have to find a way to implement the methods to work with both types.
*/
 
class BTreeNode { 
boolean leaf = true;
int numKeys = 1;
int mOrder;
Integer keys[];

[Code] ....

View Replies View Related

Destination Error - Can't Find Libraries

Sep 7, 2014

Here's the code and i keep getting this error

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import Desktop.java stuff.freetts-122-bin .zip.freetts-1.2 .javadoc.com.sun.speech.freetts.Voice;;
import Desktop.java stuff.freetts-122-bin .zip.freetts-1.2 .javadoc.com.sun.speech.freetts.VoiceManager;;

[Code] ....

Here it exists

Attached image(s)

View Replies View Related

Java B-Tree Insert (no Libraries)

Apr 11, 2014

My task is to implement a B-Tree data structure in Java using no libraries.

My current problem is inserting when the root is full, thus the middle key goes to root.keys[0] and then it get the left and right side which are new Nodes separating and inserting their keys. My problem is that for some reason there is a random second number when in the root and secondly my boolean leaf is always false meaning it never detects that the Tree is deeper than root.

The coding makes sense to me and I have tried printing everywhere but still can't seem to find the problem.

public class BTree {
/*
1. You may not modify the public interface of this class. You may however add any additional methods and/or field which you may require to aid you in the completion of this assignment.
2. You will have to design and implement a Node class. The BTree should house Integer objects.
3. You will notice that there are some overloaded methods, some of which work for Integer objects and some with primitive type int. You have to find a way to implement the methods to work with both types.
*/

class BTreeNode {
boolean leaf = true;
int numKeys = 1;
int mOrder;
Integer keys[];

[Code] ....

View Replies View Related

Running Jar With Libraries From Jar File In Linux

May 22, 2014

I'm running a jar of an application and library jars from lwjgl. I'm creating a java process. It's working on Windows but not on linux.

I tried replacing the semicolons with colons but it didn't work, it just said "Main class not found: Application.natives.linux" or something like that. gamePath is the path the application is in. osName is the name of the operating system.

Here's my code:

String jarRunner = String.format("java -Djava.library.path="%snatives/" + osName + "" -cp "%sjar/lwjgl.jar;%sjar/lwjgl_util.jar;%sjar/jinput.jar;%sjar/slick.jar;%sApplication.jar" main.Main", gamePath, gamePath, gamePath, gamePath, gamePath, gamePath);
  
Process p = Runtime.getRuntime().exec(jarRunner);
 
[Code] ....

How can I make it work on linux?

View Replies View Related

How Does Java Know Where To Import Classes From The Standard Libraries

Aug 19, 2014

I was wondering how Java knows where to Import classes from when we don't specify the whole directory path.

For example: import java.util.* Does It automatically search In both your current directory and the directory created during Installation that contains the standard library (wherever It may have been Installed) ?

View Replies View Related

Importing External Libraries Such As Apache Commons?

Dec 10, 2014

I'm currently using TextPad or command prompt to compile and run my programs, and as usual I am not having any luck importing external libraries, in particular apache commons.

I couldn't see any particularly obvious settings in TextPad to set a library or class path (which is annoying as I really like the program), so I jumped back to cmd prompt to run it from there. Aaaaaand i don't understand .

This is my file structure at present:

/mainProject //includes .java and .class files, and where I've successfully placed .jar files before.

The apache commons zip file was extracted here, making:

/mainProject/commons-lang3/apidocs/orgs/apache/commons/<folders> //the commons-lang3 folder contains the jars I'm navigating to the /mainProject folder in cmd prompt and typing (amongst many other things) javac -cp /mainProject/commons-lang3 MonsterGame.java //with the -cp being pointed at the folder the .jar is in i've tried pointing it at the root folder where the import statement begins in the code (ie mainProject/commons-lang3/apidocs), tried moving the .jar files to the mainProject folder (pointing -cp at it) and more. No luck.

it seems everytime i try to import a new library something goes wrong..... its become a bit of a stumbling block to be honest. I seem to spend most of my time dealing with the 'administrative' side of coding (that was the politest way i could put it ), am I not doing it right?

I've read I'm supposed to include the .jar in the classpath, not just the directory. is this correct? (it still doesn't work...!)

View Replies View Related

Cannot Load 64-bit SWT Libraries On 32-bit JVM Error When Launching Eclipse

Dec 18, 2014

I am suddenly facing error messages when launching my eclipse. Below are the eclipse logs:

!SESSION 2014-12-18 15:17:46.415 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.8.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_IN
Command-line arguments: -os win32 -ws win32 -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2014-12-18 15:17:48.105

[Code] ....

I have tried downloading and placing org.eclipse.swt-3.1.jar in the plugins folder of my eclipse and also I tried editing eclipse.ini file with below lines

openFile
-vm
C:Program Files (x86)Javajre1.8.0_25injavaw.exe
-vmargs

but nothing worked.

View Replies View Related

Libraries Needed For IReport Is Added In Lib Folder

Oct 26, 2010

I have a .jar that is installed in other computer(outside netbeans). Everything works fine except with report. I am sure the libraries needed for iReport is added in my lib folder but I receive this error message when I to load the report using the program.I use command prompt to see the error:

Java Code:

java -jar projCosting.jar mh_sh_highlight_all('java');
And here is the error message:
Java Code: net.sf.jasperreports.engine.JRException: Error compiling report java
source files : [b]D:CostingRptCosting_1288072391310_955208.java[/b]
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses

[code]....

I have included the library in lib folder but do you think I have to install the iReport application?

View Replies View Related







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