I have the following problem when trying to launch a .jar file of my program in cmd: no main manifest attribute, in path/filename.jar
I tried to add the Main-Class to the MANIFEST.MF file, but then it says Error: Could not find or load main class.
In NetBeans I have set the Main Class at Properties->Run->Main Class to the one, which holds the function main(String[] args) in my case "com.nxp.vda_with_gui_1.version.App". I have also added VM Options for the JavaFX modules like the following:
--module-path C:\NetbeansJavaFX --add-modules javafx.controls,javafx.base,javafx.fxml,javafx.graphics,javafx.media
In NetBeans I can build and launch up my program without any errors, but when I try to "Run File" (Shift + F6) a different error will be put out:
Error: JavaFX runtime components are missing, and are required to run this application Command execution failed.
Any tips how to solve it?
Below you can find a picture of my file/package structure and some other information, maybe it helps finding a solution quicker:
file/package structure
JDK version: 16
JavaFX version: 18.0.2
OS: Windows
Related
I'm using for the first time JavaFX on Intellij for an university project that requires me to develop a certain program.
I downloaded the 19.0.2.1 version of JavaFX.
Then, i created a new project, and tried to run the HelloApplication file (the one it automatically creates), and it did not build. So, i started following around 10 different guides, so the steps i did were:
In 'Project structure', i created a new path to my lib file in the javafxjdk i download before.
In 'Edit run configurations', i added this code to the option 'add VM options':
--module-path /Users/User/Download/javafx-sdk-19.0.2.1/lib
--add-modules=javafx.controls,javafx.fxml
I also changed the JAVA_HOME variable (i'm on Mac) using this command:
/usr/libexec/java_home
But whenever i run, it gives me this error:
Executing pre-compile tasks...
Running 'before' tasks
Checking sources
Copying resources... [TenthTry]
Parsing java… [TenthTry]
java: module not found: eu.hansolo.fx.countries
java: module not found: eu.hansolo.fx.heatmap
java: module not found: eu.hansolo.toolboxfx
java: module not found: eu.hansolo.toolbox
I have absolutely no clue how i can resolve this. Any help?
I fixed it!
Go to file->project structure->modules and in your modules find those four modules that are throwing an error. change them from "Runtime" to "Compile".
When I try to run my appium scripts on the pom file ( with mvn verify or mvn test)
I get a
java.lang.RuntimeException: java.lang.NoSuchMethodException: jdk.proxy2.$Proxy12.proxyClassLookup()
On the line that instantiates my locators:
PageFactory.initElements(new AppiumFieldDecorator(driver, Duration.ofSeconds(15)), this);
When I run the test directly from InteliJ or run the testng.xml file, the test succeeds
Full pom.xml: https://pastebin.com/V0FbehMh
Full error stacktrace: https://pastebin.com/11TvTq7a
testng.xml: https://pastebin.com/8XZtCfRt
Related classes: https://pastebin.com/ynFizC9T
What can be the problem, when everything is fine running from test class / testng.xml, but suddenly failing when running with maven in command line
it's a bit embarrassing, (because i remembered I did this before)
After doing an mvn clean, and an mvn compile again,
Then the issue disappeared. something probably got stuck somewhere and needed a clean again..
I was running my unit test in corda 4from intellij but getting this error.
Error opening zip file or JAR manifest missing : lib/quasar.jar-Dco.paralleluniverse.fibers.verifyInstrumentation
Error occurred during initialization of VMagent library failed to init: instrument
think the path is probably wrong and it cant find the quasar.jar. Also there should be a space between quasar.jar and -dco.parallel.... Try use an absolute path instead.
It happened to me also found that is was the wrong path of [lib/quasar.jar] on the what did was point it to the main project path and it worked.
The full path to the jar in my IDE run config in this image.
I am using java1.6,grails 2.0. I want to process Docx documents.For this i have added jars poi-ooxml-3.5-FINAL.jar,ooxml-schemas-1.1.jar.
But in code line this.document = new XWPFDocument(buffInputStream);
i got below error
Class java.lang.ClassNotFoundException
Message org.apache.xmlbeans.XmlOptions
I am trying to add jars either xmlbeans-2.5.0.jar or xbean-2.1.0.jar.
I am getting below error
| Error Fatal error during compilation
org.apache.tools.ant.BuildException: java .lang.LinkageError: loader
constraint violation: loader (instance of bootloader)
previously initiated loading for a different type with name "org/w3c/dom/Type Info" (Use --stacktrace to see the full trace)
If i verify my Jre System Library, rt.jar contains this TypeInfo class. how
to solve this problem? Please advice. Thank you.
Hi,
I have tried removing library and used jarscan to search this class. But i didn't find any where. Please help out to figure out how else i can find where is this class and how to resolve this
This happened to me with the JMX MBeanServer class. Groovy was loading one of them with its classloader and so was the JVM.
In your case it sounds like the TypeInfo class exists in rt.jar just fine, but another class loader loads it from that jar (or another jar) again.
Running the JRE with "-verbose:class" showed that double load behavior. Then I moved the offending jar out of my classpath and it worked just fine with the one loaded by Groovy.
I would recommend moving rt.jar out of your classpath, or if you need other classes inside of rt.jar try unjaring and rejaring it without the Type class. That way the classloaders will be forced to use the ones in xmlbeans-2.5.0.jar or xbean-2.1.0.jar.
I have install Groovy 2.1.1 in my unix box. While executing groovysh getting the below error.
Exception in thread "main" java.lang.NoClassDefFoundError: error:
Caused by: java.lang.ClassNotFoundException: error:
at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:346)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Could not find the main class: error:. Program will exit.
What could be the possible root cause for this error...???
Somewhere, you try to use the class error: (and yes, Groovy thinks that the colon is part of the class name), either in the script you execute (i.e. there must be new error: somewhere) or you wrote something like groovysh error: or you import error: (maybe indirectly)
Since you are using IBM J9, according to the Grails FAQ, the J9 need an argument to work well with Groovy, otherwise you may get a NoClassDefFound error:
Add -Xverify:none to JVM arguments
Download Groovy Binary From http://groovy.codehaus.org/Download
Download zip: Binary Release
Extract Local Disk say D;\GROOVY\ groovy-2.3.9
It contains the Folder Structure
D:.
├───bin
├───conf
├───embeddable
├───indy
├───lib
└───META-INF
Go to Control Panel\User Accounts\User Accounts Change My Environment Variables
Set/new GROOVY_HOME = D:\GROOVY\groovy-2.3.9 (don’t put : semicolon)
Set PATH = C:\Program Files\Java\jdk1.8.0_25\bin;%GROOVY_HOME%\bin;
Add groovy-all.jar to CLASSPATH
D:\ GROOVY\ \groovy-2.3.9\embeddable\groovy-all-2.3.9.jar;.
Close and Open Command and Say –groovy
For console -groovyConsole