FAQ Database Discussion Community


Splash screen not display when execute by Jar File but it works when execute from Netbeans IDE

java,netbeans,jar
Set application Splash Screen from Project properties -> Run Option SplashScreen which draw by StartApp Class public class StartApp { public static void main(String[] args) { new Thread(new Runnable() { public void run() { splashInit(); // initialize splash overlay drawing parameters appInit(); // simulate what an application would do before...

Self Delete jar from Windows batch file

java,windows,batch-file,jar,cmd
I have a Java application that should update itself by downloading a new version online, and then it should self-delete itself, i already managed the update, now i need to delete the old jar file. Since my app will be running only on windows i thougt that i could use...

OutofMemoryErrory creating fat jar with sbt assembly

jar,cassandra,apache-spark,sbt
We are trying to make a fat jar file containing one small scala source file and a ton of dependencies (simple mapreduce example using spark and cassandra): import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import com.datastax.spark.connector._ import org.apache.spark.SparkConf object VMProcessProject { def main(args: Array[String]) { val conf = new SparkConf() .set("spark.cassandra.connection.host", "127.0.0.1") .set("spark.executor.extraClassPath",...

Android Studio Can't Find tools.jar

java,android-studio,jar
In my searching I haven't found an answer to my issue. I have installed the JDK, and have even used Android Studio before on this machine. But now, when I try to run it, it is giving me the error: "JDK Required: 'tools.jar' seems to be not in Studio classpath....

Loading resource files within a jar

java,jar,io,loading
What's the best way to load resources (Sounds, images, xml data), that also works from inside a distributed jar file? I need to load some sounds, images, and xml data, for use in my program. Using AudioInputStream ais = AudioSystem.getAudioInputStream(new File("~/src/com/example/package/name/assets/TestSound.wav")); does not work in the jar, for obvious reasons,...

java - error while running compiled program with external jar

java,jar
I have a simple jsoup test app in a single folder, in which there are 2 classes - LyricsGetter.java and Main.java - and a .jar file with jsoup library. When I compile the files with command javac -cp jsoup-1.8.2.jar LyricsGetter.java Main.java everything compiles ok, but when I try to run...

Using Java Jar Utility

java,eclipse,jar
I found a jar utility that looks useful for some stuff I'm trying out. I downloaded the jar and put it in my eclipse lib and set the buildpath to include the jar. And now I'm trying to use the demo that was included on the git hub, but I'm...

hadoop - vertica jar

hadoop,jar,vertica
I am trying to transfer data from Vertica to hive. According to the manual the following should be set as the input format: -inputformat com.vertica.hadoop.deprecated.VerticaStreamingInput But the hadoop-vertica jar has org.apache.hadoop.vertica.VerticaStreamingInput class and not the above. So it is throwing me the following exception: Exception in thread "main" java.lang.RuntimeException: class...

Exporting Jar with Images

java,image,jar,export,exe
I am trying to export my Runnable Jar file that includes the image resources that goes along with my program. When I run the program in eclipse the paths work perfectly but when trying to export the program there are no images. I have been exporting by choosing the package...

Import java package from Matlab deploytool to Android Studio App

java,android,image,matlab,jar
I managed to create a java package from a Matlab function (for image processing) using deploytool. I tested it in Eclipse and it runs perfectly. The problem is that I want to use this Matlab function for an Android Studio project and I can´t find any way to make it...

ant jar error: Execute failed: java.io.IOException: Cannot run program…${aapt}": error=2, No such file or directory

java,android,osx,unity3d,jar
I'm trying to compile a simple Java library for Unity, and after running ant jar, I get the following message: /Applications/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:649: The following error occurred while executing this line: /Applications/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:694: Execute failed: java.io.IOException: Cannot run program "/Users/****/UnityProjects/****/JavaTestPlugin/${aapt}": error=2, No such file or directory This is strange, because I've compiled this...

Failed to make a jar file outside JDK_HOME

java,jar
I am studying Java Web Start and JNLP. The problem is in making a jar file. When i saved my .class file at location C:\ProgramFiles\Java\jdk1.8.0_25\bin and access this location through command prompt and by using this command "jar cvf WelcomeApplet.jar *.class" my jar file will perfectly made but when i...

Recursively read images from an executable JAR file

java,arraylist,jar,java-8,executable-jar
I am trying to display a number of BufferedImage elements stored in an ArrayList<BufferedImage> by first reading them from the disk to the arraylist then iterating across the arraylist. Since the images are organised into subfolders on the filesystem, I read them into the arraylist with private void storeImages(final File...

IntelliJ Idea - generating JAR for project: libraries are not included

java,intellij-idea,jar
I'm using IntelliJ Idea (14.1.2) to develop a simple java command-line application. My application is composed of two modules: A main module that just contains the "main" class A library module that contains the actual code that "does things" (this module also includes and use a maven library) Everything works...

Schedule to run a executable jar file on windows 7

jar,windows-7,scheduled-tasks
I created a task in task scheduler on Windows 7 system and made it repeatable every 10 minutes. In program, i selected the executable java jar file. But it does not run the jar file at the scheduled time. When i double click and run the jar file, it runs...

NoClassDefFoundError occurs when running .jar file

java,jar,noclassdeffounderror
For school we are learning about .jar files and how to create them. Below I have code for a simple GUI component and Viewer. package mp6; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JComponent; public class HelloComponent extends JComponent { public void draw(Graphics2D g2) { g2.setFont(new Font("Arial", Font.ITALIC,...

Running a specific spring batch job amongst several jobs contained withing a spring boot fat jar

java,jar,spring-boot,spring-batch
I am trying to run a spring batch job from a spring boot fat jar and I am having issues referencing the nested jars. Here is the command I use: java -cp bignibou-batch-core/build/libs/bignibou-batch-core.jar:lib/spring-batch-core-3.0.3.RELEASE.jar org.springframework.batch.core.launch.support.CommandLineJobRunner com.bignibou.batch.configuration.BatchConfiguration mailingJob Notice how I reference the nested spring batch jar using the colon. Why is...

Access resource from inside jar

java,jar,classloader
I got a jar file test.jar that contains a folder resources which contains txtFile.txt. I'm trying to access the file but the file seems to be null. package main; import java.net.URL; public class Test { private Test() { URL file = this.getClass().getClassLoader().getResource("/resources/txtFile.txt"); System.out.println(file == null); } public static final void...

Cannot run jar file created from scala file

scala,jar,build,sbt
This the code that I have written in scala. object Main extends App { println("Hello World from Scala!") } This is my build.sbt. name := "hello-world" version := "1.0" scalaVersion := "2.11.5" mainClass := Some("Main") This is the command that I have run to create the jar file. sbt package...

Writing to a text file within a jar file

java,jar,outputstream
I was recently trying to export my game to a jar file, and I ran into a problem with converting files to input and output streams. With the regular code that was not exported, I was able to read and write to text files by simply calling the Scanner and...

Include jar to SoapUI maven

maven,jar,maven-plugin,soapui
I wrote my own library to maven. I include the jar file like this: http://www.soapui.org/extension-plugins/old-style-extensions/developing-old-style-extensions.html and everything is OK. But, i wanna run my SoapUI projekt in maven. How i can include this library?...

Adding jar file to add class in a java project using ant command line

java,android,ant,jar,import
I have looked for hours on the net but could not find an answer to the following question(s)... I have an android project that runs OK using "ant release" command line (for various reasons I cannot use Eclipse nor Android Studio, etc.) on MacOSX. I need to extend a 3rd-party...

How to test a function that copies a folder out of its own JAR file?

java,maven,jar,resources,embedded-resource
I have a function (see below) that copies all files of a specific folder from its own JAR. For this function (see below too), I want to write tests, but the tests will be executed before the JAR is builded (it's a maven project) . One important part of this...

Android live build jars: arm64, armabi, mips, mips64, x86

android,jar,x86,mips
I am using an external library that uses a native lib. In my APK (and inside this external library) separate jars are packaged for: arm64-v8a armeabi armeabi-v7a mips mips64 x86 x86_64 There jars are quite large. I want to remove some of them. Are there any LIVE devices using x86?...

jar class cannot be resolved to a type

java,spring,maven,jar
I am working in Spring MVC, and was given an executable jar file with few classes and to add in my project. I added that jar using build path as external jar. Then I used a class in that jar file to call a method which returns a string. I...

java.lang.SecurtiyException at unsigned jar's

java,jar,certificate
I'm facing a SecurityException at runtime: java.lang.SecurityException: class "util.OpenNItoDTW"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(ClassLoader.java:952) where util.OpenNItoDTW is my own class wich using a 3rd party jar. According to this the jar's have to be signed using the same certificate....

Using JAR Files

java,jar
So I'm still a noob in Java and I'm experimenting around with a few things. I recently created a .jar file for my class using jar cvf <name>.jar <source files> and then used that jar to compile my driver class (javac -cp <name>.jar Driver.java) though how do I now run...

Package Java 1.7+ Only Classes with JAR 1.6

java,eclipse,jar,copy,compliance
I have an issue where I want to copy Files from one directory to another directory. Path source = Paths.get(files[i].getPath()); Path target = Paths.get(dir.getName() + "/" + files[i].getName()); try { Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING); files[i] = target.toFile(); } catch (IOException e) { throw new IOException("\t\tUnable to move " + files[i].getName(), e);...

BouncyCastle SecurityException throws only when the *bcprov*.jar is packaged into the generated JAR

java,jar,bouncycastle
I have a strange problem. I wrote a Java application to do some cryptography things (encrypt with AES and digital signature with ECDSA). I decided to use the BouncyCastle API...I tried my application in Eclipse and everything went good. Then, I exported the application into a 'Runnable JAR File' with...

Add txt files to a runnable JAR file

java,jar
I'm trying to make a runnable jar file and I'm having problems with my .txt files. My program also have images, but fortunately I've figured out how to manage them. I'm using something like this with them and it works just fine both Eclipse and the jar: logoLabel.setIcon(new ImageIcon(getClass().getResource("/logo.png"))); My...

apache spark: akka version error by build jar with all dependencies

java,maven,jar,apache-spark,executable-jar
i have build a jar file from my spark app with maven (mvn clean compile assembly:single) and the following pom 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>mgm.tp.bigdata</groupId> <artifactId>ma-spark</artifactId> <version>0.0.1-SNAPSHOT</version>...

Eclipse connection refused when remote debugging

java,eclipse,jar,remote-debugging
I've been following this tutorial which is how to setup remote debugging. I have my Jar running debug mode listening on port 6065 on my server with the following setting: -Xrunjdwp\:transport\=dt_socket,server\=y,address\=6065,suspend\=n I start the JAR on my server with jar in debug mode with: myApplicationThatContainsJar.exe -debug "my application" > Now...

Setting classpath at runtime

java,jar,libraries
I have a java file called EXICodec.java which performs various operations thanks to the jar exificient.jar. They are in the same folder. Here is the structure of the file EXICodec.java : import java.io.FileInputStream; import java.io.FileOutputStream; [...] import com.siemens.ct.exi.helpers.DefaultEXIFactory; public class EXICodec { /* * Main */ public static void main(String[]...

Extracting a zip file containing a jar file in Java

java,jar,zip,unzip
I want to extract a zip file which contains a jar file. This file has complex folder structure and in one of the folders there is a jar file. When I am trying to use the following code to extract the jar file the program goes in infinite loop in...

How rebuild a jar file?

java,jar,rebuild
I have a jar file with following directory: css/ images/ js/ META-INF/ atlassian-plugin.xml jira_rtl.properties LICENSE I want to change the file.css in css directory and then rebuild the jar file. How Can I do this in Windows 8.1 OS?...

How do I change the package name of classes inside a JAR? [duplicate]

java,jar,java-bytecode-asm
This question already has an answer here: Hand Edit A Jar to Change Package Names 6 answers Typical problem - I have x-1.0.jar, x-2.0.jar and y-1.0.jar. I want to use x-2.0.jar and y-1.0.jar but y-1.0.jar depends on x-1.0.jar. There is a tool out there which allows you to bundle...

Android Eclipse not Responding Adding Jar

java,android,eclipse,jar
I have some jar files to be added in my project. Add those jar files as External Jar files in Java Build Path for my project but it has java.lang.VerifyError when I run the project: Could not find class 'com.sforce.ws.ConnectorConfig', referenced from method Add those jar files to my libs...

How does gradle choose certain urls to look in for a repository? How do I point it in the right direction so that I can import this JAR?

android,android-studio,jar,gradle,commonsware-cwac
In order to fetch the cwac-camera commonsware jar, I have this in build.grade: dependencies { compile 'com.commonsware.cwac:camera:0.6.+' } when I try and compile, it gives me this: Error:A problem occurred configuring project ':app'. > Could not resolve all dependencies for configuration ':app:_debugCompile'. > Could not find com.commonsware.cwac:camera:0.6.12. Searched in the...

Shell script with jar file at the end

java,shell,jar
I download an archive file. In the archive there will be a file that has a .sh. extension. When I opened that file with VI I found the below code in the beginning of the file: #!/bin/sh MYSELF=`which "$0" 2>/dev/null` [ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"...

ClassLoader classes are not properly loaded in the thread

java,jar,jboss,casting,classloader
I am creating a new classLoader using URLClassLoader and trying to set it as the classLoader for the current thread. But it is not working properly for me. As per my understanding, if I set a classLoader to the current thread, the methods and interfaces referenced by the Current Thread...

How to include a jar file into scala code [duplicate]

java,scala,jar,sbt
This question already has an answer here: How to make a jar file from scala 3 answers This is the scala code that I have written object Main extends App { println("Hello World from Scala!") } This is my build file name := "hello-world" version := "1.0" scalaVersion :=...

Runnable jar with dependencies [duplicate]

java,maven,jar
This question already has an answer here: How can I create an executable jar with dependencies using Maven? 23 answers I'm writting the sameple AspectJ project - github. I've created the following pom.xml: <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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.badmitrii</groupId>...

Running a JAVA project with external jars folder

java,jar,classpath
I'm trying to execute my JAVA app on a Linux OS where the necessary jars are located in a different folder. How can I execute my project using the external jars? project location: $ pwd /root/MyApp/bin $ ls Deletion.class jars location: /opt/jars/*.jar My failed execution: $ java Deletion ... NoClassDefFoundError...

Exception with JavaFX jar

jar,javafx,include,export
I have export a FX Project as Jar, this exception show me. http://www.bilder-upload.eu/show.php?file=4eae98-1432897954.png http://www.bilder-upload.eu/show.php?file=aace07-1432898009.png I have tested an easy FX project without includes without errors. I believe its about wrong includes path. Do you have got any idea what i did wrong? Update Here is the code where the FXML...

How to compile and run HelloWorld.java example from Sphinx4 without and IDE in Linux?

java,linux,eclipse,jar,sphinx4
I have been testing the examples (HelloWorld.java) from Sphinx4 with Eclipse, but I would like to compile and run them from the command line. The application needs 5 .jars to be able to run, I have read that in order to compile a java class with multiple .jars I need...

Eclipse: Maven Module missing artifact - .jar not created

java,eclipse,maven,jar
I have a server project consisting of a few Maven Modules. I was now about to create another one that is supposed to contain objects that the server and any (Java) client shares. It appears that due to the Maven dependency it expects me to deliver a .jar file. In...

can a class in a jar use a class in a different jar

java,eclipse,maven,jar
I am new to java so not sure I fully understand jar files. I want to put some common code in a library jar, which I then use from applications that are in different jars. I have searched on this but only come up with people saying yes and then...

IntelliJ correctly using Libraries

java,intellij-idea,jar
I'm using IntelliJ without a build tool for a project, I build it as a jar. Now I'm using the iText library for PDF(s), if I put all the iText jars into a folder and add it in IntelliJ, I can use the iText functions and if the program works,...

Java program with referenced libraries: NoClassDefFound [duplicate]

java,jar,terminal,classpath,command-line-interface
This question already has an answer here: NoClassDefFound when trying to run java with external libraries 4 answers How do I run a program in Java, with several referenced libraries, .jar files, from a command line? I have put all my .jars in /lib folder, which is in the...

How to run classes inside Jar file?

java,eclipse,selenium,jar
I created a jar file that launches an application to allow the user to select which test they want to run. Each test has its own class and main method. The UI application passes parameters to the main method for the class that represents the test. I was able to...

Error in executing a Jar file in remote machine

java,ssh,jar
I am trying to executing a jar file which is present in remote machine. When I execute below command from my local machine I get error: ssh -i /root/.ssh/pem_file user@[host_ip]:/home/user/folder1/java -cp jar1.jar -a option1 -e [email protected] -f TextFile.txt /home/user/folder1/ is the location where jar file is present on remote machine.The...

Works in Netbeans, but not “outside” of it

java,netbeans,jar
This code works perfect when I press PLAY in netbeans, but when I build it and start the Jar file it will not. private void SettingsMouseEntered(java.awt.event.MouseEvent evt) { ImageIcon Setting = new ImageIcon(getClass().getResource("/pic/settings-icon.png")); Settings.setIcon(Setting); HooverBar.setText("Settings"); } private void SettingsMouseExited(java.awt.event.MouseEvent evt) { ImageIcon Setting = new ImageIcon(getClass().getResource("/pic/settings-icon-half.png")); Settings.setIcon(Setting); HooverBar.setText(""); } private...

Compile with ant classpath issue with JUnit

java,ant,junit,jar,compilation
I am having a compile issue with ant, junit.jar cannot be found here is my build file: <path id="lib"> <fileset dir="library"> <include name="*.jar" /> </fileset> </path> <target name="test"> <mkdir dir="tmp/reports" /> <mkdir dir="tmp/build" /> <javac srcdir="test" destdir="tmp/build" includeantruntime="false"> <classpath refid="lib" /> </javac> <echo message="Build done" /> <junit fork="yes" haltonfailure="yes"> <batchtest...

Valid Jar Clasifiers

java,maven,jar
I am attempting to build and publish a test source jar to accompany a test jar. I have seen "test" and "src" used as classifiers for jars, but I have not see anything for a test src jar. Additionally I have not been able to find any documention on valid...

How to launch a jar file on windows startup from the registry?

java,windows,jar,registry
I am trying to launch a jar file on Windows Server 2008 R2 startup. I tried to add a key\value to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run I tried as a value several alternatives: java -jar c:\jcm\jcm.jar "java -jar c:\jcm\jcm.jar" c:\program files(x86)\java\jre1.8.31\bin\java.exe -jar c:\jcm\jcm.jar "c:\program files(x86)\java\jre1.8.31\bin\java.exe -jar c:\jcm\jcm.jar" "c:\program files(x86)\java\jre1.8.31\bin\java.exe" -jar c:\jcm\jcm.jar But none of...

Why doesn't java honour the class path when executing a jar file with the -jar switch?

java,jar,classpath,rxtx
This works: $ java -cp ".:/PATH/TO/RXTXcomm.jar:./jobexftp.jar" -Djava.library.path=/usr/lib/jni com.lhf.jobexftp.StandAloneApp JObexFTP 2.0 beta (15/10/2010) Java Obex File Transfer Protocol application and library Developed under/using 100% free software. For more information access: http://www.lhf.ind.br/jobexftp/ Usage: jobexftp <serialPort> [<commands>] [<options>] ... This doesn't: $ java -cp ".:/PATH/TO/RXTXcomm.jar" -Djava.library.path=/usr/lib/jni -jar jobexftp.jar Error: A JNI error has...

Unable to import import com.google.api.client.http.HttpTransport

android,jar,google-api-java-client
I am unable to import com.google.api.client.http.HttpTransport I have tried downloading all dependencies from https://developers.google.com/api-client-library/java/google-api-java-client/download And then adding them to my project by Project > Open Module Settings > Dependencies > + > File Dependency > google-api-client-android-1.20.0.jar > OK With no luck....

How to add external third party jar in Notes Xpages application?

java,jar,xpages,lotus-notes
I am Java developer, recently working on Xpages project. we are using Notes 9.0.1. I created Java agent to send email and I want to use some third party jar, something like org.apache.commons.lang3 , end up this issue. how to add third party jar, like commons-lang3-3.4.jar, in my Xpages project?...

Missing jar files in Eclipse RCP 4.4.2 (Luna SR2) SDK, delta pack and language pack

jar,eclipse-plugin,eclipse-rcp,java-8,eclipse-luna
We have an Eclipse RCP based GUI application based on Eclipse SDK 3.7.2 and compiled using Java 7. We are migrating the code base to Java8. We are also migrating Eclipse version to 4.4.2 (Luna SR2) as Eclipse supports Java8 starting 4.4. I have downloaded eclipse-4.4.2-delta-pack.zip and eclipse-SDK-4.4.2-win32.zip and built...

Running JAR file from terminal (Runtime.getRuntime().exec) with both native and .jar dependencies

java,linux,jar,path,classpath
I am having trouble running a JAR file from terminal which has both native and .jar dependencies. Okay, my goal isn't to run it from the terminal, but to run it as a separate process with Java's Runtime.getRuntime().exec function, but if I can't run it from the terminal, then I...

Proper way to make a Spark Fat Jar using SBT

scala,jar,apache-spark,sbt,sbt-assembly
I need a Fat Jar with Spark because I'm creating a custom node for Knime. Basically it's a self-contained jar executed inside Knime and I assume a Fat Jar is the only way to spawn a local Spark Job. Eventually we will go on submitting a job to a remote...

NoClassDefFoundError() with custom Kafka Producer

java,eclipse,jar,apache-kafka,kafka-consumer-api
I am trying to include Kafka module in my project. I have added the following jars as external jar libraries in eclipse and have also update the build.xml to include the references to the jar: kafka-clients-0.8.2.0.jar kafka_2.10-0.8.2.0.jar scala-library-2.10.4.jar I wrote a sample Producer class public class KafkaWriteRequestProducer extends Thread {...

Running a jar file from terminal in ubuntu

java,ubuntu,jar,terminal
I have a jar file , which when i execute by java -jar firstjar.jar I get the following errors Error: Invalid or corrupt jarfile firstjar.jar Here is my manifest file Manifest-Version: 1.0 Created-By: 1.7.0_79 (Oracle Corporation) Class-Path:mysql-connector-java-5.1.28.jar Main-Class:JavaApplication1 Contents of jar file 0 Wed May 13 14:09:06 IST 2015 META-INF/...

ClassNotFoundException with Parse and Facebook

java,android,facebook,jar,parse.com
I am hoping you can help me with a problem I am facing. I am trying to integrate Facebook login to my app using Parse, and I get a ClassNotFoundException error, when I call the method ParseFacebookUtils.logInWithReadPermissionsInBackground(LoginActivity.this, permissions, new LogInCallback() The error stack trace: 05-15 10:36:00.749 3936-3936/kstr14.tipper E/AndroidRuntime﹕ FATAL EXCEPTION:...

After jarring images do not show

java,image,graphics,jar
public class LidPop extends Projectile { private int x; private int y; private int l = 3; private int h = 18; private int dx = -3; private Image i; public LidPop(int x, int y) { this.x = x; this.y = y; String rootPath = System.getProperty("user.dir"); String imgPath = rootPath...

Using jar file in another project

java,eclipse,jar
I have one jar file, named pwd.jar and I want to use that in another project named sample. How can I do that? What are all the steps I should perform? Note: I am using Eclipse IDE...

Compiling multiple jar and java files using javac

java,jar,javac
I downloaded a sample code written in java that has multiple jar files and java files. I am not a Java programmer so I am having a hard time compiling the code. Here's my attempt: javac -classpath lib/*.jar src/*.java However this is what I get: javac: invalid flag: lib/dom4j-1.6.1.jar Usage:...

Create Jar Library Without a Main Class

java,intellij-idea,jar,main
Today I have just created a Java Library (download it from this page). I created it using a Main class, since IntelliJ IDEA 14 asked me to add one. However I want it to be a normal library, without any Main classes. Is it possible to create a jar file...

Is a 50M jar file reasonable from 5k lines of scala code?

scala,jar,sbt,filesize,sbt-assembly
I'm building a scala project with ~5k lines of code so far. I'm creating a jar file with sbt assembly. It's coming out to 50M, which is much larger than I'd naively expected. Is this a reasonable sort of size or does it sound suspiciously bloated? I'm just hoping for...

how to create a jar file from android studio

java,android,jar,aar
I have a fairly latest version of android studio, I have created a module under a project which is basically supposed to be a library, when I build it, it creates an ".aar" file , what I want is .jar file as this library is supposed to be used with...

Bash - Find a java class and its jar directory by searching whole system

java,bash,unix,jar
I have the following script which does close to what I need; that is, to search the whole system for jar files that contain a specific java class file. My only issue with this script is getting it to acknowledge when it has found a class file in the jar...

Running a java program through command line

java,jar,javac
I am running a Java program with the following command: java -cp .:./* com.bot.fix.botclient All the jar files are in the same directory. It works FINE! But what if I want to run it from a different folder? The full location of the java program is: FIX/fixprog/src/com/fix/botclient But if I...

Eclipse run my program well however JAR-file does not

java,eclipse,swing,jar,nullpointerexception
I have four classes in my game; Player.java, Game.java, Island.java and Map.java. And basically its plenty of code to link here however my issue is that my program works fine in eclipse but when i export as jar and run it nothing is opened so i open it with CMD...

java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonFactory

java,jar,noclassdeffounderror,live-streaming,youtube-data-api
I am working on YouTube broadcast sample examples. I have created a sample Java Project & added required jars. But, when I try to run the project it throws exception. Exception : Throwable: com/fasterxml/jackson/core/JsonFactory java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonFactory at com.google.api.client.json.jackson2.JacksonFactory.<init>(JacksonFactory.java:44) at com.google.api.services.samples.youtube.cmdline.live.Auth.<clinit>(Auth.java:35) at...

Issues with reading xml file after creating jar

scala,jar,fxml,scalafx,onejar
We are building an application using ScalaFX. When I run the project in IntelliJIDEA, everything works fine. However, when I create jar file and try to execute it, I am getting errors in reading some xml file. I tried various solutions posted in SO, but with no use. package com.app.adt...

Missing libraries in side jars

java,maven,jar,build,war
I have 2 maven projects: 1 a jar with different dependencies and a war that include all that jar. When I look inside the created Jar I dont see any library folder. And when I look in to the War I only see the libs that the war is using...

Ubuntu Apache Storm jar Error: Could not find or load main class storm.starter

apache,jar,storm
I was following the https://github.com/apache/storm/tree/master/examples/storm-starter . I'm using Ubuntu 14.04 LTS on my VMWare. I can run mvn exec:java -D storm.topology=storm.starter.RollingTopWords in /home/user/storm/examples/storm-starter directory smoothly without problem. However I can't run it in Apache Storm. I had storm-starter-topologies-0.9.3.jar in my /home/user/storm/examples/storm-starter directory. I also had storm-starter-0.9.3.jar & storm-starter-0.9.3-jar-with-dependencies.jar in my...

Gradle: Adding sources.jar file within /lib folder of published dist.zip along with all my other dependencies

java,maven,jar,gradle
I have a java project that I am building using gradle. I am releasing a dist.zip folder for my project and I want to add the sources.jar for my project to the /lib subfolder within dist.zip. I am able to create a sources.jar file along with my dist.zip file but...

Docker running nginx plus jar

java,nginx,jar,docker,port
I'm trying to run a docker container that contains both a java jar server and nginx in front of it to perform subdomain->port forwarding, and I don't seem to be setting it up correctly. This is my Dockerfile: FROM java:8 MAINTAINER somefool RUN apt-get update RUN apt-get -y install nginx...

Start and Stop java process from JAR Fil

java,jar,executable-jar,runtime.exec
I am working on a multi-platform GUI for a project. The GUI needs to have the functionality to start and stop the other .jar file using buttons. The GUI is coded in Java and compiled as an executable Jar file. For example. When the JButton start is pressed the file...

Specifying classpath on execution

java,class,jar
I'm trying to specify the classpath of my package when i run my program, like this: java –cp .;my.package.jar MyMainClass my.package.jar lies in the same directory as MyMainClass.class. I'm getting this error message: Could not find or load main class ?cp It seems like it is not recognizing the switch...

NoClassDefFoundError: org/dom4j/io/SAXReader

java,eclipse,batch-file,jar,dom4j
I've currently imported the following import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.io.SAXReader; I'm running the program with the help of a BATCH file but it's throwing the following errors - C:\AISHU\WEB SERVICES>java -jar webservices.jar C:\AISHU\TEST FOLDER\formteest\fulltestxsd.xsd Exception in thread "main" java.lang.NoClassDefFoundError:org/dom4j/io/SAXReader at XsdToXmlActual.main(XsdToXmlActual.java:29) Caused by: java.lang.ClassNotFoundException: org.dom4j.io.SAXReader at...

Missing artifact in maven internal repository

java,eclipse,maven,jar,pom.xml
I have added two jar files to my internal repository and created its corresponding folder directory as shown below in image. but it is showing compile time error in my pom.xml where i have added the dependency for both the jars, saying "Missing artifact common:common-jar:jar:1.0" and "Missing artifact mediator:mediator-jar:jar:1.0" look...

how to read and write SQLite database file in java (after making jar file)

java,database,sqlite,jar
I want to create a java application which will use Sq Lite database and after making jar file my application will read and write Sq lite database file. So how to achieve this.... please give me overview how to access Sq lite database file and modify it. after making jar...

How to modify configuration file which is residing inside a JAR

java,jar
I would like to modify the configuration file which is residing inside the JAR. How to modify the configuration properties files which is residing inside a JAR file without Extracting?

How to run a .jar inside browser?

php,html,browser,jar
I tried to execute a .jar using HTML or PHP. In the first case i wrote the code bellow: <applet code=Diagnostica.class archive="Diagnostica/Diagnostica.jar" width="120" height="120"> </applet> This way dosen't work cause the file Diagnostica.jar need to contain an applet i suppose. So i tried the second option in PHP: exec("java -jar...

Gradle Jar structure is different than the real project structure

java,jar,gradle,build
I'm trying to build my project with gradle but for some reason the resources are put on a different level than their real level. Here's the build: apply plugin: 'java' version = '1.1' archivesBaseName = 'DesktopOmegle' repositories { //mavenCentral() maven { url 'http://oss.sonatype.org/content/repositories/snapshots/' url "http://repo1.maven.org/maven2" } } dependencies { compile...

.jar from netbeans will not open in console

java,netbeans,jar,console
Built a simple java program in netbeans, build/compiled it and it generated a .jar for me in the project directory. The following is my src code: import java.util.Scanner; public class Welcome { public static void main(String[] args){ System.out.println("Welcome to Java"); Scanner input = new Scanner(System.in); } } I want to...

Array Out of Bounce Exception for Jar, but not Eclipse

java,eclipse,jar
When I convert my Java project into a Jar file, an ArrayIndexOutOfBounds exception of -2 occurs in line 3 of this section of code: for (int i = 0; i < copy.get(copy.size() - 2).size(); i++) { if (!copy.get(copy.size() - 2).get(i).toString().equals(" ")) { startLocations[index] = Integer.parseInt(copy.get(copy.size() - 2).get(i).toString()); index++; } }...

Eclipse error using Maven filtering in persistence.xml

maven,jar,persistence,filtering
I have a Maven project with JPA using hibernate. I had to specify a jar file to load external classes in persistence.xml located in src/main/resources/META-INF <persistence unit name="PersistenceUnit" transaction-type="JTA" ... <jar-file>lib/${project.persistencejar}.jar</jar-file> using Maven filtering (the filename can change based on various Maven settings). I instruct then Maven to filter by...

External jar not importing in Eclipse Project

java,json,eclipse,jar,import
I wish to parse JSON and for that I have downloaded java-json.jar file from this URL. I have added this in Build Path by Right click on the Project Build Path -> Configure Build Path -> Add External jars. Selected the jar and it shows in the "Referenced Libraries" But...

How to run multiple JAR files at differnt locations from a command prompt

java,jar,command-prompt
I have 2 jar files at different locations. I need to run both these jar files from a single command prompt window. I referred to many SO links and google links and created this batch job. START SET JPOS_DIR=D:\Installable\JPOS\Iso8583jPOSJavaAgent-0.0.11 cd /D %JPOS_DIR% "C:\Program Files\Java\jdk1.7.0_75\bin\java" -cp Iso8583jPOSJavaAgent-0.0.11.jar com.hp.sv.iso8583.jpos.ISOForwarderMain START SET JPOS_DIR=D:\Installable\JPOS_Instance-2\Iso8583jPOSJavaAgent-0.0.11...

Jar I am I building is not finding jar dependencies

java,intellij-idea,jar
I am using intellij to create a jar file. I have 5 jar files in the project as dependencies. I have added these 5 jar files in the artifact setting as follows. I am able to run the project fine in intellij but when I try to run the jar...

Connecting from Spark/pyspark to PostgreSQL

postgresql,jdbc,jar,apache-spark,pyspark
I've installed Spark on a Windows machine and want to use it via Spyder. After some troubleshooting the basics seems to work: import os os.environ["SPARK_HOME"] = "D:\Analytics\Spark\spark-1.4.0-bin-hadoop2.6" from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContext spark_config = SparkConf().setMaster("local[8]") sc = SparkContext(conf=spark_config) sqlContext = SQLContext(sc) textFile = sc.textFile("D:\\Analytics\\Spark\\spark-1.4.0-bin-hadoop2.6\\README.md") textFile.count() textFile.filter(lambda...

How can I open a JAR for editing in Netbeans

java,jar,source
I made a JAR file. That runs fine. I've been tinkering with the source and I forgot what changes were made. Now that is not working. Can I pull the .java from the Jar somehow?

Images cannot be found in .jar file [duplicate]

java,jar,embedded-resource,javax.imageio,illegalargumentexception
This question already has an answer here: java.lang.IllegalArgumentException: input == null! when using ImageIO.read to load image as bufferedImage 6 answers This question is edited to include everything asked. New picture links will be added below. My program runs fine in NetBeans, and cannot load the program when running...

How to handle empty parameters in a main method java call

java,methods,jar,call,main
I would like to have a dynamic way of passing in parameters to a java main method call which is done via the Command Line(cmd) to a Runnable JAR file. At the moment my main() method takes 6 parameters and sets each one to a variable before calling another method...

Maven signed jar gives warning “unsigned application”

java,maven,jar,jarsigner,signed-applet
I'm using Maven for a project that creates a JAR that's embedded in my web application to sign PDF documents using a smartcard. In my pom.xml I use the maven-jarsigner-plugin as follows: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jarsigner-plugin</artifactId> <version>1.4</version> <executions> <execution> <id>sign</id> <goals> <goal>sign</goal> </goals> </execution> <execution> <id>verify</id>...

How to get gwt jars version information if it is not available in manifest file?

java,gwt,jar
I have gwt-user.jar and gwt-dev.jar in my application. I want to know which version of gwt jar is used in my application. I looked into the Manifest.mf file inside jar file but there is no version info available there. So, is there any other way to know the version for...

The type java.util.Map$Entry cannot be resolved

java,jar,package
I've a JSP file which needs the class Map, which belongs to javax.script (if I'm not wrong). I've imported it, but I'm getting the following error: The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files After doing a bit of research, I think it's because...