jar

Deploying a .jar into a html page

爷,独闯天下 提交于 2020-01-25 04:31:38
问题 So I have the following code in Java which deploys an applet into a html page. Due to security problems I'm trying to make it a .jar and then sign that .jar to see first how that will work. Unfortunately I'm not really sure what I should change in order to run it as a .jar , given that the main class in the .jar is the same: p.println(document+"<applet name=\"myApp\" codebase="+codebase+" code="+code+ " width='+(scnWid-30)+' height='+(scnHei-45)+'>');"); p.println(document+"<param name=user

Java create standalone jar with external jars

柔情痞子 提交于 2020-01-25 03:21:45
问题 I developed two .jar for my application (LOG.jar and STRING.jar). I use these jar, with import in .java : import LOG.CLog import STRING.CString It's OK. But .jar is increasing in my project, so I would like to create only one .jar which includes all .jar developed. So I tried this by creating the only one .jar (named TOOLS.jar) : jar.exe cvmf MANIFEST.MF TOOLS.jar TOOLS\LOG.jar TOOLS\STRING.jar But, if I put only TOOLS.jar file in my application compilation (Java build path in Eclipse), I get

How to add TXT file to the WAR archive using command-line in MS Windows

这一生的挚爱 提交于 2020-01-24 23:47:32
问题 I have key.txt file in E:/ drive and app.war file in C:/ drive. How to copy key.txt to the subfolder of the app.war file i.e WebContent/WEB-INF. Key should copy to the WEB-INF folder. I want result like(after unzipping war file) WebContent | |->META-INF |->WEB-INF | |->key.txt 回答1: Finally i got answer, for this i used. mkdir c:/WEB-INF cd WEB-INF xcopy D:/key.txt C:/WEB-INF jar uvf app.war /WEB-INF/key.txt No need of unzipping and again zipping. 回答2: You can use the jar command to extract

gradle providedCompile for gwt-user/dev causes other jars to disappear from WAR

旧时模样 提交于 2020-01-24 18:40:11
问题 I assemble WAR for GWT application through gradle. When GWT is included like dependencies { compile "com.google.gwt:gwt-user:2.5.1" compile "com.google.gwt:gwt-dev:2.5.1" ... } then I have gwt-user.jar and gwt-dev.jar in resulting WAR file. They are not really needed and are big. If I delete these jars from WAR - application works well. But when I try to assemble WAR without these jars inside using dependencies { providedCompile "com.google.gwt:gwt-user:2.5.1" providedCompile "com.google.gwt

Access Antlib Resources From Within Apache Ant Macros

ぐ巨炮叔叔 提交于 2020-01-24 12:36:08
问题 Is it possible to access resources from within Apache Ant macros defined in an Antlib? For instance, within my antlib.xml , I have a macro that performs some XSLT. Ideally I would like the XSLT file to be packaged in the same JAR as the antlib.xml , but I have no idea how to specify the location of the XSLT. Here is the (simplified) code: <antlib xmlns:tibant="antlib:org.windyroad.tibant"> <macrodef name="configure-ear"> <attribute name="xml" /> <attribute name="out" /> <sequential> <xslt in=

MongoDB with java Exception in thread “main” java.lang.NoClassDefFoundError: org/bson/conversions/Bson

风格不统一 提交于 2020-01-23 22:16:21
问题 When I execute mycode from intelliJ Idea it works fine but when I run the jar on my server it throws the below error. I am using 'org.mongodb:mongodb-driver:3.4.1' version. Exception in thread "main" java.lang.NoClassDefFoundError: org/bson/conversions/Bson at com.myapp.server.mongo.MongoDbHandler.prepareMongoDb(MongoDbHandler.java:68) at com.myapp.server.mongo.MongoDbHandler.<init>(MongoDbHandler.java:22) at com.myapp.server.Client.main(Client.java:167) Caused by: java.lang

How to have Netbeans projects export their dependencies like Eclipse does?

这一生的挚爱 提交于 2020-01-23 10:52:06
问题 In Eclipse, if a project uses a particular JAR file, I can mark it to provide/export it. So if another project has a reference to the former, then the particular JAR will be available too. How can I do that in Netbeans? 回答1: In Netbeans you always have to add JAR in the project properties, unless you use some deployment tools. Right click in your project Project Properties -> Libraries Add JAR 来源: https://stackoverflow.com/questions/8096232/how-to-have-netbeans-projects-export-their

Web app won't join Infinispan cluster

萝らか妹 提交于 2020-01-23 10:36:26
问题 I've been playing around with Infinispan lately, having had no previous experience with Infinispan. I've come across an interesting problem and I wondered if anyone might be able to shed some light on it. I have a standalone Java application (GridGrabber.jar) that bundles the Infinispan jars and has a class to add/remove and list items from the grid. Within the application I create the CacheManager as follows: DefaultCacheManager m = new DefaultCacheManager("cluster.xml"); The application

How can I include my icon when I export my project to a jar file

筅森魡賤 提交于 2020-01-23 05:20:19
问题 I have developed an desktop application. The problem is when I export the application to jar file the icon isn't shown in the app. When I run it from Eclipse all icons are shown there. An example from my project: package net.ebank.gui; import java.awt.*; import javax.swing.*; public class EBank extends JFrame { protected Start s; public EBank() { setTitle("Welcome To EBank"); setBackground(Color.white); Image img = new ImageIcon("../EBank/res/bank.jpg").getImage(); this.setIconImage(img); /*

How to extract .class files from nested Jar?

大憨熊 提交于 2020-01-23 02:24:48
问题 I have a Jar file named " OuterJar.jar " that contains another jar named " InnerJar.jar " this InnerJar contains 2 files named " Test1.class " & " Test2.class ".Now i want to extract these two files. I have tried some piece of code but it doesn't work. class NestedJarExtractFactory{ public void nestedJarExtractor(String path){ JarFile jarFile = new JarFile(path); Enumeration entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry _entryName = (JarEntry) entries.nextElement()