jar

Can't create a runnable jar file via Eclipse

独自空忆成欢 提交于 2019-12-31 18:55:52
问题 I made a Java project with Eclipse. The project has a public static void main(String[] args) method in it. When I try to export it to a runnable jar, the launch configuration does not include the project I created so I can't create the jar for the project. Any ideas why? 回答1: Try creating a new launch configuration from scratch: Run -> Run Configurations... Right click "Java Application" in the list on the left and select New On the right enter a descriptive name. In the Main tab browse for

Best way to create a maven artifact from existing jar

会有一股神秘感。 提交于 2019-12-31 10:25:10
问题 I'm mavenizing some projects. These projects all depend on a number of libraries, most of them are available in the maven repo. For the other libraries, I'd like to create a maven artifact, so I can use it as an dependency. The problem is, I only have jar files of these libraries. What is the best way to create artifacts from existing jar files? 回答1: If you're not using a remote repository (which is a common situation for personal development), simply install these artifacts in your local

Maven compile a source jar dependency

大城市里の小女人 提交于 2019-12-31 09:44:15
问题 Let's say I have a project that uses a dependency that can be found in the Maven repository. However, lets also say that the jar file that will be downloaded is NOT in a format that is suitable for my project (e.g. if my maven project is an Android project and the jar has been compiled in a way the dex tool does not like). What I want to do instead is to downloaded the source version of that dependency. Once I add java-source, however, the classes are not accessible anymore from my own source

How to detect duplicate JARs in the classpath?

别来无恙 提交于 2019-12-31 09:11:44
问题 Does anyone have code to detect duplicate JARs in the classpath? Background: When there are two versions of the same JAR in the classpath, really strange things can happen. This can even happen when using tools like Maven: Change a dependency and build the WAR without cleaning first. Since target/webapp/WEB-INF/lib wasn't cleaned, the dependency will be in there twice. Is there a safety-net for this? 回答1: JBoss Tattletale might help you with this. It's a free tool which scans the JAR files

Jar file failed to load in tomcat webapps

我的未来我决定 提交于 2019-12-31 08:46:14
问题 This is what the error i got when i try to deploy maven project to tomcat mvn tomcat7:deploy Error : INFO: validateJarFile(D:\Softwares\tomcat\apache-tomcat-7.0.50\webapps\myWebApp_ 1\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 3. 0, section 10.7.2. Offending class: javax/servlet/Servlet.class But the javax.servlet-api-3.0.1.jar is there in WEB-INF\lib Thanks 回答1: INFO: validateJarFile(D:\Softwares\tomcat\apache-tomcat-7.0.50\webapps\myWebApp_ 1\WEB-INF\lib

Java Exporting as Jar has errors [closed]

一世执手 提交于 2019-12-31 07:52:06
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Two questions 1) When exporting a java project as a JAR file, how does the application know which Class in the package to run first? My applicatino specifically requires that the userInterface.java file run before the CommonDenom.java file. 2) When running the java file I'm getting an error that

Java Exporting as Jar has errors [closed]

北战南征 提交于 2019-12-31 07:51:58
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Two questions 1) When exporting a java project as a JAR file, how does the application know which Class in the package to run first? My applicatino specifically requires that the userInterface.java file run before the CommonDenom.java file. 2) When running the java file I'm getting an error that

Classpath of a decompiled Jar file

吃可爱长大的小学妹 提交于 2019-12-31 07:32:46
问题 So I'm not CS major or anything and I've been just poking around stuff to practice some Java skills I watched from a video. I know this isn't the major way to do it but please, let me. So I extracted a .jar file of this: http://www.zenlunatics.com/quizcards/ (i also have its outright source version). It's open source. I used JD gui to get the source code and got everything in .java. However, once I imported it and tried to run it in Eclipse, it says there is "no main type." I've searched

Classpath of a decompiled Jar file

喜欢而已 提交于 2019-12-31 07:32:33
问题 So I'm not CS major or anything and I've been just poking around stuff to practice some Java skills I watched from a video. I know this isn't the major way to do it but please, let me. So I extracted a .jar file of this: http://www.zenlunatics.com/quizcards/ (i also have its outright source version). It's open source. I used JD gui to get the source code and got everything in .java. However, once I imported it and tried to run it in Eclipse, it says there is "no main type." I've searched

ImageIO inside jar file

Deadly 提交于 2019-12-31 07:07:18
问题 Okay so I'm trying to make an API for my intro screen to be used across multiple games and I've spent the last 5-6 hours trying to figure out this 1 problem. Lets say that I have the API.jar referenced in on of my games and I'm trying to call the method getByteArray() which is supposed to load the frame as a BufferedImage then return the byte[] data. I constantly get input == null when attempting to load the image. public byte[] getByteArray() throws IOException { // Open Image String url = "