I am currently trying to use marytts in my project. Now I am trying to export my project to an executable jar file. The problem is I always get this error:
java.lang.IllegalArgumentException: No such voice: bits3-hsmm
In IntelliJ everything works fine, the error only occurs when executing the exported jar file. I added the dependencies as shown in this photo
The marytts interface is working correctly only the voice makes troubles. A am using an downloaded version of the voice and marytts and they should be included in my exported .jar file.
This looks like a product of IDEA-240253 (and related IDEA-116209).
IDE should be able to handle this automatically, but currently it isn't implemented.
You may keep separate JAR files and add them to the classpath of your JAR via Class-Path attribute in MANIFEST.MF file.
Related
I am trying to use VS Code to do a javafx project. I just figured out that javafx isn't built in in Java 13.(However, I remember that it is included before?)
So I download the javafx sdk and try to add the jar files into my project. I have added codes like<classpathentry kind="lib" path="lib\javafx-swt.jar"/> into the .classpath file. And the Java Dependencies also shows the included jar files. However, when I compiled the program it will show package does not exist. I'm wondering if I took any wrong step adding these jar files?
This is what my javafx code look like
The .classpath file and error message
I have implemented simple Swing application which creates database and added mysql-connector-java-5.1.18-bin.jar to my projects build path. it works fine when I run in Eclipse as a project. But I exported this project to runnable jar file it doesnt work.
I write some code to print exceptions to file. It gives this line :
java.lang.ClassNotFoundException : com.mysql.jdbc.Driver
I already added required jars to my project. I cant understand why it doesnt work ?
It seems that your JAR is not having the required libraries.
You need to export the application using the option Package required libraries into generated JAR.
I am using the JarSplice tool to create a runnable jar file.
However, as soon as I add lwjgl.jar to my required jar files, it immediately fails to create the jar, saying
"Duplicate entry".
Here is a screenshot of the error: http://gyazo.com/2aac58aa15ba19ff7c61aeda548f43c2
If I remove lwjgl.jar it obviously builds the jar file, but cannot run because I require LWJGL.jar
And here is a screenshot of the added jar files: http://gyazo.com/78a88443336bfb530ed71bd6418e9be1
So, how can I fix this "Duplicate entry" issue so I can create my fat jar file?
Thanks!
I write a very simple java program with two classes: Business and Main.
I want to create a jar such that if I email it to someone they can:
run the program (i.e. run the jar)
open the jar to view the source code.
the code can run on mac or windows
I have been using IDEs for so long I have forgotten how to do this.
I am using netbeans 7.x
EDIT:
I found the following way on Netbeans:
properties > packaging > exclude from jar file :: delete **/*.java
But when I try to execute the jar using
java -jar mybusiness.jar
it says
no main manifest attribute, in mybusiness.jar
But note that my jar has a main class. Am I missing a manifest file?
You can export a JAR file that includes the source code using Netbeans:
Right click on the project and select properties
Build -> Packaging
Remove Java files from the excluded files. And select build jar after compiling
It will create the jar file that includes the source code if it successfully compiles.
Well surely an IDE can do this too?. Just make some text files and put the source into them and drag them into the ide's. It's java so it should automatically run on all platforms. I am not sure what the problem is here?
This link explains how do u create manifest file and how do you specify your main class in manifest file as its necessary for executing jar.
My project runs fine from Eclipse.
But when I tried to make it into a jar file or executable file it doesn't work.
I used the option "Export-Runnable JAR file"
The following message appears just after the eclipse finished the exporting process
JAR export finished with wornings , see details.
the details were ..
Exported with compile warnings:Mario/src/Map.java
and the same for other classes like
Exported with compile warnings:Mario/src/Player.java
and so on.
So that I used the other option "Export - JAR file"
It works fine and nothing appears while exporting it from Eclipse.
But when I try to open the file it gives me
Couldn't find the main class:Frame.Program will exit
Somebody have any idea about what the problem is?
Your MANIFEST.MF file inside the META-INF dir should have a Main-Class attribute pointing to your main class.
The important thing for executable jar is Manifest. Make sure it exists and points to the correct class with main method