LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-27-2013, 06:28 AM   #1
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Rep: Reputation: Disabled
Unhappy how to run the java applications jar file from the terminal


Dear sir,

how to run the java applications jar file from the terminal. i have to pass the vm arguements also

my main class name is
Code:
org.first.ivb.application.SampleWindow
and my VM arguements are,

Code:
-Djava.library.path="${workspace_loc}/SampleApp/resources:${env_var:PATH}"
please help me in this

Thanks & Regards
Rohaan
 
Old 06-27-2013, 11:38 AM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 138Reputation: 138
The main class should be defined in the JAR - you shouldn't have to pass it in. Try something like:

Code:
java -Djava.library.path="${workspace_loc}/SampleApp/resources:${env_var:PATH}" -jar path/to/archive.jar
If that doesn't work, post the error you get.
 
2 members found this post helpful.
Old 06-28-2013, 12:04 AM   #3
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Original Poster
Rep: Reputation: Disabled
Unhappy

Dear sir,

I did the thing as u suggested and entered the command like above for vm arguements but i a m still getting the error of not loading JNI lib error

i am pasting my error,


Code:
Did not load library
java.lang.UnsatisfiedLinkError: no SampleJNI in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
	at java.lang.Runtime.loadLibrary0(Runtime.java:840)
	at java.lang.System.loadLibrary(System.java:1047)
	at org.syntec.ivb.jni.DeviceController.<clinit>(DeviceController.java:15)
	at org.syntec.ivb.application.SampleWindow.main(SampleWindow.java:52)
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no SampleJNI in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
	at java.lang.Runtime.loadLibrary0(Runtime.java:840)
	at java.lang.System.loadLibrary(System.java:1047)
	at org.syntec.ivb.jni.InitDevice.<clinit>(InitDevice.java:7)
	at org.syntec.ivb.application.SampleWindow.initialize(SampleWindow.java:92)
	at org.syntec.ivb.application.SampleWindow.<init>(SampleWindow.java:74)
	at org.syntec.ivb.application.SampleWindow$1.run(SampleWindow.java:59)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:673)
	at java.awt.EventQueue.access$300(EventQueue.java:96)
	at java.awt.EventQueue$2.run(EventQueue.java:634)
	at java.awt.EventQueue$2.run(EventQueue.java:632)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:643)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
 
Old 06-28-2013, 01:06 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 1,771

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
Are you sure you know how to develop and/or use JNI? It is hardly for beginners... for a start, you should have a file called libSampleJni.so in the specied java.library.path path (and a SampleJni.class on the classpath / in one of your jar-files).
 
Old 06-28-2013, 01:46 AM   #5
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Original Poster
Rep: Reputation: Disabled
Question

Dear sir

thanks for rply

i have developed the driver layer for small app to control device and i have Java app which runs fine wit it when run in eclipse but i want to make it a deliverable executable which will run on any any other linux machine. but i am getting error of same kind with the .sh i have created utility Jarsplice i have used to create .sh

i dont really know all java but i want to make this app executable on linux machine

please any suggestions or any help do rply me

thanks & Regards
Rohaan
 
Old 06-28-2013, 01:58 AM   #6
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Original Poster
Rep: Reputation: Disabled
Dear sir

thanks for rply

i have developed the driver layer for small app to control device and i have Java app which runs fine wit it when run in eclipse but i want to make it a deliverable executable which will run on any any other linux machine. but i am getting error of same kind with the .sh i have created utility Jarsplice i have used to create .sh


i have that libSampleJni.so can i use this and how please let me know.
i dont really know all java but i want to make this app executable on linux machine

please any suggestions or any help do rply me

thanks & Regards
Rohaan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] trying to run "java -jar start.jar" at boot Centos6.4 nschklar Linux - Newbie 2 06-09-2013 08:10 PM
java, .jar don't run on fedora 6 Yentor Linux - Software 1 05-27-2007 04:01 PM
How to run JAR from within Java program ?! EAD Programming 1 12-31-2006 07:11 PM
How to run a java jar file. sabliny Programming 7 11-05-2005 01:59 PM
howto run a java.jar file in FC2-3 mickeyboa Fedora 1 02-11-2005 01:01 PM


All times are GMT -5. The time now is 03:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration