I have finished making my Java program with a Swing GUI in NetBeans and have built, cleaned and run it error free. However, now I am looking to save it as a runnable format, I seem to be missing the trick. I have spent hours searching and have tried the following aside from all of the dead ends or years old questions that as since not applicable:  Opened the program in Eclipse and exported a runnable .jar file Run &quot;Build and Clean&quot; in NetBeans to generate the &quot;snapshot&quot; .jar file I have tried running both of these .jar files from both command line and elevated command line with varying errors.  I have a feeling it has to do with my pom.xml file, but as I said I cannot find anything or I am missing the point entirely. This is my pom.xml file: &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &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 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;     &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;     &lt;groupId&gt;com.OETrackerV0&lt;/groupId&gt;     &lt;artifactId&gt;OETrackerV0&lt;/artifactId&gt;     &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;     &lt;packaging&gt;jar&lt;/packaging&gt;     &lt;dependencies&gt;         &lt;dependency&gt;             &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;             &lt;artifactId&gt;poi&lt;/artifactId&gt;             &lt;version&gt;5.0.0&lt;/version&gt;             &lt;type&gt;jar&lt;/type&gt;         &lt;/dependency&gt;         &lt;!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --&gt;         &lt;dependency&gt;             &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;             &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;             &lt;version&gt;5.0.0&lt;/version&gt;         &lt;/dependency&gt;         &lt;dependency&gt;             &lt;groupId&gt;com.formdev&lt;/groupId&gt;             &lt;artifactId&gt;flatlaf&lt;/artifactId&gt;             &lt;version&gt;1.1&lt;/version&gt;             &lt;type&gt;jar&lt;/type&gt;         &lt;/dependency&gt;     &lt;/dependencies&gt;     &lt;build&gt;         &lt;plugins&gt;             &lt;plugin&gt;                 &lt;!-- Build an executable JAR --&gt;                 &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;                 &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;                 &lt;version&gt;3.1.0&lt;/version&gt;                 &lt;configuration&gt;                     &lt;archive&gt;                         &lt;manifest&gt;                             &lt;addClasspath&gt;true&lt;/addClasspath&gt;                             &lt;classpathPrefix&gt;lib/&lt;/classpathPrefix&gt;                             &lt;mainClass&gt;frameOne&lt;/mainClass&gt;                         &lt;/manifest&gt;                     &lt;/archive&gt;                 &lt;/configuration&gt;             &lt;/plugin&gt;         &lt;/plugins&gt;     &lt;/build&gt;     &lt;properties&gt;         &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;         &lt;maven.compiler.source&gt;15&lt;/maven.compiler.source&gt;         &lt;maven.compiler.target&gt;15&lt;/maven.compiler.target&gt;     &lt;/properties&gt; &lt;/project&gt;  I'm happy to edit and post the rest of the code if necessary, it is also on my GitHub here:
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?
19866
When running a Java app from eclipse my ImageIcon shows up just fine.  But after creating a jar the path to the image obviously gets screwed up.  Is there a way to extract an image from the jar at runtime so I can then open it up?  Or, is there a better way to do this?  I'd like to distribute a single jar file if possible.
82149
sachin@sachin-Lenovo-G550:~$ java -version java version “1.7.0_21″ OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-1ubuntu1) OpenJDK Server VM (build 23.7-b01, mixed mode)   When I ran the above command this showed that Java is installed in my system, but when I am going to compile any Java program it gives the following error message:  sachin@sachin-Lenovo-G550:~/programs$ javac abc.java The program ‘javac’ can be found in the following packages: * default-jdk * ecj * gcj-4.6-jdk * gcj-4.7-jdk * openjdk-7-jdk * openjdk-6-jdk Try: sudo apt-get install   Please tell me how to get rid of it and run my Java program.
102682
I have tried anything that came into mind: Reset modem, add Minecraft to exception list etc. Now this is the launcher that claims it doesnt need Java, is that true or not? because as far as I know the latest version of Java is on my PC. I can play Minecraft Vanilla just fine with FTB and Technic but Voxelmap needs Liteloader and it claims that Minecraft Vanilla from Technic doesnt have a Launcher Profile so I had to resort to using the official one.
112781
This is the error I get when I run my web application in an instance of the Tomcat servlet container started by NetBeans. To fix this I even changed the heap size in netbeans.conf, but still it shows the same error. How can I keep this from happening?   HTTP Status 500 -   --------------------------------------------------------------------------------  type Exception report  message   description The server encountered an internal error () that prevented it from fulfilling this request.  exception   javax.servlet.ServletException: Servlet execution threw an exception     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)   root cause   java.lang.OutOfMemoryError: Java heap space  note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
53154
How do I get my project's runtime dependencies copied into the target/lib folder?    As it is right now, after mvn clean install the target folder contains only my project's jar, but none of the runtime dependencies.
108306
I'm trying to figure out what a Java applet's class file is doing under the hood. Opening it up with Notepad or Textpad just shows a bunch of gobbledy-gook.  Is there any way to wrangle it back into a somewhat-readable format so I can try to figure out what it's doing?   Environment == Windows w/ VS 2008 installed.
109620
I used   Runtime.getRuntime().exec("_____")   but it throws a IOException as below:  java.io.IOException: CreateProcess: c:/ error=5   at java.lang.Win32Process.create(Native Method)   at java.lang.Win32Process.&lt;init&gt;(Win32Process.java:63)   at java.lang.Runtime.execInternal(Native Method   I don't know whether I have the problem with specifying the path or something else. Can anyone please help me with the code.
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.
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?
37515
I have a Java project in Eclipse that requires Java 7 running in 32 bit mode. I tried to force running in 32 bit mode by adding the flag -d32 to the VM arguments.  However, I then get the following message:  Error: This Java instance does not support a 32-bit JVM. Please install the desired version.   I tried the same with Java 6, and there the flag works. So I supposed that I don't have a 32 bit version of Java installed. I checked all installed versions of java with /usr/libexec/java_home -V and get the following list:  1.7.0_75, x86_64:   "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home 1.7.0_67, x86_64:   "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home 1.6.0_65-b14-466.1, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home 1.6.0_65-b14-466.1, i386:   "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home   I then run the same command with the -d32 flag to check for 32 bit VMs and get the following list:  1.6.0_65-b14-466.1, i386:   "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home   So it really seems that there is no Java 7 with is compatible to run in 32bit mode available on my system. I checked the Internet, but couldn't find a way how to install 32 bit Java on a Mac. It always is assumed that the -d32 switch is working. My Mac is running Yosemite (10.10.2).  So what am I doing wrong? Is there a step for step tutorial that I can follow to run my application in Eclipse in 32bit mode with Java 7.
43021
I am executing an exe through my java program. The path is hardcoded in Java.  I have packaged my the exe in the jar.  But am stuck as I have the path name hardcoded in the Java file, so I am not able to execute my jar as a stand alone program.  Any hints for packaging such jar i.e having an exe inside and able to run it as a stand alone program?
54894
I use this command in the terminal to run the minecraft launcher with java 8:  /home/max/Java/jre1.8.0_25/bin/java -jar Minecraft.jar   I included the full java path because I installed it on /home as a normal user and i want to include it.   That command works, it opens the launcher with Java 8 but I want to make a bash file so I don't have to open the terminal. And, most important, I don't want the terminal to remain open when I click play in the Minecraft launcher and the game starts.  Now if i close manually the terminal when the game have started, the game is closed too.
2169
I was tring to install eclipse on ubuntu. What I did: I unzipped the tar archive of eclipse. I tried to start eclipse from the command line - like this - ./eclipse. It works. But then I tried to create a desktop icon with: gnome-desktop-item-edit ~/Desktop --create-new. In a new icon I showed the path to the eclipse executable which I could launch from the command line. But then eclipse does not start stating:  A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: /home/artem/eclipse/jre/bin/java java in your current PATH   The same message appears if I try to launch eclipse by double-clicking its original launcher. So it starts from the terminal but not from the desktop (it does not start when double-clicked) And also I get a message in the terminal (at some stage it appeared):  (gnome-desktop-item-edit:8998): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.DSV8LW': No such file or directory   I am using Ubuntu 12.04 x32 and eclipse Juno.  PS. PATH variable points at jdk/bin and JAVA_HOME - to the jdk folder PSS. I actually set the environment variables through .bashrc file(JAVA_HOME and PATH)
23089
This may sound like a stupid question. Where are the core class files from Sun, like Button.class, located in the JDK installation folder C:\Program Files\Java\jdk1.5.0_12?   Or do the class files reside in C:\Program Files\Java\jre1.5.0_12 folder?
77593
How can I install Java on Ubuntu 12.04?  I have:    Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
100462
I have uninstalled all old versions of the data loader and installed the newest one: 36.0.0  I cleaned up all Java stuff on my 64-bit Win 7 machine and there's only one version left, it's this version (output of java -version):  java version "1.8.0_73" Java(TM) SE Runtime Environment (build 1.8.0_73-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)   My JAVA_HOME environment variable is C:\Program Files\Java\jre1.8.0_73  If I open a CMD window, the java.exe can be found.  Still, trying to execute data loader results in "This application requires a Java Runtime Environment 1.8.0 (32-bit)"  So, do I really need a 32-bit Java version next to my 64-bit Java version? Is that even possible? Do I need to set up something else? I need the 64-bit version for other apps, I cannot replace it with a 32-bit version (provided that's even possible with 64-bit Win 7).