Scala code run successfully in Eclipse but its jar not run - java

Scala code run successfully in Eclipse but its jar not run
I have Scala project with SBT, its run well in Eclipse but when I try to run jar file which is generated after packaging is not running its throw error like
SBT version= 0.13.8 ,scala version =2.12.2 ,java=1.8
Click here to seethe Error
click to see the build.sbt
Please co-operate me to solve this issue

This Error due to then dependency is not included in the jar file at the time building the project , so its throws ClassNotFoundException , we can fix this issue by assemlying the dependency into single jar . for this solution please follow the below link
https://alvinalexander.com/scala/sbt-how-build-single-executable-jar-file-assembly/

Related

Or-tools java.lang.NoClassDefFoundError: com/sun/jna/Platform

Hi I'm trying to run this sample code on my eclipse ide and have manually adding the jars file without using the pom file provided but it's complaining with this error.
I managed to compile and run the sample code using 'make run' command.
Any idea is it possible to copy the library jar files and use it in my own project in eclipse?

Keep getting java.lang.NoClassDefFoundError with maven project in vscode?

It is just a simple maven project with 1 dependency. I can compile it with not error but when I run it, it won't work. I am guessing that it is some problem with classpath, as when I manually passed all dependecies classpath to the commandline, it runs fine.
screenshot
Also I tried to open the project in idea, and it worked fine.

Eclipse failing to see Gradle provided jar

We have a Gradle project that I'm trying to use in Eclipse.
After other users made changes and I had to do a Gradle Refresh, Eclipse now can't compile the project.
The project was not built since its build path is incomplete. Cannot find the class file for
org.springframework.retry.support.RetryTemplate. Fix the build path then try building this project
The type org.springframework.retry.support.RetryTemplate cannot be resolved. It is indirectly
referenced from required .class files RabbitMQConfig.java /Account/src/main/java/com/efi/metrix/config line 1 Java Problem
If I use Ctrl-T, I can see the class and what jar it is in. The jar IS in the classpath and can be seen under the "Project and External Dependencies" section in Package Explorer.
I've tried deleting the jar and re-running Gradle Refresh, which downloads the jar again, and I get the same error with the build failing. I've also tried an Eclipse Clean on the project.
(I did try restarting eclipse as well.)
Any hints on what might be causing this?
Finally tracked this down.
Eclipse project, Properties -> Java Compiler -> Errors/Warnings
In the "Enable annotation-based null analysis" section, if you have "Inherit null annotations" enabled, you get the compile errors.
I turned off that option, and it now compiles without errors.

Java - IntelliJ generated executable jar not working

I have generated an executable jar in IntelliJ IDE. But when I try executing the jar file from windows folder it does not work. When I try running the .jar file from within the IDE in debug mode it gives the below error:
no main manifest attribute, in D:\... the file path
To generate the executable jar I referred to Link
I referred to Link for the no main manifest attribute issue but dint help as in my case its a Gradle build
(Note: If I execute the program(.java file) from within the IDE it works fine, so I believe the issue is not with the program)
Hope the issue I face is clear, await guidance
Adopted Gradle build tool to generate Jar.

NoClassDefFoundError in eclipse plugin execution

I'm building eclipse plugin that uses JDT/AST.
Building the plugin works fine, but when I tried to run the plugin. I go this error message.
It complains that the ASTVisitor class is not found.
I checked the org.eclipse.jdt.core***.jar is in the build path with User Libraries.
What might be wrong? Do I need to setup execution path that points to jar files?
Eclipse plugins manage dependencies using the Manifest.MF file. Check in the dependencies tab of your Manifest.MF file that you have org.eclipse.jdt.core as a required plugin.

Categories