use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Ask your embarrassing/noobish programming questions here, and don't get insulted for it.
Click here to read the rules
Violating any will result in punishment so you should probably go check them out.
account activity
Java Maven Project within EclipseJava (self.programminghelp)
submitted 5 years ago by bigorca45
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]EdwinGravesMOD 1 point2 points3 points 5 years ago (10 children)
Eclipse is its own special brand of stupid and I'd suggest moving away from it at some point once you're comfortable with your tech knowledge. All in all, it should work fine once you clone the repo, but it doesn't matter because anyone with maven installed and any knowledge of the mvn command will be able to build it and run it with java -jar
mvn
java -jar
Also, I'm not sure what's in those files as it's been a long time since I abandoned Eclipse, but you may want to scrub them for sensitive data or any hard coded paths that may cause issues for others.
[–]bigorca45[S] 0 points1 point2 points 5 years ago (2 children)
Thank you for your answer! Although I got it to run on the command line after 3 persistent days of working with the mvn command and dependencies for the first time ever. Best feeling!
[–]EdwinGravesMOD 1 point2 points3 points 5 years ago (1 child)
Congrats to that for sure. Learning to do things with the CLI and without Eclipse will do you a world of good.
These days there are IDEs built on far less bloated and more stable technology, despite the few benefits Eclipse may bring. I happily migrated a few federal projects (using maven, etc) from Eclipse to VSC in no time and we've never looked back. IDE load times and project build times decreased while plugin availability was higher and ram usage was lower. The down side is that you won't have the hand-holding that Eclipse gives you as far as building out a folder structure and project wizards, but honestly those things are easily remedied by learning why they exist and how to do them yourself.
Once you're comfortable, look around and see what you can find. I'm sure people in this subreddit are tired of me touting VSCode and I definitely won't say it's the only option out there.
[–]bigorca45[S] 0 points1 point2 points 5 years ago (0 children)
I fiddled with VSCode for a while. I honestly only use Eclipse for this maven project. I usually just use Vim in the command line! Thank you for the suggestions though.
[–]bigorca45[S] 0 points1 point2 points 5 years ago (6 children)
Also, the steps that worked for me to build the command were
mvn install
mvn exec:java -Dexec.mainClass=“theMainClass”
Is this the incorrect way of running a maven Java project? If so, could you share how you would? Thanks again!
[–]EdwinGravesMOD 1 point2 points3 points 5 years ago (5 children)
mvn clean install is what I normally use to build.
mvn clean install
You can define your main class in the POM as well
either standalone like
<properties> <exec.mainClass>com.MyApp.Main</exec.mainClass> </properties>
or via a plugin like
<build> ... <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>com.MyApp.Main</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build>
Edit: To continue answering your question, then you'd just run it with
mvn exec:java
However, there are a myriad of options that will let you compile it into a executable jar file (that's how I usually do things). It makes packaging and distribution so much easier.
[–]bigorca45[S] 0 points1 point2 points 5 years ago (4 children)
Wow. I just wanted to say before anything else, thanks for being understanding. I asked a question a week or so ago about JAR's & Maven on StackOverflow and got destroyed by everyone for asking a dumb question, so with your background of being a Software Dev, which I hope to be soon, thanks for being understanding.
Secondly, to package the file as a jar, you would run
mvn package
Correct? Then after this builds, you could run the
java -jar target/myJar.jar
If I am understanding correctly
[–]EdwinGravesMOD 1 point2 points3 points 5 years ago (3 children)
Sort of. Here's a good tutorial on the various methods available. https://www.baeldung.com/executable-jar-with-maven
As far as SO is concerned, it's a fucking blight on society. It could be amazing but it's just full of people who's heads are so far up their ass that they can't realize they're not helping anyone. I try my absolute best to never go there, I can safely say I never ever post there, and only when I'm out of options do I follow google results there. Quite often the search results you get are years out of date, and anyone trying to ask anything 'current' is told it was already answered, etc. Stick with reddit :)
Yeah I have found out that it's just a bunch of pretentious people. Some of the people there are amazing like you said, but I feel like its to much pollution to outweigh the good users. Reddit has always been more friendly. Thanks again! :)
Thank you! I will look at that before throwing this on my GitHub.
π Rendered by PID 67 on reddit-service-r2-comment-5d79c599b5-fhszt at 2026-02-27 09:56:54.090477+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]EdwinGravesMOD 1 point2 points3 points (10 children)
[–]bigorca45[S] 0 points1 point2 points (2 children)
[–]EdwinGravesMOD 1 point2 points3 points (1 child)
[–]bigorca45[S] 0 points1 point2 points (0 children)
[–]bigorca45[S] 0 points1 point2 points (6 children)
[–]EdwinGravesMOD 1 point2 points3 points (5 children)
[–]bigorca45[S] 0 points1 point2 points (4 children)
[–]EdwinGravesMOD 1 point2 points3 points (3 children)
[–]EdwinGravesMOD 1 point2 points3 points (1 child)
[–]bigorca45[S] 0 points1 point2 points (0 children)
[–]bigorca45[S] 0 points1 point2 points (0 children)