jar

Java Swing: Images not Displaying when run from jar file

时光总嘲笑我的痴心妄想 提交于 2019-12-25 12:46:50
问题 Swing application and it's Images are running fine in eclipse. but when i run from jar file, images not displaying. I tryed to load images in different way, but some time jar file not executing. My image folder is inside of source folder. I load my images with: 1.Running fine in eclipse, but not in jar ImageIcon right = new ImageIcon("./chack img/Green Tick 1.PNG"); 2.Running fine in eclipse, but jar file not executing. ImageIcon wrong = new javax.swing.ImageIcon(getClass().getResource("

how to create jar file in netbeans

走远了吗. 提交于 2019-12-25 12:09:08
问题 I want to create independent jar files in netbeans like we can do in eclipse. Normally people suggest to clean and built the project and there is a jar file created. But to run these jar file the .java files, the codes are also required. Isn't there any way to create jar files which runs independently without requiring java codes? Thanks 回答1: set the main class in run configuration do a clean build go to the dist folder and you can find the jar there as a runnable one for further information

Trying out Cloudera Spark Tutorial won't work “classnotfoundexception”

孤街浪徒 提交于 2019-12-25 11:14:09
问题 I tried solutions suggested in similar existing post but none works for me :-( getting really hopeless, so I decided to post this as a new question. I tried a tutorial (link below) on building a first scala or java application with Spark in a Cloudera VM. this is my spark-submit command and its output [cloudera@quickstart sparkwordcount]$ spark-submit --class com.cloudera.sparkwordcount.SparkWordCount --master local /home/cloudera/src/main/scala/com/cloudera/sparkwordcount/target

Should the version be appeared in the name of .jar files? [duplicate]

烂漫一生 提交于 2019-12-25 09:42:51
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Jar file naming conventions Currently, I've decided to standardize the name of my .jar files. In many projects, the version of the .jar files appear in the name, e.g. richfaces-3.0.1.jar. Is it a good naming style or should I mention the version of the .jar file in its manifest? If it is better, should I use this style for my internal releaseses? 回答1: You should use Version numbers in your jars. Look at pages

Hadoop external jars

江枫思渺然 提交于 2019-12-25 09:35:14
问题 I am trying to run a hadoop job on a server. The version is 0.20.2 . I have a big amount of jars, I am running: hadoop jar GenData.jar -libjars /path/jar1,path/jar2,... I am getting the error below even if the corresponding classes are inside the jars: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/avro/mapreduce/AvroKeyInputFormat at GenerateTrainningData.main(GenerateTrainningData.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect

Including Signed Libraries in Executable JAR with Maven

时光毁灭记忆、已成空白 提交于 2019-12-25 09:31:50
问题 Maven shade and assembly plugins first unpack and then add dependencies to the executable jar. This can produce a conflict with Java Cryptography Extension, since the libraries like BouncyCastle should be used in their signed versions. Question: Is there a way to create executable jar with maven in a way that the libraries are included without unpacking? 回答1: The standard classloader will not load classes from another jar, hence the exploded jar. The best way to achieve adding the signed jars

Dynamic loading and unloading of jar

拜拜、爱过 提交于 2019-12-25 08:57:14
问题 We have a java based (jersey+grizzly) REST Server which exposes calls like foo.com/{game}/rules foo.com/{game}/players foo.com/{game}/matches There can be arbitrary number of games Each game has different implementations for rules, players, matches For historical reasons, we would want separate jars for each game implementation So there is REST Server as and when there is a call like foo.com/tennis/rules we want the REST Server to dynamically load 'tennis' jar. The jar does its operation.

Uiautomator Didn't find class <class> on path DexPathList

霸气de小男生 提交于 2019-12-25 08:45:00
问题 I am currently developing a Java project in order to perform automatic screenshots of my Android application, however, when performing the uiautomator command: adb shell uiautomator runtest AutoScreenshot.jar -c test.ScreenshotRoutine I am getting the following error: INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException INSTRUMENTATION_RESULT: longMsg=Didn't find class "test.ScreenshotRoutine" on pa th: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "

how to know .jar file directory [duplicate]

拥有回忆 提交于 2019-12-25 08:40:29
问题 This question already has answers here : Closed 8 years ago . Possible Duplicates: Where on the file system was my java class loaded from? How do I get the directory that the currently executing jar file is in? How can i know .jar file directory within my program i want to use this directory to create another files in same directory which user save this .jar file 回答1: I don't think you can easily find out where the JAR file is, but you can find out which directory your program is being run