Error when building Scala Maven project: Could not find or load main class scala_maven_executions.MainWithArgsInFile - scala

Error when building a Maven project using maven-scala-plugin:
[ERROR] Error: Could not find or load main class scala_maven_executions.MainWithArgsInFile

Then reason is that settings.xml file was copied from Windows to OS X without modification, however it contained Windows-specific local repository path:
<localRepository>C:\Users\<username>\.m2\repository</localRepository>
Should be changed to:
<localRepository>/Users/<username>/.m2/repository</localRepository>

Related

Error occurred during initialization of boot layer java.lang.module.FindException executing Selenium tests using TestNG and Java 12 through Eclipse

ErrorOccuredDuringInitializationofbootlayer I keep getting this error when I run
my test:
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for
C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar
Caused by: java.lang.IllegalArgumentException:
com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java
identifier
How can I fix it?
Add TestNG Library to classpath in buildpath ( not to module path). It will work fine.
To avoid this error, do not add TestNG library in the project or src folder. Try adding it into the package. To do so , follow the below mentioned procedure.
Right click on the package, click Build Path->Configure Build Path, go to Libraries tab, select Classpath and click on Add Library to select TestNG.
This error message...
Error occurred during initialization of boot layer java.lang.module.FindException:
Unable to derive module descriptor for C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar
Caused by: java.lang.IllegalArgumentException: com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java identifier
...implies that there was an issue with the java classpath.
As per the discussion Launch with java 11 fails: Error: Could not find or load main class with Caused by: java.lang.ClassNotFoundException: with there are some issues with some particular classpaths for java-11 and the launch fails if:
The classpath contains a folder with spaces
The classpath length is larger than 32767 characters.
Where as java-8 works fine.
Reference
Unable to import org.openqa.selenium.WebDriver using Selenium and Java 11
Outro
Eclipse plugin: TestNG testcase does not run with Jdk11
Need to add 1.8 version library
Remove TestNG from build path library and add again
Recheck - the issue should be resolved.
I got same issue and I solved it. When creating the project, don't create module-info.java. When the project was already created with the module-info.java, deleting this file didn't help me.
I just created new project without module-info.java, and all works good now.
Best option to resolve this:
Find all file and folder starting with . e.g. — .metadata / .setting and delete them.
Add all the JARS.
Add testNG Libraries.
Execute it.
Done.

Build error deploying javafx application when added jna 4.1.0 library

I am trying to build my app, but I have the next error.
The jar libs\jna-4.1.0.jar has a main class com.sun.jna.Native that does not match the declared main com.bp.ocr.MainApp
I do not know how to solve it, I am looking for but I am not understand why happens.
Using base JDK at: C:\Program Files\Java\jdk1.8.0_31\jre
The jar libs\jna-4.1.0.jar has a main class com.sun.jna.Native that
does not match the declared main com.bp.ocr.MainApp
Bundler EXE Installer skipped because of a configuration problem:
Main application jar is missing.
Advice to fix: Make sure to use fx:jar task to create main application jar.
BUILD SUCCESSFUL

Unable to reimport Grails project into GGTS / STS?

I have copied a grails project to the workspace folder -
and try to import. The following error is shown:
Invalid project description.
OK
C:\Users...\workspace-ggts-3.5.1.RELEASE\ overlaps the location of another project: ''
How can I can clean the workspace correctly (delete the project properly) so that this message does not appear? I did ensure that the project name under .projects did
not exist prior to import - but message still indicates an overlap?
I then open project and Run As Grails Command (run-app).Grails home is set to: C:\grails-1.3.7\ -
and get
Base Directory: C:...
Resolving dependencies...
Dependencies resolved in 470ms.
C:... does not appear to be part of a Grails application.
The following commands are supported outside of a project:
add-proxy
clear-proxy
create-app
create-plugin
help
list-plugins
package-plugin
plugin-info
remove-proxy
set-proxy
Run 'grails help' for a complete list of available scripts.
Note that I had imported the project successfully before (as a Grails project) and
have deleted since etc.
I have also tried moving to other folder which I do not want to do.
How can I resolve the above?
Thank you
Simon

Getting "Unable to execute dex: Multiple dex files define" error when trying to run main project which is using other library project

I am trying use androidVNC open source project as a Library Project in my MainProject. androidVNC has also used ZoomerWithKeys library project. I want start a activity of androidVNC library project in my MainProject by clicking on a Button.
I have done all the basic things like to define all the activity of library project in Manifest of main Project.
The problem is that i am getting following error when trying to running my MainProject -
Dex Loader] Unable to execute dex: Multiple dex files define Lcom/antlersoft/android/zoomer/R$drawable;
[2013-05-16 15:44:03 - OtherProj] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/antlersoft/android/zoomer/R$drawable;
Thanks in advance.
I resolve this by doing following steps:
Go to bin folder of you app and see which libraries are duplicated(in mine I had 2 supportv4****)
Hold your mouse on them and see where they compile from, keep in mind that you should keep the most important one, so if you are using appcompat and facebookSDK, you should keep that library which comes from appcompat
Go to the properties of the project of the other library (e.g facebookSDK) -> Java build path -> Libraries and delete the dependency in which the buggy lib come from(in mine, supportV4 nested in Android Private Libraries, so I delete it),
Also do it from a file manager, go to our project folder/libs and delete that buggy library if it's not cleaned by default
In that window, after deleting, choose Add Jars... and select the library of the other project(in mine, I choose SupportV4 from appcompat)
Clean you workspace, restart Eclipse
The problem should have gone, these steps work more than fine for me
1).did you added your lib project to the main project?? Make sure..
2).also add the project to your lib project by doing this process--
In the lib project-->>right click on project-->>java build path-->>on the project tab-->>add your main project.
Now build your project..hopefully it will help you.
EDITED::
3). Go to the project properties..edit this(can give some space) and then save..clean project...then build..
I tackled with this kind error in Android Studio.
In my case my main project was using two my own lib. But beside this those two libs were using the same library as external included
compile files('lib/external-lib.jar')
I solved it by doing following in my both own libs.
1)Removing old compile files('lib/external-lib.jar' ) from build.gradle and deleting old external_lib.jar from lib folder.
2)Adding library from jcenter() two my own libs
compile 'external.lib:1.9.2'
3)Rebuild.
Then rebuild and run main project
Then problem has disappeared.

Issues debugging Errai app in Eclipse

When degugging an Errai application in Eclipse, I get the following error.
[WARN] failed com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload#1575d48{/,/home/matthew/git/PressGangCCMSUI/src/main/webapp}: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/context/FacesContext
[WARN] failed RequestLogHandler#ad4bb0: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/context/FacesContext
[WARN] Error starting handlers
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/context/FacesContext
Does anyone know how to fix this up?
It turns out the issue was because Eclipse was using a local Maven project as a dependency instead of the JAR file in the local repo cache. Once I close the project that my Errai app was dependant on, Eclipse reverted back to using the JAR in the local repo cache, and I could launch the debugger again.