Hi I have seen some threads about the problem. But none of them solved my problem.
When using the Export option from exlipse selecting jar I configure it like this:
Jar Export Settings
Jar Export Settings 2
so far so good, the Main class is detected. But then when trying to run the jar I get the error:
"Java Virtual Machine Launcher"
"Could not find the main class: Program will exit."
Can anyone suggest what I am doing wrong?
In Jar export, make sure to check the src folder under the selected projet and check the last 3 options export and uncheck the first one. Hope it will work for you.
This morning when I was trying to load IntellJ it doesn't boot up. I see idea.exe under process tab. When I tried to run idea.bat from command line, I get the following:
Invalid Log Path: Log path 'Ç:\Users\NAME.IdeaIC2016.3\system\log' is inaccessible. If you have modified the idea.log.path property please make sure it is correct otherwise please re-install the IDE.
Check folder permissions, it may be owned by admin for some reason. Try removing this folder so that IDEA creates it again.
Run disk tool with permissions fix.
Taken from:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206156759-IntelliJ-IDEA-14-1-1-on-Mac-OSX-Log-path-Users-username-Library-Logs-IdeaIC14-is-inaccessible-
I'm working with DBeaver Oracle server.
I'm getting a periodic error about workspace save.
I tried google to find a solution but all I found was meta data related explanations. I am new to DBeaver so if anyone knows this problem and a solution please help.
Following is the error I got.
Could not write metadata for '/.dbeaver-temp'.
/home/engineer/.dbeaver/.metadata/.plugins/org.eclipse.core.resources
/.projects/.dbeaver-temp/.markers.snap (No such file or directory)
try to delete .metadata folder. May be it will work. P.S. make sure to backup folder
One can also create a folder and file in the said path it will work
.metadata.plugins\org.eclipse.core.resources.projects.dbeaver-temp
if on the windows use dos command to create the folder starting the . period
I hope this helps as well. it worked for me , my eclipse version was neon
I have a web site project in Eclipse and I needed to copy it and rename it for a new client. So I had my tortisesvn export the site to a new directory and changed the project name in the .project file and imported it into the same workspace in Eclipse. It seems to be running ok but now when I get errors in the console window the links that should take me to the line of the error take me to the file in the original project not the new one. Anybody know what I can do to fix this?
EDIT: In case anyone asks. I'm sure it's using the correct file when running the site and the error number is on the correct line. I put an intentional divide by 0 error in my code to test this and I get the expected error in the console window on the line that the error is on but it still sends me to the same file name but in the other project.
I found this one with some more searching: Eclipse opens wrong source file on exception
It seems if I remove the other project from the server in tomcat it goes to the correct spot. What a pain.
I've got a project in which I'm using Java+Scala+Slick2D.
The project itself runs well when launched from within eclipse. But when I try to make a jar file, it just refuses to work. Here's the error I keep getting when trying to export it as a Runnable jar:
And if I try to export into just a Jar file, it's unable to find the Main Class:
There is, of course, a main class in game.TicTacGame. But it refuses to acknowledge it. I tried creating an executable with a simple Hello World project and it worked fine. It even detects the main class. Why is Eclipse not detecting the main class in this case?
PS: I've also tried extracting the .jar file created, editing the manifest.mf file to add the Main-Class: game.TicTacGame, enter two new lines and recreate the jar. Then it gives me a corrupted jar file error.
I'm at my wits end and would appreciate any help in this regard. I'm using Windows 7 x64 with Eclipse Juno, Java 1.7 and Scala 2.10
Edit: The Main class is in Java
Okay, I got it to work. Apparently, all I needed to do was restart eclipse. And then magically, it started detecting the Main class:
But the jar started giving me noClassDefFound errors for the Slick2d, LWJGL and other libraries. That's where JarSplice came to my rescue. I exported the project as before, with all the libraries and resources.
Then, I fired up JarSplice and added everything as follows:
Go to "Add Jars" and add the project.jar just created through eclipse, add lwjgl.jar, slick.jar and scala-library.jar. lwjgl and slick should be in your project lib folder where you would have imported them. scala-library should be available wherever it says it is. Make sure you add that as well
Next, when I tried to "Add Natives" it kept giving me "Duplicate library" error. So I removed them all and kept it empty.
Next in "Main Class", I entered the path to the main class i.e. game.TicTacGame
Finally, "Create Fat Jar". And it works perfectly :)
I just encountered the same problem, and here is how I solved it:
Open "Run As" --> "Run Configuration" on the project you want to export
Click "Search" for Eclipse to refresh the list of main class
Then export Runnable JAR file again, and everything goes smoothly.
The most easiest method is run the java file once and automatically the file appears in the list.Even i was facing the error but it was solved by using this simple method.
I recently figured a better way to do this using 'Runnable jar export' which might help you. In order for your main method to be listed in that list, you need to add the main method to the Run Configuration list.
This way it's simpler to create a runnable jar especially if you want to do it repeatedly.
Well, got the same Problem and solved it by selecting my GUI to export and not the whole Project.
I had this problem with Eclipse version 2019-03 (4.11.0) and compiler JaveSE-11. Choosing the right launch configuration and exporting runnable jar failed over and over again with an error
Could not find main method from given launch configuration
I've tried to restart Eclipse and do a clean build, but it didn't help.
In the end, I found a workaround to go into the generated jar file (I've used 7zip) and change META-INF/MANIFEST.MF file. The file should have something like this inside:
Manifest-Version: 1.0
Class-Path: .
Main-Class: <package name>.<class name>
Hope it helps someone.
I faced the same issue and in my case I found that "launch configuration" was incorrect in Runnable Jar file specification dialog. Somehow, eclipse was automatically taking it. The "Launch configuration" should be java file which has main method. Basically, it is filename-package.
The moment I changed my "launch configuration", I was able to create Jar file without any error.
I had the same issue. To overcome this issue, you need to close all opened files and open a single java class file that has the main() method. Then export it from eclipse and works fine.