I've currently got an eclipse project with two main methods and was wondering if it's possible to create a jar file which runs an Apache Ant script when the jar file is executed. I've provided an Ant script below where two main methods are run. Thanks in advance.      &lt;?xml version="1.0"?&gt;       &lt;project name="Test" default="run_external"&gt;         &lt;target name="compile"&gt;             &lt;delete dir="bin" /&gt;             &lt;mkdir dir="bin" /&gt;             &lt;javac srcdir="src" destdir="bin" /&gt;         &lt;/target&gt;         &lt;target name="run_external" depends="compile"&gt;             &lt;parallel&gt;                 &lt;exec executable="cmd" dir="bin"&gt;                     &lt;arg value="/c start cmd.exe /k java test.Main" /&gt;                 &lt;/exec&gt;                 &lt;exec executable="cmd" dir="bin"&gt;                     &lt;arg value="/c start cmd.exe /k java test.Main2" /&gt;                 &lt;/exec&gt;             &lt;/parallel&gt;         &lt;/target&gt;     &lt;/project&gt;
I've compiled a java project into a Jar file, and am having issues running it.  When I run:  java -jar myJar.jar   I get the following error  Could not find the main class: myClass   The class file is not in the root directory of the jar so I've tried changing the path of the main class to match the path to the class file and I get the same issue.  Should I be flattening the file structure? if so how do I do this. I'm using Ant to build the Jar file if thats of any use.  UPDATE   Here is the contents of the jar and the relevant Ant sections, I've changed the name of the firm I work for to "org":  META-INF/ META-INF/MANIFEST.MF dataAccessLayer/ dataAccessLayer/databaseTest.class org/ org/eventService/ org/eventService/DatabaseObject.class org/eventService/DatabaseObjectFactory.class org/eventService/DbEventClientImpl$HearBeatMonitor.class org/eventService/DbEventClientImpl.class org/eventService/EmptyQueryListException.class org/eventService/EventHandlerWorkItem.class org/eventService/EventProcessor.class org/eventService/EventTypeEnum.class org/eventService/EventWorkQueue$MonitorThread.class org/eventService/EventWorkQueue$PoolWorker.class org/eventService/EventWorkQueue.class org/eventService/FailedToLoadDriverException.class org/eventService/IConnectionFailureListener.class org/eventService/InvalidEventTypeException.class org/eventService/JdbcInterfaceConnection.class org/eventService/NullArgumentException.class org/eventService/OracleDatabaseObject.class org/eventService/ProactiveClientEventLogger.class org/eventService/ProactiveClientEventLoggerException.class org/eventService/PropertyMap.class org/eventService/SQLServerDatabaseObject.class org/eventService/TestHarness.class org/eventService/Utilities.class   And the ant target:  &lt;target name="compile" depends="init" description="compile the source "&gt;     &lt;javac srcdir="src" destdir="bin" classpathref="project.class.path"/&gt; &lt;/target&gt; &lt;target name="buildjar" description="build jar file" depends="compile"&gt;     &lt;mkdir dir="dist"/&gt;     &lt;jar destfile="dist/myJar.jar" basedir="bin" includes="**/*.class" &gt;         &lt;manifest&gt;             &lt;attribute name="Main-Class" value="org.eventService.ProactiveClientEventLogger"/&gt;         &lt;/manifest&gt;      &lt;/jar&gt; &lt;/target&gt;
How can I create a text input box with Pygame? What is the word for act of monotonously demanding for something (many be a toy) repeatedly? Say you have the infinitely continued fraction: $$x+\cfrac{1}{x^2+\cfrac{1}{x^3+\cfrac{1}{x^4+\ddots}}}$$ When $x=1$, you can see that it's $$1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\ddots}}}$$ which converges upon the golden ratio $\phi = 1.61803398875...$. What if I were to plug in $x=2$? $$2+\cfrac{1}{4+\cfrac{1}{8+\cfrac{1}{16+\ddots}}}$$ Using a caluclator, it seems to converge upon the irrational number: $2.24248109286...$ Is there any way I can represent this irrational number algebraically? How to address a professor in letter? "Open in browser" does nothing when Android app is set as default What are these circular splotches on my negatives? Delete files older than X days + I have found the command to delete files older than 5 days in a folder  find /path/to/files* -mtime +5 -exec rm {} \;   But how do I also do this for subdirectories in that folder? Finding a 2x2 Matrix raised to the power of 1000 How do I modify the options for the power button? When I press the power button a dialog opens, but I want to shutdown the system without receiving "Do you really really want to shutdown?". How can I choose a direct shutdown action on a pressed power button?   I had the same problem with the 11.04 version, but I don't remember the solution and yesterday I upgraded to Ubuntu 11.10. How to do relative imports in Python? Is there is a way to exclude nested subdirectory specified by a path to that dir from grep recursive search? Or I have to use ack or find for this?  Here's what I want. Say I have this dir structure:  dir/nesteddir/match.txt otherdir/nesteddir/match.txt   How do I exclude first nesteddir only? Is it even possible using grep?  Most obvious answer $ grep -r --exclude-dir="dir/nesteddir" "stringToFind" . doesn't seem to work, nor do any of my experiments with various --exclude-dir paths using globbing, leading ./, etc.   Reading man page and googling didn't help, the only mention of this usecase I found is this question:   It was concluded that this is bug introduced in grep 2.12, but I'm using latest version (2.16) and grep's bugtracker () doesn't mention anything related to --exclude-dir, so I guess either it was fixed or it's an intended behaviour.   Would be really nice to get some clarification. Text Distortion Effect (like it is written on a page) I want to display a text like it is written on some surface like notebook page or wall via Photoshop CS6. I added two example.   This image seems like image distortion:    And this image looks like text distortion:    I tried this with distort and skew transformation but I'm unable to get this much clear &amp; real effect. Variable with colon dash ${VAR:-} Let $\sim$ be the equivalence relation on $S_1 \times I$ given by $(x,t)\sim(y,s)$ if and only if $xt=ys$ where $I=[0,1]$  How do I prove that $(S_1 \times I)/\sim$ is homeomorphic to the unit disk $D^2$ with the induced topology? I want to see all URLs that for packages that would be downloaded for apt install &lt;pkg&gt; without actually installing the package.  Normally, the URLs can be extracted from the screen output after installing the package (as above).  An example of a URL I want to list:    Is it only possible to get such list of URLs beforehand by looking through all the apt's package source lists? How to fix broken taskbar icons in Windows 7 Why can't Transporter technology be used as a weapon? Seems like this is the most powerful weapon of all: transport your enemy into a bulkhead, planet, etc. Transport your enemy's ship inside a planet, etc.  Is there some technical reason that it can not be used this way? I have created a fishnet grid (3km x 3km) over a vector polygon.   I now want to clip the fishnet over the vector polygon retaining all grid squares within the boundary of the polygon.   Therefore I want all squares that would typically be clipped into partial squares to remain as whole squares.   Does anybody know how to do this? Using induction to prove that $\sum_{r=1}^n r\cdot r! =(n+1)! -1$ Use induction to prove that    $\displaystyle\sum_{r=1}^n r\cdot r! =(n+1)! -1$   I first showed that the formula holds true for $n=1$.  Then I put n as $k$ and got an expression for the sum in terms of $k$.  I then found the sum till the $(k+1)$th term by adding the $(k+1)$th term to both sides of the equation and compared it to the sum expression I get by plugging $k+1$ into the sum expression given in the question - they don't match. Prove or show a counter example for: $\forall a, b, c \in \mathbb Z$, if $ab\mid c$ then $a\mid c$ and $b\mid c$ I'm working on my Discrete Mathematics homework and they are asking me this:  Prove or show a counterexample for: $\forall a, b, c \in \mathbb Z$, if $ab\mid c$ then $a\mid c$ and $b\mid c$  I'm not completely sure how to prove it. I was thinking to find a counterexample like zero but I'm not sure if that it's going to work. Or maybe try to approach it backwards?   I'm a little bit lost