Menu
  • HOME
  • TAGS

Issues with reading xml file after creating jar

scala,jar,fxml,scalafx,onejar

The real problem is rather tricky. Firstly, one needs to realize that JAR is an archive (e.g. similar to ZIP) and archives are regular files. Thus the archive itself is located somewhere in the file system, hence, it is accessible via URL. On the contrary, the "subfiles" (entries) are just...

Using Java Jar Utility

java,eclipse,jar

You need to upgrade aismessages library from version 1.8 to 2.1, change to this version of library: http://repo1.maven.org/maven2/dk/tbsalling/aismessages/2.1.0/aismessages-2.1.0-jar-with-dependencies.jar you have aismessages 1.8 which is old, and have no AISInputStreamReader, you need aismessgas 2.1, and after library upgrade, everything should work....

Works in Netbeans, but not “outside” of it

java,netbeans,jar

Your images are not packaged within your jar. You need to change that. I can't tell from the details of your question why that happens but the context is this: getClass().getResource("/pic/settings-icon.png") is loading the image from your classpath. That is from each element of the classpath. So your NetBeans classpath...

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

java,maven,jar,apache-spark,executable-jar

This is what you are doing wrong : i run my app with java -jar ma-spark-0.0.1-SNAPSHOT-jar-with-dependencies.jar Once you have your application build, your should launch it using the spark-submit script. This script takes care of setting up the classpath with Spark and its dependencies, and can support different cluster managers...

Eclipse connection refused when remote debugging

java,eclipse,jar,remote-debugging

-Xrunjdwp\:transport\=dt_socket,server\=y,address\=6065,suspend\=n should be: -Xrunjdwp\:transport\=dt_socket,server\=y,address\=6065,suspend\=y notice the suspend\=y keep in mind I need to escape the equals and others may not need to do this. Once I set to suspend\=y the application waited for me to connect from eclipse and I was able to begin remote debugging. Don't forget to open...

jar class cannot be resolved to a type

java,spring,maven,jar

To add the external JAR file to your Maven project, you need to run the below command before you do mvn install. mvn install:install-file -Dfile=<actual path for the intended jar file> -DgroupId=<group_id> -DartifactId=<artifactId> -Dversion=<version of jar file> -Dpackaging=<packaging> For example, mvn install:install-file -Dfile=E:\something.jar -DgroupId=someGroupId -DartifactId=someArtifactId -Dversion=someVersion -Dpackaging=jar This step is...

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

java,jar,command-prompt

The syntax for the start command is as follows, START "title" [/D path] [options] "command" [parameters] so in the command, start "C:\Program Files\Java\jdk1.7.0_75\bin\java" -cp Iso8583jPOSJavaAgent-0.0.11.jar com.hp.sv.iso8583.jpos.ISOForwarderMain it considers "C:\Program Files\Java\jdk1.7.0_75\bin\java" as title and -cp as the command to run, thats why you get the error. Try using the following command,...

how to create a jar file from android studio

java,android,jar,aar

Currently gradle based builds doesnt seems to be allowing to create jar with android studio, I decided to go for Intelij it has necessary option and does what i want , i can use community edition. ***Update**** Even the jar produced by Intelij with resources don't work , obviously its...

hadoop - vertica jar

hadoop,jar,vertica

I just downloaded the Hadoop Connector for MapReduce from the downloads page on my.vertica.com. I took the 2.0 version (which supports CDH 4), since that's the Hadoop version you said you're using. I looked in the hadoop-vertica.jar file in the downloaded file (yarn-vertica_1.6.0.zip) and it has the class file in...

Loading resource files within a jar

java,jar,io,loading

This snippet of code worked for me: Clip clip = null; ClassLoader cl = this.getClass().getClassLoader(); AudioInputStream ais; URL url = cl.getResource("com/example/project/assets/TestSound.wav"); System.out.println(url); try { ais = AudioSystem.getAudioInputStream(url); clip = AudioSystem.getClip(); clip.open(ais); } catch (Exception e) { e.printStackTrace(); System.exit(1); } The important thing is not adding the /src/ folder to the...

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

scala,jar,sbt,filesize,sbt-assembly

