executable-jar

Create an excutable jar in IntelliJ IDEA

前提是你 提交于 2019-11-27 18:51:55
I am using IntelliJ IDEA 12.1.3. I have one module and I am trying to convert it into a jar as per the steps given here . I built the jar file and I moved the jar file to D:/. If I try to run this jar I get the following message: Failed to load Main-Class manifest attribute from jar If I run it using java -classpath jar com.code.TestCase it works perfectly. Why does this happen? I created the jar using IntelliJ IDEA. In that jar it has all the code for all external libraries which I added. In the src manifest file: Manifest-Version: 1.0 Main-Class: com.code.TestCase but the jar's manifest file

Create deployable JRuby JAR file?

天大地大妈咪最大 提交于 2019-11-27 18:48:09
I need to compile my JRuby application into a standalone JAR file. How can I do this? docwhat Warbler 1.3.0 or newer can also be used to make an executable JAR file. Quick instructions. Make sure you're using JRuby`s gem, etc. here: $ gem install warbler $ mkdir bin $ cat <<EOF > bin/myapp #!/usr/bin/env jruby puts "Hello World" EOF $ chmod a+x bin/myapp $ warble jar You should now have a myapp.jar file in the current directory. According to the README you just add any libraries you need in the lib directory and use either (or both) a .gemspec or Gemfile to control any other gems that need to

“scala.runtime in compiler mirror not found” but working when started with -Xbootclasspath/p:scala-library.jar

佐手、 提交于 2019-11-27 17:49:38
问题 I'm trying to run a Scala application packed as JAR (including dependencies) but this fails until the Scala library is added by using the -Xbootclasspath/p option. Failing invocation: java -jar /path/to/target/scala-2.10/application-assembly-1.0.jar After the application did some of its intended output, the console shows: Exception in thread "main" scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found. at scala.reflect.internal

making a jar file for console

送分小仙女□ 提交于 2019-11-27 15:45:31
I have a program without a GUI and I use console! So first I read a line from a user from console BufferedReader userReader = new BufferedReader(new InputStreamReader(System.in)); and then I will write an answer for the user in the console! System.out.println("Server:"+output); I want to create a jar file for it ! but how can i show my console in jar file with out using GUI? please help me thanks. You need to run your jar file from CLI (command line). Like: java -jar yourJar.jar pause If you want to force this, there are different ways to do this: a shortcut file to CMD and your jar as an

Minimize an Uber Jar correctly, Using Shade-Plugin

本秂侑毒 提交于 2019-11-27 15:39:17
问题 I am using the Maven-Shade-Plugin to create a runnable Uber-jar. According to the last frame on this page, the size of the jar can be minimized by using: <configuration> <minimizeJar>true</minimizeJar> </configuration> But this feature does not take into consideration the classes that are declared in the log4j.properties file. Hence, e.g. org.apache.log4j.appender.TimeAndSizeRollingAppender is not included in the Uber-jar, even though it’s declared in the log4j.properties file. I believe I

how to check the version of jar file?

大城市里の小女人 提交于 2019-11-27 14:28:58
问题 I am currently working on a J2ME polish application, just enhancing it. I am finding difficulties to get the exact version of the jar file. Is there any way to find the version of the jar file for the imports done in the class? I mean if you have some thing, import x.y.z; can we know the version of the jar x.y package belongs to? 回答1: Decompress the JAR file and look for the manifest file ( META-INF\MANIFEST.MF ). The manifest file of JAR file might contain a version number (but not always a

Why does my JAR file execute at CMD, but not on double-click?

不打扰是莪最后的温柔 提交于 2019-11-27 13:37:01
So I've been writing a simple 3D GUI application that I intended for users to use simply by double-clicking on the JAR file. I got it working perfectly before putting it into the JAR file, and I got it working perfectly IN the JAR file while running from command prompt (typing "java -jar Modeler.jar" while in the directory of the jar file). However, when I double-click it, nothing happens. It runs perfectly fine with no errors from command prompt. I know from experience that crash reports on start-up are not shown because the console doesn't appear (or it disappears too fast), but when running

How can you package an executable jar with a portable JRE?

Deadly 提交于 2019-11-27 13:25:57
问题 I want to be able to distribute by executable JAR without having to make the user upgrade to the latest version of the JRE. How can I package a JRE into the JAR so that they can run the jar with no JRE installed on their system? 回答1: Put Java Portable in a sub-directory and launch your jar using a batch/bash script or Launch4j. 回答2: As you need a jre to execute a jar, I'm afraid this is not possible. I have once used izpack together with launch4j to make a Windows EXE that would install a jre

Convert Java to .app file for MacOSX using JarBundler

这一生的挚爱 提交于 2019-11-27 13:07:40
问题 All I'm trying to do is convert a simple java program into a macOSX .app file so I can distribute it as a simple executable file. I've read all over the place and everyone says the same things: Use Xcode - As far as I can tell, Xcode no longer supports Java Builds Use Jar Bundler - All the tutorials seem to be out of date, and it doesn't work. When I run: java -jar jarbundler-2.0.0.jar The console returns "no main manifest attribute in jarbundler-2.0.0.jar" If I'm right, this would be a fail

How to use a file in a jar as javax.net.ssl.keystore?

不问归期 提交于 2019-11-27 12:28:32
I'm trying to do something like URL clientks = com.messaging.SubscriptionManager.class.getResource( "client.ks" ); String path = clientks.toURI().getPath(); System.setProperty( "javax.net.ssl.keyStore", path); Where client.ks is a file stored in com/messaging in the jar file that I'm running. The thing that reads the javax.net.ssl.keyStore is expecting a path to the client.ks file which is in the jar. I'd rather not extract the file and put in on the client's machine if possible. So is it possible to reference a file in a jar? This doesn't work as getPath() returns null. Is there another way