I'm trying to extract .jar of my project through the artifact build in intellij but the extracted jar file is not opening. I'm using the jcommon .jar file which is external library and I also added this jar file to my project build.
Java is not a problem. I tried another project without any external libraries and it works well.
I also tried to edit the manifest file and add the classpath for the external libraries but same.
How to extract jar file with external libraries or jar file?
The error message is showing
Java application launch failed. Check Console for possible error messages related to 'Users/jaehunshim Desktop/CS/CS_IA/out/artifacts/ CS_IA_ iar2/Cs_IA jar'
Related
I have created the automation script in Selenium using Java in Eclipse and have created a jar file by navigating through Export->java->Runnable JAR file-> package required libraries into generated JAR.All this has been done in System A.
I am trying to run the jar file in System B.But unless I dont include the entire project folder into System B.The jar file is not executing.
My question is ,how to run jar file without including the entire project into System B..?
My LibGDX project runs in Eclipse but when I export it to an executable JAR file I get "Couldn't load file: play_button_inactive.png" and "File not found: play_button_inactive.png (Internal)".
I refreshed and cleaned the project. I deleted my assets link in the Desktop Project and re-loaded it in the Build Path but the same errors persisted.
I looked inside the jar file and Eclipse packaged in the assets separately into the Jar file so I put them all into a new "assets" folder manually but I got the same errors when I ran it. I used the command
java -jar fileName.jar
Here is my Build Path.
Thanks for any suggestions as to what I am doing wrong.
UPDATE: After reading around I found a solution which is to put all the assets into the same directory as the jar file. Is there any way to package them into the jar file?
I fixed the problem by not using Eclipse's jar file building tools and used gradlew desktop:dist instead.
This works perfectly and packages all resources and files into the generated jar file.
I am using Stanford NLP library for an IBM Bluemix app. I have added both stanford-corenlp-3.5.1-models.jar and stanford-corenlp-3.5.1.jar to build path. And consequently, the app is running fine in the local webshpere liberty server.
When I build the WAR file through ant build of build.xml, I ensure that both the files are included. I can also see them present inside the WAR file. But when I deploy the WAR file on Bluemix, and run it, I get the following error:
ERR java.lang.NoClassDefFoundError: edu/stanford/nlp/pipeline/StanfordCoreNLP
What might be the problem?
I have ensured that the jar file is in the war file:
Please ensure that the jar files are present in the WEB-INF\lib folder in the WAR file.
I have faced the same issue and by making the jar available in WEB-INF\lib folder it was resolved.
I have developed a web service client in Netbeans through WSDL file, i have build the project and get jar file. When i run that jar file, it work fine but now i have to use this jar file in my eclipse project. But when i use this jar file i get error.
"THe type javax.xml.bind.annotation.XmlAccesstype.cannot be resolved. "
Attach is the screenshot.
How can i solve this problem.
You have to check your classpath and probably add you WS libraries in it. Open grepcode.com and paste your missing class name in it. You will see the dependency missing.
I have a Android project with some classes that I would like to compress to a JAR.
I create the JAR by right clicking my project - export - JAR - and the JAR gets created without any warnings.
I can access all classes from the JAR in my code but when I try to build the project get this exception :
java.lang.NoClassDefFoundError: name.of.class.in.package
Does anyone know what resources should be exported with the JAR? The options you get is
.class path
.prject
AndroidManifest.xml
proguard.cfg
project.properties
Right now I have included all of the above.
Making the JAR into a library project is not an option. And just to make it clear I don't have anything in the RES folder of my JAR project.
Open the project properties -> Java Build Path -> Order and Export and check item Android Dependencies are checked to be exported to the result APK.
And if .jar exist in Library tab under Android Dependencies item.
If you have .jar in the "libs" folder it should be included by default.
Just add your JAR to classpath or build your project with Maven and include dependencies
Try generating the jar in a different way. Basically jar is a zipped file of all class files with an extension of .jar.
Select all your class files that needs to be included in a jar file.
Right click and send to compressed (Zip File).
you will have a zipped file which will contain all the class files.
Rename this zipped file with having an extension .jar
Now include this jar file into your project whichever you want to use.
Or if you want to zip all the files by a different method then make sure all the files are zipped together without a folder. So when you unzip the files you should get all the files without contained in a folder.
It looks similar with this topic. Follow the very clear instructions written by Russ Bateman.