executable-jar

Intellij Javafx artifact - how do you make it?

允我心安 提交于 2019-12-05 23:14:17
问题 I've been trying all day to turn my javafx application into a jar file. I'm using Java 1.7 update 7. Oracle has some information, but it just seems scattered all over the place. Intellij is almost doing the job, but I get the following error: java.lang.NoClassDefFoundError: javafx/application/Application Which seems to say that I need to tell java where the jfxrt.jar is... If I add this jar to my classpath info for the manifest build in intellij - ctrl+shift+alt+s -> Artifacts -> Output

Java exception- Exception in thread “main” java.lang.NoClassDefFoundError: net/sourceforge/tess4 j/Tesseract

拟墨画扇 提交于 2019-12-05 20:49:33
I am try to make things works with tess4j (OCR algorithm), and i m using this code: import java.awt.image.RenderedImage; import java.io.File; import java.net.URL; import javax.imageio.ImageIO; import net.sourceforge.tess4j.*; public static void main(String[] args) throws Exception{ URL imageURL = new URL("http://s4.postimg.org/e75hcme9p/IMG_20130507_190237.jpg"); RenderedImage img = ImageIO.read(imageURL); File outputfile = new File("saved.png"); ImageIO.write(img, "png", outputfile); try { Tesseract instance = Tesseract.getInstance(); // JNA Interface Mapping // Tesseract1 instance = new

Executable Jars running very slowly

自古美人都是妖i 提交于 2019-12-05 17:19:30
I've done several projects and packaged them into jar files, but I've noticed that my jar files run much more slowly than in my IDE. I use Eclipse to compile and run my programs. In Eclipse, I have everything working. When I package my project as a runnable Jar and execute it by double-clicking, everything still works. But when I have animation, the program runs extremely slowly. Instead of 30 frames per second in Eclipse, I now get about 2 frames per second. The animation is very laggy. Interesting thing is, when I run the same Jar from the command prompt ( java -jar MyCode.jar ), the lag

bouncycastle error “JCE cannot authenticate the provider BC” with “jar-with-dependencies”

非 Y 不嫁゛ 提交于 2019-12-05 04:37:08
问题 I am creating a java standalone application that uses bouncycastle. Everything works in eclipse. I'm creating a jar with dependencies like this. When I run the application with "java -jar myapp-0.0.1-SNAPSHOT-jar-with-dependencies.jar" . I get the following error : java.io.IOException: exception encrypting data - java.lang.SecurityException: JCE cannot authenticate the provider BC My code : Security.addProvider(new BouncyCastleProvider()); String keystoreDirectory = "C:/myapp/security"; File

How do I pass a file as argument to my Java application created using JAR Bundler?

让人想犯罪 __ 提交于 2019-12-05 04:13:50
I would like to associate a specific file type with my application, so when I double-click one of the files of this specific type, my application opens. This works just fine, but the file I double-clicked does not get passed as an argument to my program. If I for instance associate my application with txt files and I double-click todo.txt , my application opens, but I have no idea which txt file I double-clicked. From what I can read, this is how it's supposed to work on OS X, and instead of relying on the default behaviour (how it works on e.g. Windows), I should use ApplicationListener

Kotlin JSR-223 ScriptEngineFactory within the fat jar - Cannot find kotlin compiler jar

爷,独闯天下 提交于 2019-12-05 03:15:08
问题 I have a fat jar where I'm trying to get the instance of Kotlin's ScriptEngine . For the debugging purposes I'm iterating through available Script Engine Factories and getting the engines. val scriptEngineManager = ScriptEngineManager() for (factory in scriptEngineManager.engineFactories) { val scriptEngine = factory.scriptEngine } When it hits the Kotlin's engine, it fails with following exception: Exception in thread "main" java.io.FileNotFoundException: Cannot find kotlin compiler jar, set

How to execute jar with command line arguments [duplicate]

夙愿已清 提交于 2019-12-05 03:06:05
Possible Duplicate: Passing arguments to JAR which is required by Java Interpreter how to provide command line input to a file which is in a jar I have a jar file hello.jar with some say execute.java file which i want to execute from command line with two arguments;how can i achive this i have mentioned a executable.java as a main class in a manifest file and using ant i have to run this file from ant run with command line arguments Thanks and Regards samarth Try this in the command shell: java -cp your-classpath-dependencies-here -jar hello.jar "arg1" "arg2" Do it in Ant with the <java> built

URL.setURLStreamHandlerFactory

守給你的承諾、 提交于 2019-12-04 21:44:49
问题 I am developing a web application using an executable jar with embedded Jetty. My jar contains a dependent jar.(jar in jar) I referenced to the JarRsrcLoader and RsrcURLStreamHandlerFactory that developed by Eclipse. JarRsrcLoader is using URL#setURLStreamHandlerFactory(RsrcURLStreamHandlerFactory) to resolve rsrc protocol. Thereby it can resolve class path for jar. But it becomes impossible to solve the usual protocol as side effects. for example file:xxxx or jar:xxxx .

How to run standalone TestNG project from jar/bat/

浪子不回头ぞ 提交于 2019-12-04 19:03:47
问题 I have a TestNG project. Don't have any main class, currently it is running like "Run As TestNG". I want to export it as runnable jar or jar so that any one can just hit a command from command line and test cases start running. Could any one help me out in this? or suggest any other way to deliver the code in runnable form... I am not using ant or maven. Thanks 回答1: I seem to have found the solution after a bit of googling. This works fine in Eclipse (Juno). Say, you have a TestNG file named

Include A Properties File With A Jar File

試著忘記壹切 提交于 2019-12-04 12:26:34
问题 I've written a small application. I've put the database specific information in a properties file. db.url=jdbc:mysql://localhost:3306/librarydb db.user=root db.passwd=pas$w0rd When I build the application to get the executable jar file, the properties file gets included inside. The whole purpose of putting those information in a properties file is to allow the user to change those but this is making it impossible. How can I include a properties file with the jar file not in it? Kinda like you