executable-jar

How do you recompile a jar file?

二次信任 提交于 2019-11-29 20:05:44
问题 I took an old jar file and edited it. Now i have a folder that has all the files and I want to recompile them back to a jar file. How do i do this? 回答1: Jar files aren't "compiled" in the normal sense of the word. But you just create one with the jar command: jar cvf myfile.jar file1 file2 etc You can use globbing as normal: jar cvf ../myfile.jar * Run jar -? or read the docs for more information. Note that for an executable jar file, you'll need to specify the manifest file as well. 回答2: How

Executable Jar with depedencies

╄→尐↘猪︶ㄣ 提交于 2019-11-29 17:17:46
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 META-INF/ 265 Mon Sep 20 19:12:44 CEST 2010 META-INF/MANIFEST.MF 530609 Mon Sep 20 17:16:12 CEST 2010

java eclipse create executable jar

瘦欲@ 提交于 2019-11-29 15:18:55
I used eclipse to create executable jar. It relies external other jars. In Eclipse, It is simple that you just need to choose Extract required libraries into generated JAR . You can create an executable jar. It can be executed any places where jre is installed. But If I use command line to compile jar. javac -classpath [external jars] *.java jar cfm [a name].jar manifest *.class [external jars] It can generate jar. But the jar can only be executed in the directory where it is produced. If I put it into another directory or machine, it complains NoClassDefFoundError . So, my question is that

How do I package up an applet with multiple .jar libraries?

喜欢而已 提交于 2019-11-29 14:09:42
问题 I'm creating a Java applet from a large scale pre-existing project (Vizster). I am using NetBeans 6.7.1 with JDK 1.5 on Mac OS X. I am attempting to run the applet from it's single output .jar file, but when I do this, it says "applet loaded" at the bottom of screen in Firefox, and there is nothing in the java console, but nothing shows up in the window for the applet. I have had different errors in Firefox previous to this, including errors such as "appletNotLoaded:ClassDefNotFoundError" and

Running a .jar file in a command prompt from double click

为君一笑 提交于 2019-11-29 14:05:26
I'll start of by saying Im on windows 7. I have created a .jar file which executes fine from the command line using the - java -jar myJar.jar approach But what I'm after is to be able to double click on the jar file and for it to open up the command prompt window and run in the command prompt as if i've just typed the java -jar myJar.jar line. When I double click the jar file I do think it is running because a visual part of the java is appearing, but there is no command prompt window showing my console output. After looking around I've come across people saying that javaw which is what the

How do I run a .jar executable java file from outside NetBeans IDE?

雨燕双飞 提交于 2019-11-29 13:50:38
How do I run a .jar executable java file from outside NetBeans IDE? (Windows Vista). My project has a .jar file created by Netbeans. We'd like to run it. Either: how do we run the file or how do we create a 'proper' executable file in NetBeans 6.1? Running a jar is as simple as java -jar filename.jar anjanb as Laplie said, java -jar your.jar EXECUTABLE file : see this thread for answers How can I convert my Java program to an .exe file? Mr. Brahm Deo Sah One of the best technique to run the jar file or jar jar file Create the jar file by jar command choose your jar filename Java_Jar_File.jar

How does a jar file get executed? Do the classes get extracted somewhere?

≯℡__Kan透↙ 提交于 2019-11-29 12:26:59
问题 We know that jar is a compressed archive file format which acts as a container for compiled java classes and conf files. As far as I know, for reading any contents from a compressed container file, first they need to be extracted somewhere. So how does the JVM execute classes inside the jar? Does it extract the contents of the jar to a temp location and then executes the classes? 回答1: The JVM is capable of loading classes or files from a jar file without extracting the jar to temp files. This

Runnable jar with jvm args

╄→гoц情女王★ 提交于 2019-11-29 10:33:15
I was trying to create a runnable jar file using Eclipse. The problem is that the vm parameters I have added to the run configuration in the Eclipse were not saved in any way. I know I can create a batch file that will run the jar with the needed arguments, but I would prefer my users will just run the jar itself. My question is therefore, is there any way to pass vm arguments to the runnable jar not by command line? Briefly, you can't do this without some form of wrapper. You can write a .bat file and/or a .sh script to invoke the JVM with appropriate settings. You may also want to check out

Starting up embedded jetty server for a JAR file

时光总嘲笑我的痴心妄想 提交于 2019-11-29 10:11:06
What I am trying to do, is to build an executable JAR file which will contain my project. I have included its dependencies right next to it, also in JAR files, so my directory listing looks something like this: ~/Projects/Java/web-app/out: web-app.jar dependency1.jar dependency2.jar dependency3.jar I know and am sure that my problem does not arise from dependencies, as my application functions properly, right up to the moment I start up Jetty embedded. The code I use to start Jetty is like this: public class ServerExecutionGoal implements ExecutionGoal { private final static Logger logger =

Can I use the classpath to override a file in a jar that is being run?

痴心易碎 提交于 2019-11-29 09:16:38
I have a JAR file that contains an application as well as configuration files for that application. The application loads configuration files from the classpath (using ClassLoader.getResource() ), and has its dependencies completely satisfied using the configuration files baked into the JAR file. On occasion I want the application to be run with a slightly different configuration (specifically I want to override the JDBC URL to point to a different database) so I create a new configuration file, store it in the correct directory structure (which means in a directory /config of a classpath