executable-jar

“Could not find main method from given launch configuration” when using Java+Scala+Slick2D

折月煮酒 提交于 2019-12-09 02:57:52
问题 I've got a project in which I'm using Java+Scala+Slick2D. The project itself runs well when launched from within eclipse. But when I try to make a jar file, it just refuses to work. Here's the error I keep getting when trying to export it as a Runnable jar: And if I try to export into just a Jar file, it's unable to find the Main Class: There is, of course, a main class in game.TicTacGame. But it refuses to acknowledge it. I tried creating an executable with a simple Hello World project and

How to get java main class from jar file

限于喜欢 提交于 2019-12-08 19:47:30
问题 I have an executable jar and i want to know the name of java main class from this jar My question are if there is a java cmd to get this from jar metadata ? 回答1: You can use unix command : unzip -p XXX.jar META-INF/MANIFEST.MF or you can use jar commad jar tf XXX.jar and see the content of MANIFEST.MF . 回答2: Technically a jar file can contain more than one main class. When java executes a jar file, it looks in the META-INF/MANIFEST.MF file inside the jar to find the entrypoint. There is no

sbt value not found addSbtPlugin when installing onejar plugin

你。 提交于 2019-12-08 12:41:44
问题 I'm trying to install the one-jar sbt plugin but am getting the following error: sbt/project/plugins/plugins.sbt:5: error: not found: value addSbtPlugin addSbtPlugin("com.github.retronym" % "sbt-onejar" % "0.6") Here is the relevant contents of my sbt/build.sbt file: seq(com.github.retronym.SbtOneJar.oneJarSettings: _*) name := "dsg_nlp" version := "0.11" scalaVersion := "2.9.1" libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "1.6.1" % "test" ) libraryDependencies += "commons

Trying to run executable jar of JavaFX app - Error: JavaFX runtime components are missing

六月ゝ 毕业季﹏ 提交于 2019-12-08 10:06:56
问题 I've created a JavaFX 11 app that is ready to be deployed. I use Gradle 5.0 as my build tool and this command to compile the jar: jar { manifest { attributes( 'Main-Class': 'checkmydigitalfootprint.MainApp' ) } from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } } Then on command line I've tried different commands to run the jar file: java -jar CheckMyDigitalFootprint.jar java -jar CheckMyDigitalFootprint.jar --module-path="/users/joseph/eclipse-workspace

A JNI error has occurred, while executing .jar file from command prompt

白昼怎懂夜的黑 提交于 2019-12-08 09:37:04
问题 I have created two java file my maven project one is POJO class and another one is java main class file. I want to make my project as an executable jar file which i want to run externally using java -jar command. Please find my pom.xml file <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId

why exec('java -jar file.jar') dont work on browser but works on command line?

时光毁灭记忆、已成空白 提交于 2019-12-08 09:35:16
问题 I try to run an jar from an php file like this: exec("java -jar /home/florinbuda/NetBeansProjects/monkey1/dist/monkey1.jar", $result); print_r($result); and IT WORKS if I run it from command line like: $ php runner.php but it doesn't work if I try to load it via http-localhost-server/runner.php the page just keeps loading forever without giving any error.. In the .jar file I added a simple test to now if the jar is even started to work public static void main(String[] args) { new File("/home

Unable to scan components from sub-package - Spring Jar

蓝咒 提交于 2019-12-08 09:35:03
问题 I'm developing a spring command line app which uses dependency of external jars. When I run the app from eclipse it works perfectly, but when I export it as runnable jar it fails to autowire the dependecies from the sub-package. However if I write each bean definition in spring-context, then it works. What is the problem with it? Is @Component not working or component-scan base package or something else? Here is Spring-context.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http:/

How to know the directory of jar file in java? [duplicate]

旧时模样 提交于 2019-12-08 06:26:13
问题 This question already has an answer here : Getting filesystem path of class being executed [duplicate] (1 answer) Closed 4 years ago . I have an executable jar file and I want it to be able to read and write info to a txt file that is located at the same dir as the .jar file is. How can I do that? How can I get the executable jar file dir path. It only has to work on windows platform and it's a desktop application. 回答1: You don't need to specify full path in order to create new files, java

BlackBerry Cannot run program “jar”: CreateProcess error=2, The system cannot find the file specified

家住魔仙堡 提交于 2019-12-08 05:58:08
问题 I am developing a BlackBerry Application with a number of class files in it; 16 java classes at the moment and they keep increasing as this App is complex with a lot of screen and features. I am working in Eclipse with the BlackBerry Java Plug-in. I am using BlackBerry JRE 6.0. I have recently started getting the following error: Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified I have Google for this error and many suggest this is caused by

JavaFX 2 Window Icon not working [closed]

这一生的挚爱 提交于 2019-12-08 05:26:54
问题 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 . I'm trying to add an Icon to my JavaFX 2 application, but the ways I have found don't seem to work. Image icon = new Image(getClass().getResourceAsStream("/images/icon.png")); stage.getIcons().add(icon); The icon is 32x32 in size. When I try Image icon = new Image("http://goo.gl/kYEQl"); It does