executable-jar

How to run a class from a jar with from command-line with classpath specified

霸气de小男生 提交于 2019-12-02 02:20:32
I am trying to run a class from a JAR. This class is NOT the only main class in this jar. Also, it requires number of other jar files, which I have kept in the same directory as this Jar. The commands I have tried are as follows: (mydir is the directory in which all of my jars are located, using Windows platform) mysql-connector-java-5.1.13-bin.jar is needed for myProjImport.jar to run and com.mycomp.myProj.importer.csv.TestImporter is the class i am trying to run. "C:\Documents and Settings\user\workspace\myProjImport\src\conf\datasource.properties" and "C:\temp\apollo_claims_test.txt" are

How to run a class from a jar with from command-line with classpath specified

痴心易碎 提交于 2019-12-02 02:01:13
问题 I am trying to run a class from a JAR. This class is NOT the only main class in this jar. Also, it requires number of other jar files, which I have kept in the same directory as this Jar. The commands I have tried are as follows: (mydir is the directory in which all of my jars are located, using Windows platform) mysql-connector-java-5.1.13-bin.jar is needed for myProjImport.jar to run and com.mycomp.myProj.importer.csv.TestImporter is the class i am trying to run. "C:\Documents and Settings

passing parameter to a jar file which is called in a bat file?

我与影子孤独终老i 提交于 2019-12-01 21:33:25
I have created a jar which needs to be called in a bat file. I need to pass all the command line arguments recieved by bat file to the jar. Can anyone please help me out. I know this is a stupid question, but i dont have any idea about jar and bat. On net i am unable to find the combination of both. Also note that i dont know how to retieve the command line arguments in the bat file. Inside you bat file you will have java command just use java -jar helloworld.jar firstParam secondParam and I believe you can also use because that how we pass params to Maven and ANT etc mybatchFile.bat

Creating an independent jar file

心不动则不痛 提交于 2019-12-01 20:26:15
问题 I have built a jar file using Netbeans and it's working good in my system. But I want to make jar files which is capable of running in all systems, which has JRE and it should work correctly even the classpath is not set in that system. package circle; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JPanel; import

Creating an independent jar file

家住魔仙堡 提交于 2019-12-01 18:38:28
I have built a jar file using Netbeans and it's working good in my system. But I want to make jar files which is capable of running in all systems, which has JRE and it should work correctly even the classpath is not set in that system. package circle; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class Circle { public static void main(String[] args) { SwingUtilities

UnsatisfiedLinkError in exported (Eclipse) executable jar file

≯℡__Kan透↙ 提交于 2019-12-01 17:34:55
The code works fine when executing from Eclipse. I'm using OpenCV 2.4.11 and JavaFX for UI. When I export an Executable Jar from Eclipse and run it from cmd I get the following exception: I followed many post here on SO and OpenCV forum( 1 , 2 , 3 , 4 ) but, none of the answers seems to help me. I have added the OpenCV jar as library and Native Library is linked to /build/java/x64 as suggested in SO answers. The exception occurs at the System.loadLibrary(Core.Native_Library_Name), I checked the Native_Library_Name and the OpenCV version is same as the one I imported in my project. public class

UnsatisfiedLinkError in exported (Eclipse) executable jar file

你离开我真会死。 提交于 2019-12-01 17:15:09
问题 The code works fine when executing from Eclipse. I'm using OpenCV 2.4.11 and JavaFX for UI. When I export an Executable Jar from Eclipse and run it from cmd I get the following exception: I followed many post here on SO and OpenCV forum(1, 2, 3, 4) but, none of the answers seems to help me. I have added the OpenCV jar as library and Native Library is linked to /build/java/x64 as suggested in SO answers. The exception occurs at the System.loadLibrary(Core.Native_Library_Name), I checked the

Connecting a Microsoft Access Database to Java using JDBC and compiling

最后都变了- 提交于 2019-12-01 15:47:56
for a school database project we are making a database program (user GUI and the database). Using Microsoft Access 2010 I created the database and populated it with some sample data, and saved it in .mdb format and placed it in my project folder. When running it in eclipse the following code works fine, connects and even retrieves the query. However I find that I am unable to export the code to a jar and run it (which is required for the project, give them a working copy of your program on a CD or flash drive), and I'm also unable to port the code over to Netbeans to have it work, as well as

Connecting a Microsoft Access Database to Java using JDBC and compiling

自闭症网瘾萝莉.ら 提交于 2019-12-01 14:57:30
问题 for a school database project we are making a database program (user GUI and the database). Using Microsoft Access 2010 I created the database and populated it with some sample data, and saved it in .mdb format and placed it in my project folder. When running it in eclipse the following code works fine, connects and even retrieves the query. However I find that I am unable to export the code to a jar and run it (which is required for the project, give them a working copy of your program on a

Java- export to jar- i/o problems

倾然丶 夕夏残阳落幕 提交于 2019-12-01 14:04:40
I work on Eclipse (Juno with JDK7), and the program runs (on Eclipse) fine. My problematic lines are: URL imageURL = new URL("http://www.idautomation.com/ocr-a-and-ocr-b-fonts/new_sizes_ocr.png"); RenderedImage img = ImageIO.read(imageURL); File outputfile = new File("saved.png"); ImageIO.write(img, "png", outputfile); But when i export the project to a jar file and try to run it via windows (7- 64 bit) command line, the following error appears: Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect