jar

Missing SLF4J logger on spark workers

不打扰是莪最后的温柔 提交于 2020-01-14 01:37:22
问题 I am trying to run a job via spark-submit . The error that results from this job is: Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2625) at java.lang.Class.getMethod0(Class.java:2866) at java.lang.Class.getMethod(Class.java:1676) at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494) at sun.launcher.LauncherHelper.checkAndLoadMain

How to put eclipse jdt jar libraries in Java Build Path?

耗尽温柔 提交于 2020-01-13 11:00:08
问题 I'm trying to use eclipse jdt , and I tried to import related modules in java source file. I have a bunch of errors as the jdt libraries are not in Java Build Path. I tried to open Add Libary -> Plug-in Dependencies , but it doesn't have the jdt jar files. I could use Add External JARs to point to all the jar files, but I don't think it's a good idea considering I have to do the same thing over and over again with new projects. In this case, how to put eclipse jdt jar libraries in Java Build

OSGI Bundle vs jar dependency

∥☆過路亽.° 提交于 2020-01-13 08:57:09
问题 I'm trying to understand the difference between the following <dependency> <groupId>com.myspace.order</groupId> <artifactId>dal</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> AND <dependency> <groupId>com.myspace.order</groupId> <artifactId>dal</artifactId> <version>1.0.0-SNAPSHOT</version> <type>bundle</type> </dependency> The dal artifact itself has packaging specified as bundle as: <packaging>bundle</packaging> Now when I deploy the dal artifact, I see it published in the

IntelliJ compile for Java 7 JRE using Java 8 SDK

允我心安 提交于 2020-01-13 07:38:10
问题 I have the Java 8 SDK and runtime, and a project that is only using Java 7 features. I was wondering whether I could set up intellij to build a Java-7-level jar, something that is definitely possible from command line? So far, I have tried simply setting the project language level to 7 as an experiment, but that is obviously insufficient and not really what I need. I have also seen this question on SO: "Intellij IDEA using java7 compiler to compile when I have configured it to use Java6", but

How do I create a JAR with m2e (m2eclipse)?

天大地大妈咪最大 提交于 2020-01-13 03:12:30
问题 I'm new to Maven and m2e. It frustrates me that I have to ask this question, but the sparse m2e documentation and Google are failing me. How do get m2e to build a JAR? I understand that this should happen during the maven package phase, but m2e doesn't seem to do this as part of the build process and I can't find a way to explicitly execute the package phase in Eclipse (nor any other phases that aren't part of the default build). Thanks. 回答1: As long as you have your POM.xml file with the

IntelliJ include external JARS in JavaFX JAR file

狂风中的少年 提交于 2020-01-12 05:45:31
问题 How can I include all the jar files under lib in my main jar file produced ? Is IntelliJ meant to create JAR files or not ? Cause I can't seem to make it work. Here are some screens from my setup: And the result: Could somebody explain to me why the other JAR file is generated outside my main JAR file? AM I supposed to ship 2 JARS? 回答1: Go like this for one jar: Right click > Open Module Settings > Artifacts > + > JAR > From module with dependencies Then choose main class and select EXTRACT

Load jar dynamically

ε祈祈猫儿з 提交于 2020-01-11 12:56:10
问题 In my java application, I read a jar file (packaged with Maven shade plugin) into a bytestream. In the jar there is a entrypoint class defined in POM.xml <build> ... <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>com.mycompany.TheEntryPoint</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build> How do I load such class into my java app dynamically? Update:

including source files in runnable jar file

流过昼夜 提交于 2020-01-11 11:55:34
问题 I have to create the installer with runnable jar file ,when the jar file will run it has to copy the files on some directories. I have included few folders in the java project as in the below image : I have to paste dcc, contactless and vfsc5000 folder on to certain directories. I am using this piece of code : public class copyFiles { // private static final String MAIN_PATH = "C:\\Users\\Hamza\\Documents\\"; private static final String MAIN_PATH = "resources"; public static void main(String[

Importing Class from External Jar, Android

扶醉桌前 提交于 2020-01-11 10:22:11
问题 I created a new library and added the jars from web harvester to do a bit of web scraping in my android project. in my main activity I import classes that I need. but starting the project on my phone I get a 08-23 08:28:09.763: ERROR/dalvikvm(2123): Could not find class 'org.webharvest.definition.ScraperConfiguration', referenced from method html.parser.MainActivity.onCreate any ideas? 回答1: Take a look here http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary

java.lang.NoClassDefFoundError: when trying to run jar

扶醉桌前 提交于 2020-01-11 04:43:07
问题 I have a spring boot project using gradle apply plugin: 'java' apply plugin: 'idea' apply plugin: 'jetty' apply plugin: 'war' apply plugin: 'org.springframework.boot' repositories { mavenCentral() } dependencies { compile("org.springframework.boot:spring-boot-starter-web:1.5.1.RELEASE") { exclude module: "spring-boot-starter-tomcat" } compile group: 'org.springframework.boot', name: 'spring-boot-starter-jetty', version: '1.5.1.RELEASE' compile group: 'org.springframework.boot', name: 'spring