executable-jar

Start a jar file like service in linux [closed]

允我心安 提交于 2019-11-28 17:51:51
I want to start and stop my jar file as follows service myService start service myService stop my current jar file running as follows cd /home/alex/IdeaProjects/myService java -jar target/myService-SNAPSHOT-1.jar server config.yml What should I do? You need a Service Wrapper to run the Jar file. There are examples and instructions for init.d here. or for systemd (ubuntu 16+) here user2684301 I prefer a light weight, free, bash script rather than a more elaborate system that requires licensing. http://gustavostraube.wordpress.com/2009/11/05/writing-an-init-script-for-a-java-application/ Running

Build Java entire project jar using JDeveloper

女生的网名这么多〃 提交于 2019-11-28 14:29:24
I am using JDeveloper 11g to develop a desktop application. I want to make entire project jar which is run-able in java environment.. if I use only standard Java library jar works fine but my project contains external library like JfreeChart, Comm, Hibernate3 etc etc... when I try to make jar Its shows errors how can I make entire jar of my projects along with external library's. thank you Shantanu Banerjee Please follow the below instructions.. Right-click project and select properties. Click on Deployment, setup new Deployment by entering Deployment Profile type and name. Now edit Deployment

How to call an executable jar from php with an argument passed to main method

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 12:34:48
I have created an executable jar and it works fine. For the testing purpose, I have used a dummy variable in the main method. Instead, I need to pass a string variable, while calling this executable jar from php. In short, I need to: Call the executable jar from PHP While calling the jar, I need to pass a string variable from PHP to the main method of the class inside executable jar. How can I accomplish the aforesaid? shell_exec("java -jar your_JAR.jar arg1 arg2"); you can also execute Java at all by using exec instead of shell_execute , giving it $output and & $return_var variables (see the

Eclipse : manually select main class for executable jar file

送分小仙女□ 提交于 2019-11-28 12:15:28
I have java project, and many class that have main method (just for testing purpose). When I create executable jar file by Eclipse, Eclipse will automatically selects which file is main class. (and often wrong). There is another way is change main class in manifest file in Jar file. But, it's so handy. So, my question is : how to choose this manually when create Jar file. Thanks :) Eclipse will set the class you tell it to set. The wizard has a button for doing this. Menus: Export Java, JAR file Next (select classes to be included) Enter name and path for jar Next ( not finish) Next Browse for

does JWS support to launch One-Jar

血红的双手。 提交于 2019-11-28 11:38:03
问题 Can I supposed to launch One-Jar using JWS? One-JAR provides custom classloader that knows how to load classes and resources from a jars inside an archive whereas in JWS we need to specify each JAR that is being used in resources. What I supposed to specify in JNLP if I am trying to launch One-Jar - <?xml version="1.0" encoding="UTF-8"?> <jnlp spec="1.0+" codebase="" href=""> <information> <title>Application</title> <vendor>ABC</vendor> </information> <resources> <!-- Application Resources --

Could not find or load main Class on JAR executing

强颜欢笑 提交于 2019-11-28 11:35:29
I finished my project (in NetBeans ) and i export Jar file (i set my main class in project properties correctly before exporting Jar ): Now, This is my JAR : This Error shown when i run the Jar (in command line page): Could not find or load main Class on JAR executing This is my MANIFEST.MF information: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.9.1 Created-By: 1.7.0_11-b21 (Oracle Corporation) Class-Path: lib/mysql-connector-java-5.1.18-bin.jar X-COMMENT: Main-Class will be added automatically by build Main-Class: Project.LoginFrame All of my classes are here: I try in command line too:

How to run TestNG tests from main() in an executable jar?

南笙酒味 提交于 2019-11-28 10:27:49
I have an executable JAR which contains all dependencies and test classes. I've confirmed that the main() method is called when I execute the jar. I'm trying to add code to main() so that I can run a specific TestNG test class. From the documentation on TestNG.org this appears to be the way to do it: TestListenerAdapter tla = new TestListenerAdapter(); TestNG testng = new TestNG(); testng.setTestClasses(new Class[] { com.some.path.tests.MyTests.class }); testng.addListener(tla); testng.run(); My folder structure is typical: /src/main/java/Main.java /src/test/java/com/some/path/tests/MyTests

Executable Jar with depedencies

巧了我就是萌 提交于 2019-11-28 10:25:14
问题 I'm trying to build an executable jar from the command line (I don't want to use ant or OneJar ) . Here is the content of my file.jar: jar tvf file.jar 0 Mon Sep 20 17:16:12 CEST 2010 lib/ 45396 Mon Sep 20 17:16:12 CEST 2010 lib/org.apache.commons.logging_1.0.4.v201005080501.jar 321330 Mon Sep 20 17:16:12 CEST 2010 lib/org.apache.commons.httpclient_3.1.0.v201005080502.jar 55003 Mon Sep 20 17:16:12 CEST 2010 lib/org.apache.commons.codec_1.3.0.v20100518-1140.jar 0 Mon Sep 20 19:15:00 CEST 2010

Set Icon for executable Jar file [duplicate]

核能气质少年 提交于 2019-11-28 08:17:35
This question already has an answer here: How to change executable jar file icon? 5 answers I have a simple executable Jar file. How I can set icon for this file? In my case I use the standard Jar icon which I would like to change. tokhi you can use setIconImage : frame.setIconImage( new ImageIcon(getClass().getClassLoader().getResource("PATH/TO/YourImage.png")) ); Update If you want to change the coffee-cup then you may use tools like JSmooth to create executable java file and also change the jar file icon. As you can see in the comments JSmooth can be used for windows operating systems. For

manifest.mf is overwritten by eclipse during jar export

与世无争的帅哥 提交于 2019-11-28 08:01:19
问题 I would like make an executable jar archive with eclipse. So into my project I created file src/META-INF/MANIFEST.MF : Manifest-Version: 1.0 Main-Class: MainClass Class-Path: . But when I export my java eclipse project eclipse warn me with following message: "JAR export finished with warnings. See details for additional information. myproject/src/META-INF/MANIFEST.MF was replaced by the generated MANIFEST.MF and is no longer in the JAR." Anyone know how I can avoid this when I export my