jar

How can I browse the source code in a jar file containing source code in Eclipse?

扶醉桌前 提交于 2020-01-01 06:35:08
问题 I have a jar file that contains source code. How can I browse this source code in Eclipse? At the moment, my Eclipse opens the jar file in a Text Editor, and it isn't that helpful. When I look in the preferences "General" > "Editors" > "File Associations" I have no associations for *.jar and if I look in the available "Editors" I can't find anyone that seem to be a good fit for jar files. How can I browse the source code in a jar file using Eclipse? Is there any Editor I should configure for

How can I use Maven to build a jar with required libraries in a sub-folder (like Eclipse)

跟風遠走 提交于 2020-01-01 06:09:26
问题 In Eclipse, you can create a project jar with its required dependencies in an adjacent sub-folder by doing ... Export->Java->Runnable JAR file Select Library handling option: Copy required libraries into a sub-folder next to the generated JAR Is there a way to do this with the Maven assembly plugin? Or is there another Maven plugin that would be more appropriate for this task? Thanks! 回答1: yes you can use assembly plugin. pom.xml: <build> <!-- final name set the jar name, if left it will give

Idiomatic Clojure to copy resources from running jar to outside

寵の児 提交于 2020-01-01 05:21:07
问题 It seems like a classical problem but I can't find anything about it "the clojure way". So, I have a foo/ directory inside resources/ (leiningen project). When jar'd/uberjar'd, this foo/ directory is put at the root of the jar. As files inside jar may not be physically consistent at runtime, you can't use basic copy function to recursively copy the directory to the outside world. Several solutions for the Java world exist (How to write a Java program which can extract a JAR file and store its

How does a classloader load classes reference in the manifest classpath?

冷暖自知 提交于 2020-01-01 04:46:24
问题 I used maven to built a jar with an external classpath additions using addClasspath. When I run that jar using java -jar artifact.jar it is able to load classes from that main jar and from all jars in the libs directory. However if I ask the system property java.class.path it will only list the main jar. If I ask the system class loader for its urls ( ClassLoader.getSystemClassLoader().getURLs() ) it will also only return the main jar. If I ask any class contained in some library for its

Modifying taskbar icon of my .jar program

佐手、 提交于 2020-01-01 04:17:55
问题 I'm trying to change the default java icon that appears in taskbar everytime I run my .jar program. I managed to change it with frame.setIconImage(img); but this makes icon way too small, I want it to be as big as other programs icons and have a high quality. Any way I can do that? Thanks. 回答1: As you only supplied a single icon, Windows will then scale that icon to whatever size it needs displaying it in the taskbar (could be 16x16, 32x32 or other sizes, depending on the desktop them and

Deployment Concepts: Packaging JAR Dependencies, When & Why

一笑奈何 提交于 2020-01-01 03:27:04
问题 So I'm relatively new to Java EE and I am having a tough time understanding when, where and why Java deployment files are packaged with their dependencies. Say I build my project into myapp.jar , and it depends on fizz.jar, buzz.jar and JODA ( joda-time-2.0.jar ). I've heard that the default classloader doesn't package jars inside of other jars, so I have to assume that if I called a jar task from Ant, then the default classloader would get invoked and myapp.jar would be created without those

CLASSPATH vs java.ext.dirs

心已入冬 提交于 2020-01-01 02:13:11
问题 is there any reason why to favor using (possibly very long) CLASSPATH variable to set which jars should be on classpath durign application run then to use the java 1.5+ property -Djava.ext.dirs which specifies whole directory(directories) of jars to be searched? To make it real-life example I have standalone java application with lib folder containig all dependent jars. Sofar the start script is setting all the (maybe 20) jars to CLASSPATH variable one by one. Since now my application archive

CLASSPATH vs java.ext.dirs

跟風遠走 提交于 2020-01-01 02:11:27
问题 is there any reason why to favor using (possibly very long) CLASSPATH variable to set which jars should be on classpath durign application run then to use the java 1.5+ property -Djava.ext.dirs which specifies whole directory(directories) of jars to be searched? To make it real-life example I have standalone java application with lib folder containig all dependent jars. Sofar the start script is setting all the (maybe 20) jars to CLASSPATH variable one by one. Since now my application archive

Is it bad practice to include properties/configuaration files within jars?

久未见 提交于 2020-01-01 01:15:12
问题 For example: MyApp is a web app that contains a properties file (server.properties) that describes config data (e.g. server names) for the app. In the development phase, server.properties is located in its own IDE project folder (a logical spot for it). Now it's time to deploy MyApp. The IDE makes it quite trivial to jar up the class files as well as the supporting config files. Now we just drop the Jar in the appropriate web container and away we go.... A week later... the server config data

External jars in eclipse plug-in

谁都会走 提交于 2019-12-31 22:24:52
问题 I'm creating an eclipse plug-in and I'm having trouble with external jars. In my plug-in I start an application which requires some external jars. What do I have to do to export them automatically with the rest of the plug-in? Thanks in advance :) 回答1: Open your plugin.xml Go to Runtime tab and add your JAR in the classpath section 回答2: By following the steps below, the external JARs will be included when you export your plug-in: Copy the required external JAR files into a folder in your plug