jar

Simple way to use a jar as a resource archive

与世无争的帅哥 提交于 2020-01-07 03:10:23
问题 So, I'm working on a Java application and I'd like to package resources into jar files to make them more portable. These jar files would be separate from the application and would only contain assets (images, sounds, save files, etc). What's the simplest way to access arbitrary resources from inside a jar file like this? I've looked around a bit, but haven't been able to find any simple tutorials. I know that I can retrieve input streams from a Jar file with a ClassLoader but how do I get a

Getting “Error: Could not find or load main class ” when invoking a JAR from a bash script

会有一股神秘感。 提交于 2020-01-07 03:04:58
问题 I built and ran a JAR on machineA as follows: java -cp /foo/lib/dep1.jar:/foo/lib/dep2.jar:/foo/export/myjar.jar foo.bar.baz.MyMainClass ... So myjar.jar is the JAR I built and the other two its dependencies. Ran without any issues. I then wanted to do the same on machineB so I copied the 3 JAR files there, then tried: /non/default/install/java -cp /bar/dep1.jar:/bar/dep2.jar:/bar/myjar.jar foo.bar.baz.MyMainClass ... and got Error: Could not find or load main class . (NOTE: /non/default

Intellij IDEA Maven Plugin - Manage Dependencies

試著忘記壹切 提交于 2020-01-07 03:03:09
问题 I'm new to IntelliJ and Maven and tried a bit around. I imported some libraries via the Module & Project Structure Settings in the "Project Structure" window (see screenshot below), because I thought that I have to add my dependencies here. I also thought that this creates the pom.xml with dependency list automatically, but it didn't! I had to add my dependencies via following steps: Open the pom.xml file > Menu "Code" > "Generate" > Popup "Dependency" or by Alt + Insert Project Structure

Jar not accepting values

主宰稳场 提交于 2020-01-07 02:34:46
问题 I have a jar file which when run from command prompt works well, I mean it asks for user input,but when the same is run from psexec or powershell or jenkins doesn't accept values and starts processing further commands. In short: When jar is executed, there is a menu to make choices. If choice is within specific range, it works well else gives message entered value is not valid . Here I am getting the message in a loop. Can anyone suggest where I am going wrong or need to make any change in

Importing Java Library JAR into eclipse

巧了我就是萌 提交于 2020-01-06 20:01:22
问题 I'm currently trying to implement a browser with pipelining feature in it. The problem is in order to code the HTTP pipeline, i need the support of a library. I tried to import it to my workspace by using Project - > properties -> Java build path ->addJar. And I was able to add it successfully. But now my problem is, even though it is added to my workspace it doesnt let me run this code. It gives me errors as if I have not imported the library: package com.test.download; import java.util

Where check log why VM doesn't running for jconsole with custom jar?

三世轮回 提交于 2020-01-06 19:38:59
问题 I try run jconsole with jar that contains my classes like: cd "C:\Program Files\Java\jdk1.6.0_26\bin" set console="C:\Program Files\Java\jdk1.6.0_26\lib\jconsole.jar" set tools="C:\Program Files\Java\jdk1.6.0_26\lib\tools.jar" set customjar="C:\custom.jar" jconsole -J-Djava.class.path=%console%:%tools%:%customjar% But nothing happens - jconsole doesn't start! Where to check what error happens? BTW simple jconsole - startds, all paths are checked and correct. Thanks. 回答1: As I remember you

How To Show Progress Bar When The Java Applet Load On Web Browser

耗尽温柔 提交于 2020-01-06 18:56:15
问题 I have a Jar File which run the applet. This Jar File is called by Call_Applet_Jar.html file which is in www directory. The Call_Applet_Jar.html file has a javascript and html codes. The Jar File is called by html codes which are in Call_Applet_Jar.html. The applet opens too late on browsers. For example applet opens in five seconds with unix o.s's browsers despite this the applet opens in 15 seconds with windows o.s's browsers. Namely applet run quick on unix's browsers but it can not run

Creating and running a Jar file

好久不见. 提交于 2020-01-06 16:54:54
问题 I am a beginner in java programming. I have created a package called Comp Project which contains two classes.... ATM: It has various functions to carry out actions of atm screen. Main: This class calls all the functions from ATM and executes them. Now the program is running good and I have to create a jar file. I created a Jar file with the main class selected as Main . But when I try to run it....it doesn't work. The problem is that i don't understand what creating a manifest is...I looked

Bundle 2 standalone jars into 1

一笑奈何 提交于 2020-01-06 14:07:52
问题 I have 2 standalone jars (each with their own MANIFEST.MF). Is there an easy way to bundle them into a single standalone jar? I don't want to merge the 2 jars into an uber jar for instance (because of some incompatibilities). My approach was to write a short piece of Java code which would run both jars by calling their respective 'Main-Class' in 2 separate threads. And use one-jar to bundle both jars + my short piece of code (+ one-jar's stuff). But I doubt that's the right approach. What

Bundle 2 standalone jars into 1

纵然是瞬间 提交于 2020-01-06 14:05:05
问题 I have 2 standalone jars (each with their own MANIFEST.MF). Is there an easy way to bundle them into a single standalone jar? I don't want to merge the 2 jars into an uber jar for instance (because of some incompatibilities). My approach was to write a short piece of Java code which would run both jars by calling their respective 'Main-Class' in 2 separate threads. And use one-jar to bundle both jars + my short piece of code (+ one-jar's stuff). But I doubt that's the right approach. What