Yes, this is reasonable. When you make a jar with assembly it adds the contents of all your compiled dependencies. You could make this smaller by using modular dependencies, eg depend on the aws-dynamo jar instead of all of aws if dynamo is the only thing you use. How you...

Valid Jar Clasifiers

java,maven,jar

There are no "valid" classifiers, simply because you can choose anything as a classifier (at least if you use no special characters). There are indeed some conventions (like sources or javadoc), however, there is no convention for a test source JAR (in the way, that it could be detected by...

Proper way to make a Spark Fat Jar using SBT

scala,jar,apache-spark,sbt,sbt-assembly

I think the issue is with how you've setup assemblyMergeStrategy. Try this: assemblyMergeStrategy in assembly := { case PathList("META-INF", xs @ _*) => MergeStrategy.discard case "application.conf" => MergeStrategy.concat case "reference.conf" => MergeStrategy.concat case x => val baseStrategy = (assemblyMergeStrategy in assembly).value baseStrategy(x) } ...

NoClassDefFoundError occurs when running .jar file

java,jar,noclassdeffounderror

No, you haven't used the right command. Your classes are in the package mp6. So, inside the jar, the .class files must also be in a folder mp6. And the name of the main class is not HelloViewer, but mp6.HelloViewer. So, cd into the parent directory (the one containing the...

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

java,jar,spring-boot,spring-batch

I turns out that there is a nice option to choose one job (out of multiple jobs) from within a fat jar: --spring.batch.job.names=jobOne,jobThree Only jobOne & jobThree will run even if jobTwo also exists. See http://docs.spring.io/spring-boot/docs/current/reference/html/howto-batch-applications.html for documentation. So as far as I am concerned, this sorted my problem: java...

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

java,jar,java-bytecode-asm

I remembered it! The tool is called JarJar Links.

Extracting a zip file containing a jar file in Java

java,jar,zip,unzip

Does this suit your needs? public static void main(String[] args) { try { copyJarFromZip("G:\\Dateien\\Desktop\\Desktop.zip", "G:\\Dateien\\Desktop\\someJar.jar"); } catch (IOException ex) { ex.printStackTrace(); } } public static void copyJarFromZip(final String zipPath, final String targetPath) throws IOException { try (ZipFile zipFile = new ZipFile(zipPath)) { for (final Enumeration<? extends ZipEntry> e = zipFile.entries();...

Eclipse: Maven Module missing artifact - .jar not created

java,eclipse,maven,jar

From stackoverflow answer: Install the JAR into your local Maven repository as follows: mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging> -DgeneratePom=true Where: <path-to-file> the path to the file to load <group-id> the group that the file should be registered under <artifact-id> the artifact name for the file <version> the version...

Running a JAVA project with external jars folder

java,jar,classpath

When setting the class path with -cp ..., you have to also specify the current working directory (as this is not part anymore): java -cp ".:/opt/jars/*.jar" Deletion ...

Cannot run jar file created from scala file

scala,jar,build,sbt

It also says what class is not found. Most likely you aren't including scala-library.jar. You can run scala target/scala-2.11/hello-world_2.11-1.0.jar if you have Scala 2.11 available from the command line or java -cp <path to scala-library.jar> -jar target/scala-2.11/hello-world_2.11-1.0.jar.

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

java,jar,bouncycastle

I will speculate a bit, based on your description and without any experimentation, but I hope that it will help you satisfy your curiosity. Java security providers that implement Cipher and some other services from javax.crypto must sign their code. If any of the signed BouncyCastle classes (or resources) were...

Maven signed jar gives warning “unsigned application”

java,maven,jar,jarsigner,signed-applet

The company where I purchased the code signing certificate - Xolphin - tracked down the problem for me. It had something to do with an incorrect added certificate/alias in the keystore. I recreated the keystore and the problem is gone. For others facing the same warning: make sure that you...

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

java,eclipse,maven,jar

This should be marked as a duplicate of this question I just came across It is the exact problem and solution, which I could not find with all my previous searching until I knew exactly what I was searching for, i.e. Executable JAR ignores its own Class-Path attribute So not...

Recursively read images from an executable JAR file

java,arraylist,jar,java-8,executable-jar

Unfortunately, your code will not be reusable as-is in the case you want to explore your jar file automatically, because you just cannot create File instances from the contents of a jar file. This is covered in this post: Unable to create File object for a file in Jar There...

Import java package from Matlab deploytool to Android Studio App

java,android,image,matlab,jar

Java components that are generated from MATLAB code using deploytool (or using other functionality from MATLAB deployment products such as MATLAB Compiler, MATLAB Builder etc.) depend on the MATLAB Compiler Runtime (MCR). The MCR has much too large a footprint to run on an Android device, and it's really not...

.jar from netbeans will not open in console

java,netbeans,jar,console

you need to build it as a runnable jar if you want to start it with -jar see https://docs.oracle.com/javase/tutorial/deployment/jar/run.html You can run JAR packaged applications with the Java launcher (java command). The basic command is: java -jar jar-file The -jar flag tells the launcher that the application is packaged in...

Array Out of Bounce Exception for Jar, but not Eclipse

java,eclipse,jar

This is happening because your jar file is unable to find maze.txt . change String fileName = "maze.txt"; to String fileName = <absolute-path-for-maze.txt> ; and it should be through in jar ...

Running a jar file from terminal in ubuntu

java,ubuntu,jar,terminal

Perhaps your jarfile is corrupted in some way, possibly due to how it was downloaded or installed. this issue is caused by manifest file because you haven't added space after every colon in here, it should be: Manifest-Version: 1.0 Created-By: 1.7.0_79 (Oracle Corporation) Class-Path: mysql-connector-java-5.1.28.jar Main-Class: JavaApplication1 after Main-Class there...

Compiling multiple jar and java files using javac

java,jar,javac

You need to stop the shell from globbing the wild-card in lib/*.jar by escaping it. Also, you need to remove the .jar suffix ... because that's how classpath wildcards work; see Oracle's "Setting the classpath" document. So ... javac -classpath lib/\* src/*.java Using an IDE is another option. However, if...

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

java,windows,jar,registry

You probably have a problem in the command line. I think it should be something like that last row that you have used but with jar and not exe. "c:\program files(x86)\java\jre1.8.31\bin\java.exe" -jar c:\jcm\jcm.exe You just need to test it in command line first and if it works it will work...

Add txt files to a runnable JAR file

java,jar

The problem is that you're trying to access a file inside of a JAR archive as a file in the file system (because that's what FileInputStream is for) and that won't work. You can convert readFile to use an URL instead and let URL handle opening the stream for you:...

Android Eclipse not Responding Adding Jar

java,android,eclipse,jar

Finally get this solved! Got solution from here Need to increase: -Xms512m -Xmx1024m and -XX:MaxPermSize=1024m In my case, I need to increase all of them to 2048m!...

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

java,maven,jar,resources,embedded-resource

Try this approach, Have your maven build as two parts first part being exclude the folder which you want to copy the files, so once this part is completed you will have your jars ready second part execute your copying code which takes the input from the jar and moves...

NoClassDefFoundError: org/dom4j/io/SAXReader

java,eclipse,batch-file,jar,dom4j

When you run a program with the -jar option, you run it as an executable jar. The rules for resolving the classpath are different in that case. Java will ignore the -cp and -classpath options and the CLASSPATH environment variable, and it will only look at the classpath defined in...

java - error while running compiled program with external jar

java,jar

You need to tell Java to look for classes in jsoup-1.8.2.jar, and the current folder (.). On Windows, use: java -cp jsoup-1.8.2.jar;. Main or on Linux, OSX, or other Unix-like systems use: java -cp jsoup-1.8.2.jar:. Main (The difference is that the paths are separated by ; on Windows or :...

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

android,jar,google-api-java-client

Copy the google-http-client-1.20.0.jar to app/libs Add compile fileTree(dir: 'libs', include: ['*.jar']) to your app/build.gradle in dependencies. Go to Tools --> Android--> Sync project with Gradle files. Now you can import the class:) ...

Exception with JavaFX jar

jar,javafx,include,export

The file name in your code matchMaker_MainScene.fxml does not match the name of the file MatchMaker_MainScene.fxml. This will work when you are reading from a file system that doesn't distinguish file names that differ only in case (such as windows) but will not work on file systems that do (everything...

OutofMemoryErrory creating fat jar with sbt assembly

jar,cassandra,apache-spark,sbt

I was including spark as an unmanaged dependency (putting the jar file in the lib folder) which used a lot of memory because it is a huge jar. Instead, I made a build.sbt file which included spark as a provided, unmanaged dependency. Secondly, I created the environment variable JAVA_OPTS with...

External jar not importing in Eclipse Project

java,json,eclipse,jar,import

Build your project after including the jar.If it doesn't work, check whether the particular class you are looking for is present in the jar file or not.

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

apache,jar,storm

Problem solved. The problem arise because the storm jar is run at incorrect directory. It should be run at /home/user/storm/examples/storm-starter/target directory since my storm-starter-0.9.3-jar-with-dependencies.jar is in that directory.

Gradle Jar structure is different than the real project structure

java,jar,gradle,build

When your project is managed by gradle you should always use standard layout introduced by maven or have a good excuse to using any different layout. Here you can find sample project that shows how to use the this layout and read the resources that will be later included in...

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

There is huge differences between the internals of 3.7 and 4.4 with many changes to plugins - some new, some removed. What you have downloaded covers the whole of the core Eclipse. org.eclipse.update.xxx is the old Eclipse update system which was replaced some time ago with the 'p2' install manager...

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

android,jar,x86,mips

Are there any LIVE devices using x86? There are many Android devices powered by x86 CPUs. I would guess that it is 1-2% of the Android device ecosystem, though. Quoting this article: Significant Android tablets using Intel Atom processors...include Nokia's N1, Samsung's Galaxy Tab 3 10.1, the Dell Venue...

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

java,scala,jar,sbt

The way I use it is add all the external jar to the "lib" folder and use "sbt assembly" to create one fat jar.

Android Studio Can't Find tools.jar

java,android-studio,jar

Set JAVA_HOME to /home/andrew/jdk1.7.0_45/ instead....

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

java,jar,noclassdeffounderror,live-streaming,youtube-data-api

Add the following dependency to your pom.xml <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.5.2</version> </dependency> ...

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

java,netbeans,jar

The commandline parameter -splash: represents a image file on the disk, you can not reference embedded resources (which you image has become). You should NEVER use any path reference which contains src it simply won't exist once the program is built/packaged/exported. I'd recommend using the manifest approach instead, as described...

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

java,android,ant,jar,import

Well, after many failures to try to define the lib folder, I put the jar file in the existing libs folder and now get a successful build...

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

so how can I tell it that? Quoting the current version of the documentation: To integrate the core AAR, the Gradle recipe is: repositories { maven { url "https://repo.commonsware.com.s3.amazonaws.com" } } dependencies { compile 'com.commonsware.cwac:camera:0.6.+' } You appear to have added the dependencies but did not update your repositories....

Using JAR Files

java,jar

You should put jar file and compiler output into classpath and specify main class: java -classpath "<name.jar>;classes" Driver EDIT (thanks to Kayaman): If you are running command from linux/unix you have to use ":" as separator (in Windows works ";"). "classes" is a path to folder containing compiler output....

Missing libraries in side jars

java,maven,jar,build,war

Libs that are being used in the jar are managed by the parent container and should not be part of the Jar it self. This insures that Jars staying small and we can link to the same library if we used it in 2 different jars. When installing the Jar...

Include jar to SoapUI maven

maven,jar,maven-plugin,soapui

You need to create an ext folder inside you maven project's root, i.e. where your pom.xml is. The put your compiled jar in this folder (as you've already done in your <SoapUI_installation_dir>\bin\ext directory) in order this jar to be available to the SoapUI runner when it is run via maven.

Failed to make a jar file outside JDK_HOME

java,jar

command to make a jar file in a different directory jar cvf program.jar -C path/to/classes . That assumes that path/to/classes contains the com directory. Step 1: Go to directory where the classes are kept using command prompt (or Linux shell prompt) Like for Project. C:/workspace/MyProj/bin/classess/com/test/*.class Go directory bin using command:...

After jarring images do not show

java,image,graphics,jar

Update: You can't load files directly from jar file using File. You can use this.getClass().getClassLoader().getResourceAsStream("/src/pics/lidPop.png"); it will returns InputStream. Am assuming lidPop.png is in jar with src/pics/lidPop.png path. Modify ImageIO.read() method to accept InputStream....

Package Java 1.7+ Only Classes with JAR 1.6

java,eclipse,jar,copy,compliance

Normally you can use -target option to generate class files that target a specified version of the VM. ex: javac -target 1.6. Look here for more options. But this doesn't work when there are classes in the source code which are not available to the target you specify. I believe...

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

java,jar,xpages,lotus-notes

If you add a JAR to your project by importing it into /Code/JARs, it should be added so as to be accessible by your build path(2,3). The same is true of your /WebContent/WEB-INF/lib, but that may not be automatically defined in your version of DDE; for example, Domino Designer 9...

Access resource from inside jar

java,jar,classloader

Try using getResource("resources/txtFile.txt"); (i.e. without the first /). There should not be a leading slash when using the ClassLoader's version of getResource, it will be interpreted as an absolute path always....

Specifying classpath on execution

java,class,jar

If you are on *nix, the class path separator is :, not ;. In that case you need to run java –cp .:my.package.jar MyMainClass. Otherwise if you are on widows, that ? you get in the error message looks suspicious. Are you some way copy-pasting the command and the -...

Connecting from Spark/pyspark to PostgreSQL

postgresql,jdbc,jar,apache-spark,pyspark

Remove spark-defaults.conf and add the SPARK_CLASSPATH to the system environment in python like this: os.environ["SPARK_CLASSPATH"] = 'PATH\\TO\\postgresql-9.3-1101.jdbc41.jar' ...

Self Delete jar from Windows batch file

java,windows,batch-file,jar,cmd

I solved with Desktop.getDesktop().open(new File(pat)); Hope this can help someone....

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

java,android,osx,unity3d,jar

Have you updated the Android SDK tools to 24.3.2? This seems to have caused the issue. Add following 4 lines to android-sdk-path/tools/ant/build.xml starting line 484 and hopefully it should solve. <property name="aidl" location="${android.build.tools.dir}/aidl${exe}" /> <property name="aapt" location="${android.build.tools.dir}/aapt${exe}" /> <property name="dx" location="${android.build.tools.dir}/dx${bat}" /> <property name="zipalign" location="${android.build.tools.dir}/zipalign${exe}" /> ...

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

java,jar,classpath,rxtx

The -jar switch is intended to launch the jar as a self contained program. As stated in the java man page: When you use the -jar option, the specified JAR file is the source of all user classes, and other class path settings are ignored. To provide a classpath, use...

Java program with referenced libraries: NoClassDefFound [duplicate]

java,jar,terminal,classpath,command-line-interface

you need to tell JVM where to look for classes while running the program. the parameter that we use to tell jvm that is known as classpath there are different ways to achieve that Recomended Add the classpath location to the run command , alternatively pass the jar locations, assuming...

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

java,database,sqlite,jar

It is very simple just place the Sqlite Database file inside your project folder and then in your program in order to connect to the database file create the connection like connection = DriverManager.getConnection("Jdbc:sqlite:name of your sqlite database file"); Now in order to connect to the database file after creating...

Setting classpath at runtime

java,jar,libraries

You need to add the location of EXICodec.class to the classpath. Something along the lines of java -cp "exificient.jar:." EXICodec (assuming you're on Unix)...

Running a java program through command line

java,jar,javac

If you have only jar files try: java -cp FIX/fixprog/src/* com.bot.fix.botclient If you have also classes you should try: java -cp FIX/fixprog/src/*:FIX/fixprog/src/ com.bot.fix.botclient If both did not work perhaps you shoud use absolut path with disk unit if you are using windows....

Start and Stop java process from JAR Fil

java,jar,executable-jar,runtime.exec

Runtime.getRuntime().exec() or ProcessBuilder() should both work fine for this, although you'll need know where the java executable is on your platform. If the java executable is in PATH then this will work cross-platform: Process proc = Runtime.getRuntime().exec("java -jar project_release.jar"); To kill it you could use a socket connection between the...

NoClassDefFoundError() with custom Kafka Producer

java,eclipse,jar,apache-kafka,kafka-consumer-api

For completion sake, the reason why I was seeing the error was because I didn't have the jars specified in the classpath. Once, I added the jars to the classpath, it worked perfectly well.

Exporting Jar with Images

java,image,jar,export,exe

Since your image files are stored in jar as resources you should retrieve them as resources. Hers is how

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

java,linux,jar,path,classpath

You can't use -jar and -cp at the same time. What you can do, is adding your jar to the classpath and then specify your Main class to run. You can also specify the jar dependencies within the manifest of your jar. Please have a look here for more details....

Using jar file in another project

java,eclipse,jar

Right click your project-> properties->Java Build Path -> Libraries tab -> Add External jar, and browse your jar Cheers...

Eclipse error using Maven filtering in persistence.xml

maven,jar,persistence,filtering

I have solved it this way: in persistence.xml substitute the whole <jar-file> tag, i.e. <persistence-unit name="PersistenceUnit" transaction-type="JTA"> ... <!-- here is where the jar file is supposed to go --> ${importjarfile} ... </persistence-unit> Then include in pom.xml the property <properties> <!-- jar of persistence --> <importjarfile><![CDATA[<jar-file>lib/${project.persistencejar}.jar</jar-file>]]></importjarfile> </properties> or alternatively in...

Runnable jar with dependencies [duplicate]

java,maven,jar

You're missing execution from assembly configuration. The descriptorRef tag refers to 'prefabricated' default setups. You should use the "desriptor" tag instead. The assembly being generated has ".zip" extension and includes other jar files, which java won't unpack by itself. We could go on and systematically correct all the remaining...

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

java,jar,package

(Just for the sake of completeness.) One reason might be that Tomcat 6 does not run with Java 8 (nor do some versions of Tomcat 7; I stumbled over that problem myself once): http://stackoverflow.com/a/21322569/694804 So, it is highly suggested to use a recent version of Tomcat 7.0.x (or even 8)...

How to handle empty parameters in a main method java call

java,methods,jar,call,main

Suppose for example that last two are optional. String dType = args[0]; String clientName = args[1]; String cycleString = args[2]; String mspsURL = args[3]; String inputFile = (args.length < 4 ? "default inputFile" : args[4]); String outputFolder = (args.length < 5 ? "default outputFolder" : args[5]); ...

Missing artifact in maven internal repository

java,eclipse,maven,jar,pom.xml

The problem lies in your url tag. Instead of <url>file://${basedir}/libs</url> try removing the double slash before ${basedir}: <url>file:${basedir}/libs</url> You have a nice guide here if you want to check it....

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

java,bash,unix,jar

Redirect the output of the loop as a whole to your results file, not each command individually (and use a while loop to iterate over the results, not a for loop): < <(locate "*.jar") while read -r i do if [ -d "$i" ] #mvn repos have dirs named as...

How rebuild a jar file?

java,jar,rebuild

Use WinRAR (or similar) to unzip the .jar file and replace the files you need and then re-zip it (using a .jar file extension). You may need to rename [filename].jar to [filename].zip and vice-versa. Some archivers like 7-zip even enable you to directly edit from the program and after you...

ClassLoader classes are not properly loaded in the thread

java,jar,jboss,casting,classloader

As per my understanding, if I set a classLoader to the current thread, the methods and interfaces referenced by the Current Thread should be from the present classLoader. No, this is a misconception. The context class loader is not used unless code specifically uses it. In particular, the context...

Writing to a text file within a jar file

java,jar,outputstream

You shouldn't and for practical purposes can't write to a "file" within a jar file. Yes, there are kludges that allow you to get around this, but they shouldn't be implemented. Instead all files that the program might change should be outside of the jar and should be separate files.

Create Jar Library Without a Main Class

java,intellij-idea,jar,main

Create Artifact like in this article, but without specifying Main class http://blog.jetbrains.com/idea/2010/08/quickly-create-jar-artifact/ Then click Build > Build artifact > Build. This works even if there is no Main class....

Docker running nginx plus jar

java,nginx,jar,docker,port

Docker containers are designed for single-process sandboxing, so only take one CMD argument. In this case it's just picking up the last one in the file. If you need to run multiple prorcesses in a container (and sometimes it makes sense to do so) then use something like Supervisor to...

Compile with ant classpath issue with JUnit

java,ant,junit,jar,compilation

This should compile fine in Ant. Make sure you're using a recent version of JUnit. Old versions (e.g. 3.8.1) have different package hierarchies than JUnit 4.x.

Error in executing a Jar file in remote machine

java,ssh,jar

The command should be passed to ssh after hostname separated by space not colon, like this: ssh -i /root/.ssh/pem_file [email protected][host_ip] /home/user/folder1/java -cp jar1.jar -a option1 -e [email protected] -f TextFile.txt If you have parts in the command that could be parsed by your local shell before sent to remote host (for...

Shell script with jar file at the end

java,shell,jar

Try by yourself the following commands. Start creating a normal jar file with any content, or use someone you have. I will name it "myjar.jar" Next, create a file "hello.sh" with content: #!/bin/bash exec echo hello now, add this file at start of a new jar file: cat hello.sh myjar.jar...

How to run classes inside Jar file?

java,eclipse,selenium,jar

You can do that using Junit library. JUnitCore junit = new JUnitCore(); Result res = junit.run(yourTestClass); Don't invoke the main() method to avoid any possible interruptions, just let the JUnitcore find the appropriate test methods. And also don't forget to include Junit.jar in classpath (or) include it as part of...

Schedule to run a executable jar file on windows 7

jar,windows-7,scheduled-tasks

Firstly make sure Java is set in the enviroment PATH by opening cmd.exe and typing java -version. If you get back the java version, then you are fine. (If not see Update the PATH Environment Variable (Microsoft Windows)) Then create a text file, save it as run.bat and type inside:...

How can I open a JAR for editing in Netbeans

java,jar,source

A JAR only contains .class files, which are compiled from .java source files. Unfortunately you can't edit the .class files and expect anything useful to come out of it. This might work, though: JD GUI, a JAR decompiler....

java.lang.SecurtiyException at unsigned jar's

java,jar,certificate

You are probably using a package name that's already used by someone else. If they have signed their work and yours is unsigned, then you'll get that error. The purpose of the error is to protect signed content from being added to by others without consent of the original signer....

How to run a .jar inside browser?

php,html,browser,jar

If that file does not contain an Applet, I do not think you will be able to start it in the browser (have a look here). Executing it via exec should work like executing it via the command line - but as you already noticed, it will be run on...

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

java,linux,eclipse,jar,sphinx4

You have to include current directory in classpath: java -cp .:one.jar:two.jar:three.jar:four.jar:five.jar HelloWorld Note the leading .: From this reference: The default class path is the current directory. Setting the CLASSPATH variable or using the -classpath command-line option overrides that default, so if you want to include the current directory in...

How to modify configuration file which is residing inside a JAR

java,jar

A JAR is just a ZIP file. You can use any tool to manipulate the contents. In Java, there is the class java.util.zip.ZipFile which you can use in combination with other classes of this package to manipulate the contents of the JAR. But even the standard jar tool has options...

Images cannot be found in .jar file [duplicate]

java,jar,embedded-resource,javax.imageio,illegalargumentexception

From looking at your first linked image which states you are trying to load the resource "fma.jpg" and IllegalArgumentException: input == null and your last image which clearly shows that the file included in your project is named fma.JPG I think it's pretty clear what is going on (PS: None...

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

java,gwt,jar

GWT provides the information in several ways: gwt-dev.jar contains a com/google/gwt/dev/About.properties you can launch the gwt-dev.jar (java -jar gwt-dev.jar, or java -cp gwt-dev.jar com.google.gwt.dev.Compiler, and it'll give you the version information) the version is also available into the generated JS, and/or accessible from client code using GWT.getVersion() ...

Eclipse run my program well however JAR-file does not

java,eclipse,swing,jar,nullpointerexception

Change the code to: Icon island =new ImageIcon(ImageIO.read(getClass().getResource("/Island(64x64).png"))); ...

IntelliJ correctly using Libraries

java,intellij-idea,jar

Go to Project Structure (Ctrl + Shift + Alt + S) > Artifacts > + > Jar > From Modules with dependencies Select your module and the main class. Select Extract to the target JAR if you want to bundle all your libraries into one file. Close the dialog and...

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

java,maven,jar,gradle

You need to tell the application plugin to include the output of your sourcesJar task in the distribution: distributions { main { contents { from sourcesJar } } } That will place it in the root, if you want it somewhere else you can do this: distributions { main {...