Whenever I try to run my project as maven install, it creates a completely normal jar file. It is a swing gui application. However, when I click a button in the GUI that uses this , it ouputs the error below. Exception in thread &quot;Thread-2&quot; java.lang.NoClassDefFoundError: com/neovisionaries/ws/client/WebSocketException     at bot.BotFunc.run(BotFunc.java:30)     at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: com.neovisionaries.ws.client.WebSocketException     at java.net.URLClassLoader.findClass(URLClassLoader.java:382)     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)     ... 2 more  my pom.xml looks like this: &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;   &lt;groupId&gt;HelixBot&lt;/groupId&gt;   &lt;artifactId&gt;HelixBot&lt;/artifactId&gt;   &lt;version&gt;1.1&lt;/version&gt;   &lt;build&gt;     &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;     &lt;plugins&gt;       &lt;plugin&gt;         &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;         &lt;version&gt;3.8.1&lt;/version&gt;         &lt;configuration&gt;           &lt;source&gt;1.8&lt;/source&gt;           &lt;target&gt;1.8&lt;/target&gt;         &lt;/configuration&gt;       &lt;/plugin&gt;       &lt;plugin&gt;         &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;         &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;         &lt;version&gt;3.2.0&lt;/version&gt;         &lt;configuration&gt;           &lt;archive&gt;             &lt;manifest&gt;               &lt;mainClass&gt;gui.GUIMain&lt;/mainClass&gt;             &lt;/manifest&gt;           &lt;/archive&gt;         &lt;/configuration&gt;       &lt;/plugin&gt;     &lt;/plugins&gt;   &lt;/build&gt;   &lt;dependencies&gt;   &lt;dependency&gt;     &lt;groupId&gt;com.neovisionaries&lt;/groupId&gt;     &lt;artifactId&gt;nv-websocket-client&lt;/artifactId&gt;     &lt;version&gt;2.14&lt;/version&gt;   &lt;/dependency&gt;   &lt;/dependencies&gt;   &lt;packaging&gt;jar&lt;/packaging&gt; &lt;/project&gt;  As you can see, the correct dependency is added, so I am not sure why this error is appearing. I have tried clean building it and checked the .project and .classpath files. It may be due to the fact that I converted it to maven from a regular java project, but I have not found anything. Please let me know if there is a possible solution.
3328
I want to package my project in a single executable JAR for distribution.  How can I make a Maven project package all dependency JARs into my output JAR?
109435
What is the syntax and which namespace/class needs to be imported? Give me sample code if possible. It would be of great help.
2258
$ java -jar aprof-plot.jar Exception in thread "main" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper     at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807)     at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886)     at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)     at java.awt.EventQueue.invokeLater(EventQueue.java:1264)     at aprofplot.Main.newWindow(Main.java:33)     at aprofplot.Main.main(Main.java:359)   Possible explanations I saw here was to install Java-access-bridge. But I am unable to install libaccess-java-bridge.
47611
I want to use a Java file SaveProp which is written in a package user. The class file has been placed in WEBINF/classes. Below are the two lines which cause the issue.  jsp:useBean id="user" class="user.SaveProp" scope="session"  jsp:setProperty name="user" property="*"   It throws:  The value for the useBean class attribute user.SaveProp is invalid   I'm using Tomcat 6.0.
78082
How do I install Java for Ubuntu 20.04?
35063
I am trying to compile a java program I found on the internet and it says that I must check if javac is installed. I installed the JDK a long time ago so it should be working but I get command not found error:    how can this be resolved?
122316
I am trying to do this:   Below is the screenshot taken from eclipse  package com.stack.tests;  import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile;  public class PerformanceTesting {        public static void main(String[] args) {             FirefoxProfile profile = new FirefoxProfile();             WebDriver driver = new FirefoxDriver(profile);             driver.quit();         } }   Below is the error code taken while running:  E:\stackoverflow\src\test\java\com\stack\tests&gt;javac -cp selenium-serv er-standalone-2.52.0.jar PerformanceTesting.java  E:\stackoverflow\src\test\java\com\stack\tests&gt;set classpath=%classpat h%;.;  E:\stackoverflow\src\test\java\com\stack\tests&gt;java -cp .;selenium-ser ver-standalone-2.52.0.jar PerformanceTesting Exception in thread "main" java.lang.NoClassDefFoundError: PerformanceTesting (w rong name: com/stack/tests/PerformanceTesting)         at java.lang.ClassLoader.defineClass1(Native Method)         at java.lang.ClassLoader.defineClass(Unknown Source)         at java.security.SecureClassLoader.defineClass(Unknown Source)         at java.net.URLClassLoader.defineClass(Unknown Source)         at java.net.URLClassLoader.access$100(Unknown Source)         at java.net.URLClassLoader$1.run(Unknown Source)         at java.net.URLClassLoader$1.run(Unknown Source)         at java.security.AccessController.doPrivileged(Native Method)         at java.net.URLClassLoader.findClass(Unknown Source)         at java.lang.ClassLoader.loadClass(Unknown Source)         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)         at java.lang.ClassLoader.loadClass(Unknown Source)         at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)   Does somebody know how to fix it?
60276
I am trying to download Minecraft 1.12 but as soon as it starts up and the launcher disappears, it crashes. I tried with a few other snapshots for 1.12 as well. Here is the crash report:  Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/client/main/Main : Unsupported major.minor version 52.0     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
77819
Using Eclipse I want to view the source code for a core Java class (E.g. java.util.concurrent.ConcurrentHashMap) but when I navigate to the source using 'Open Declaration' it says 'Source not found' and gives me the option to attach the source.  My question is; how do i attach the source? Where do i get the source .jar from for the java.util.concurrent library?
14438
Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load JAR files dynamically. I'm told there's a way of doing it by writing your own ClassLoader, but that's a lot of work for something that should (in my mind at least) be as easy as calling a method with a JAR file as its argument.  Any suggestions for simple code that does this?
46894
Minecraft keeps closing a whenever I try to play on multiplayer and its keeps saying that I have a file open. Here is the crash report:  Completely ignored arguments: [--nativeLauncherVersion, 301] [17:43:10]  [Client thread/INFO]: Setting user: Legend_2007 [17:43:10]  [Client thread/INFO]: (Session ID is &lt;censored&gt;) [17:43:13]  [Client thread/INFO]: LWJGL Version: 2.9.4 [17:43:14]  [Client thread/INFO]: Reloading ResourceManager: Default [17:43:16] [Sound Library Loader/INFO]: Starting up SoundSystem... [17:43:16] [Thread-5/INFO]: Initializing LWJGL OpenAL [17:43:16] [Thread-5/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org) [17:43:17] [Thread-5/INFO]: OpenAL initialized. [17:43:17] [Sound Library Loader/INFO]: Sound engine started [17:43:25]  [Client thread/INFO]: Created: 1024x512 textures-atlas [17:43:35]  [Client thread/INFO]: Connecting to play.cubecraft.net, 25565 [17:43:38]  [Client thread/INFO]: [CHAT]                                        #  # A fatal error has been detected by the Java Runtime Environment:  #  #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd2ee92177, pid=3040, tid=5852  #  # JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18)  # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode windows-amd64 compressed oops)  # Problematic frame:  # C  [ig75icd64.dll+0x12177]  #  # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows  #  # An error report file with more information is saved as:  # (i got rid of this part because it showed private info)  #  # If you would like to submit a bug report, please visit:  #   http://bugreport.sun.com/bugreport/crash.jsp  # The crash happened outside the Java Virtual Machine in native code.  # See problematic frame for where to report the bug.  # AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
63740
I use the Eclipse IDE to develop, compile, and run my Java projects. Today, I'm trying to use the java.io.Console class to manage output and, more importantly, user input.  The problem is that System.console() returns null when an application is run "through" Eclipse. Eclipse run the program on a background process, rather than a top-level process with the console window we're familiar with.  Is there a way to force Eclipse to run the program as a top level process, or at least create a Console that the JVM will recognize? Otherwise, I'm forced to jar the project up and run on a command-line environment external to Eclipse.
123877
I'm writing a java app using eclipse which references a few external jars and requires some config files to be user accessable.   What is the best way to package it up for deployment? My understanding is that you cant put Jars inside another jar file, is this correct? Can I keep my config files out of the jars and still reference them in the code? Or should the path to the config file be a command line argument? Are there any third party plugins for eclipse to help make this easier? I'm using an ant build file at the moment but I'm not sure I know what I'm doing. Is there an equivelent of the deployment projects in Visual studio, that will figure out everything you need and just make an installer? I've used install4j before, and it was powerful if no where near as automated as  .Net deployment projects.   Cheers.
20429
I installed eclipse via Ubuntu Software. When I start it, it take some seconds and then comes an error window showing the path of the error.  The following is the .log file:  !SESSION Wed May 02 12:53:28 BRT 2018 ------------------------------------------ !ENTRY org.eclipse.equinox.launcher 4 0 2018-05-02 12:53:28.587 !MESSAGE Exception launching the Eclipse Platform: !STACK java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter     at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)     at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:626)     at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)     at org.eclipse.equinox.launcher.Main.run(Main.java:1438)     at org.eclipse.equinox.launcher.Main.main(Main.java:1414)   What is the problem and how can I fix it?
24381
I installed Zekr Qur'an study software on Ubuntu 12.04 and I upgraded to 12.10. Then the Zekr app started giving me this error whenever I start it.  org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]     at org.eclipse.swt.SWT.error(SWT.java:4387)     at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1939)     at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:699)     at org.eclipse.swt.browser.Browser.&lt;init&gt;(Browser.java:99)     at net.sf.zekr.ui.QuranForm.makeFrame(QuranForm.java:628)     at net.sf.zekr.ui.QuranForm.init(QuranForm.java:340)     at net.sf.zekr.ui.QuranForm.&lt;init&gt;(QuranForm.java:319)     at net.sf.zekr.ZekrMain.startZekr(ZekrMain.java:51)     at net.sf.zekr.ZekrMain.main(ZekrMain.java:94)   Please advise me.
92509
I installed Eclipse, openjdk6 and downloaded and extracted the sdk manager file.  Now, When I created an Android project I got the following error:  2012-06-06 18:44:40 - contactManager] /home/catia/android-sdks/platform-tools/aapt:  error while loading shared libraries: libz.so.1: cannot open shared object file:  No such file or directory   And this one when I tried to create an AVD Manager:  [2012-06-06 19:00:18 - SDK Manager] /home/catia/android-sdks/tools/mksdcard: error  while loading shared libraries: libstdc++.so.6: cannot open shared object file: No  such file or directory  [2012-06-06 19:00:18 - SDK Manager] Failed to create the SD card. [2012-06-06 19:00:18 - SDK Manager] Failed to create sdcard in the AVD folder.
72321
I've downloaded the .jar file for Minecraft, and I installed OpenJDK 6 from the software center, and I tried with 7 as well, but it keeps throwing the message "The file '/home/hunter/Downloads/minecraft.jar' is not marked as executable.  If this was downloaded or copied from an untrusted source, it may be dangerous to run.  For more details, read about the executable bit." However, when I go into the properties to mark it as executable, as many people say to do, the box is not there.