8 ms·
Nobody has started a project with Ant in the last decade. Of all the Java projects on Github Ant is probably not even 1%. > Oh and now I have to make it work i
by jsiepkes 6y ago
Nobody has started a project with Ant in the last decade. Of all the Java projects on Github Ant is probably not even 1%.
> Oh and now I have to make it work in the IDE too, click through a billion menus and dialogs,
You click "Project from existing sources" in IntellIJ and it will recognize both Maven and Gradle projects and just work?
Sync the dependencies? configure runtimes and classpaths? What? With Maven and Gradle? Your talking Ant here.
- matwood 6y agoI only had to go a few comments to see someone (the person you're responding to) think Java is the same as it was 15 years ago.
- the_gipsy 6y agoI'm talking about a maven project I have to use sometimes at work. Let me walk you through all the shit I had to do: - Install and set the right java version system-wide - Copy some config files for the project system-wide (granted, this is not java specific, but still) - Click in some IDE menu to enable some build settings - Click in some IDE menu to install some "Lombok" plugin - Click in some IDE menu to select the right jdk - Click in some IDE menu to edit the run configuration: - select main class - paste program args - paste env vars - select right “Use classpath of module:” option - Click in some IDE menu to fiddle with "Spring Loader path": modules, dependencies, reorder the dependencies (!) - Click in some IDE menu to configure getting the actual logs - Click maven-sync, rebuild-project multiple times, restart IDE until it suddenly works The first guy who got it to work had to write a guide with screenshots! I know you will say, this is all fault of whoever made this crap project, or my fault for not fixing it. However this was my experience, and it has been similar every time in my life that I had to touch some java project (although this last one is the worst).
- sixbrx 6y agoIDE's can be fiddly, and anyway I don't think it's good to depend on an IDE for building. The project could have been set up instead with the "Maven wrapper"(1) which provides "mvn.cmd/sh" scripts at the top level of the project to fetch and run the proper Maven. So after cloning the project, all you have to do is set a proper JAVA_HOME if it's not already set, and then do "./mvn clean package" at the top of the project to do a complete build. The IDE's will then set themselves up properly if you import the project as a Maven project, and will sync with changes to the Maven pom.xml whenever it changes (Intellij does at least). That's really hard to beat. (1) https://github.com/takari/maven-wrapper https://github.com/takari/maven-wrapper (Being integrated into Maven itself soon).
- the_gipsy 6y agoI can (and often do) build from CLI, that is much smoother. I tried using vim on java, but honestly you need an IDE for all the constant code generation and incessant fixups by mouseclicks that are needed. Vim+coc is more than enough in the other languages that I use.
- dboreham 6y agoYou're living in a parallel universe from the rest of us. IDE isn't necessary (and positively odd) for building Java.
- the_gipsy 6y agoYou do need to be able to build from IDE when you set breakpoints to debug.
- Hackbraten 6y agoYour IDE should be able to connect to any JVM that has been launched with the proper VM arguments. We occasionally do remote debugging at work. It’s just a matter of copy/pasting the correct JVM incantation into the IDE.
- Hackbraten 6y agoI feel the parent comment was about editing, not building.
- vips7L 6y agoHe is. VsCode (or any editor) + the Eclipse Language Server is more than enough. His complaints about debugging is because he doesn't know about attach debugging.
- dunefox 6y agoThis is one of the main reasons why I won't work with Java. Everything is much more complex and unnecessarily arcane compared to other languages.
- Nursie 6y ago> I know you will say, this is all fault of whoever made this crap project It is. There's really no excuse for that. If it's been similar every time then you've worked on crap every time. Building a java project should be (and is on projects I work on) as easy as installing a jvm and running either maven or gradle to build it. End of story. "Install some lombok plugin" is only necessary if you want the IDE to understand lombok, IntelliJ will just pop up a box saying "Want this?" and you click "Yes". I don't see what's so onerous about that. The rest you describe is really down to poor developers.
- shoemakersteve 6y agoNo offense, but regardless of how right you might be, you come off as a bit of a condescending asshole. Like "Oh, you don't know that there's a more efficient way to do things? There can't possibly be any explanation other than you're literal human garbage and presumably have brain damage!". Come on, get off your high horse.
- Nursie 6y agoI'm really not on my high horse here, if you have a team working on a java project that's that hard to build, they're doing it wrong. Doesn't even matter what the language is really. So "no offense", but shove it.
- JAlexoid 6y agoThere's a difference between - "anything can be turned into an non-compiling pile of crap" and "this ecosystem comes as a pile of crap".
- towndrunk 6y agoI think you work at the same company as me!
- ivan_gammel 6y agoI can find maybe only one or two things from this list related to Java, both not reflecting current state of affairs. You do not make the need to have a run configuration a language or platform fault, do you?
- liveoneggs 6y agoYou say this as if python could do any better
- oblio 6y agoI've interacted to a ton of Java projects. And with a ton of various other commercial and Open Source projects. In my experience (sample size of hundreds of projects), Maven projects are <<by far>>, on average, easier to build and manage than most other languages. The repo structure is standardized, the build cycle is standardized, the built packages are always in the same place, etc. The Java installation is a 1-time think. It's also a quick google away. I see this complaint a lot, I never understand it. It's plain and simple bikeshedding: someone complaining about a 1-time task that takes 5 minutes in total. The rest of the stuff is IDE specific and I have no idea why you'd have to configure "getting the actual logs"?
- the_gipsy 6y agoWell Java is arguably one of the most IDE-reliant mainstream languages. It's completely unusable and unergonomic without the myriad of constant code generation and fixing as you write. Treating the IDE like a separate problem is not realistic with java. With e.g. Rust, I can use vim, vscode, whatever floats your boat. > no idea why you'd have to configure "getting the actual logs"? Some genius java logging library, I can only guess.
- kaba0 6y agoYou can write java with vim, without any trouble. It’s just that Java has the very best IDEs available and I would be stupid to not use them.
- oblio 6y ago> Well Java is arguably one of the most IDE-reliant mainstream languages. It's completely unusable and unergonomic without the myriad of constant code generation and fixing as you write. True, but with IntelliJ 99% of what you wrote is auto-configured. Eclipse needs a bit of hand-holding, but almost everything you described is due to project configuration. > Some genius java logging library, I can only guess. That's your problem, you're assuming that Java is dumb and its libraries are dumb. They're not. I'm reasonably sure that <<all>> mainstream Java logging libraries log to console by default. The previous engineer must have been a marvel of a developer to manage to screw even that up. What I'd say is: Java, especially older enterprise code, had a ton of over-engineered patterns. These are slowly fading away, except for Spring, and even Spring's simpler these days. Java also tends to have some low quality and a ton of average but unmotivated working devs on Java projects. So yeah, there's that ecosystem problem. But for example, if you'd start a new project and you approach Java with an open mind, it's one of the most powerful and flexible techs available. And it's much more modern than the stereotypes imply.
- kaba0 6y ago> I know you will say, this is all fault of whoever made this crap project, or my fault for not fixing it. However this was my experience, and it has been similar every time in my life that I had to touch some java project Yeah that’s a crap project. My experience was always that mvn install / ./gradlew run will just work. On all three OSs. And if I happen upon a decade old random jar file, and run java -jar something.jar, it will just work in the great majority of time. I think no other platform has it this smooth.
- KronisLV 6y agoIf you're using IntelliJ from JetBrains, there should be an option to store the run profiles for the project in the version control system. Even if your project is so messy, then you should be able to just to version a working setup (maybe needing to figure out how to make the correct JDK version be used across different machines) and after that it'd become a question of just having to check out the project from the version control system and click a green button in IntelliJ. This most likely wouldn't solve all of your issues, but at least would help make onboarding slightly less painful and slow.
- cutler 6y agoYou left out Gradle installed/downloaded options, Gradle version, Gradle JVM version, Gradle plugin auto-upgrades and the unholy mess this lot can create.
- ta988 6y agoThis is why we virtually all use the ./gradlew script that manage all of that by itself on every platform... No global installation of gradle should ever be done.
- lenkite 6y agoIsn't this rather overblown ? The first 5 steps appear to be a ONE-time framework and system setup for your IDE - and this assumes you have multiple JDK's. You certainly don't need to repeat this for every project. The run configuration can be automatically created by Intellij by attempting to execute a runnable class. You only need to set program args and env vars if needed - and that would be true for ANY language or program. The spring loader path appears to be specific for this project. The run logs are independent of Java. Thats just getting program logs. There is no need to maven-sync and rebuild-project multiple times, unless you are explicitly refactoring the project module/build structure. Once you have imported a maven project, you can simply click build.
- fian 6y agoGuess I'm nobody. I created a simple Swing (desktop) app in Java a couple of weeks ago. The process was something like: Create new Java project in IDE Add no dependencies Use the built in IDE tooling to create a runnable JAR and tick the box to export the Ant build to a build.xml file. Why would I want to complicate things by adding Maven/Gradle to the mix?
- lolive 6y agoI will give you the secret trick of senior developers: don't be the one who manages the build process, otherwise leave the project asap. And I will also give you the secret trick of superninja senior developpers: be the one who manages the build process, so you will never EVER be fired.
- isbvhodnvemrwvn 6y agoThis method is useless for most projects, so yes, you are nobody.
- oblio 6y agoAnd what if you want/need to add dependencies? A lot of them.
- fian 6y agoSure _then_ you might opt to use Maven or Gradle. My point is there are a wide variety of application types out there, not everything is a web application, not everything needs to use a complex build and dependency management system.
- oblio 6y agoYeah, but if you do know Maven, it scales down to small projects. The configuration for a simple project is trivial. So just use Maven and save anyone coming after you a bunch of trouble when they have to extend your project ;-)
- stepbeek 6y ago