3 ms·
I'm dabbling with Java occasionally, and what always stumps me is that dependencies are handled differently in every environment. Learning how to add and use an
by creshal 11y ago
I'm dabbling with Java occasionally, and what always stumps me is that dependencies are handled differently in every environment. Learning how to add and use an external library in Android is too painful, and zero of that knowledge transfers to Java desktop applications, and zero of that to JBoss WARs.
At some point I just give up and start copy pasting source files; Java's whole environment is too painful for me to want to spend my free time on it, and too complex to learn it in passing at work. It's a lose-lose situation, and I just end up avoiding Java where I can. (Which imo is a shame, because JBoss e.g. turned out to be surprisingly neat once I wrapped my head around it.)
- lmm 11y agoWell there are a bunch of things that are not really Java and it's best to just avoid them; that's not really Java's fault though. I'm not sure what you're talking about with android versus desktop applications though; in android or a desktop application one adds a library as a maven dependency in exactly the same way. (At least, I do).
- creshal 11y ago> Well there are a bunch of things that are not really Java and it's best to just avoid them I've only ever heard that of Java and C++, and it seems it's always the stuff I cannot avoid because I need it for work.
- maaaats 11y agoYour complaint basically boils down to "I don't know how to do it correctly and don't want to learn it". I have a game I'm working on that uses the same setup for both Android and desktop. JBoss does things a crazy way, but for everything else the same approach can be used.
- ibejoeb 11y agoYou're doing a bunch of different things there, but none of this stuff is really a secret. You need to be familiar with java class loading[1] and Maven's dependency scopes[2], which is really it's killer feature. Beyond that, a container, such as jboss, is free define how its things work. One of my favorite things to come out of the Java ecosystem is OSGi, which does dependency management in a very sane way. [1] http://docs.oracle.com/javase/8/docs/technotes/tools/findingclasses.html http://docs.oracle.com/javase/8/docs/technotes/tools/finding... [2] https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope https://maven.apache.org/guides/introduction/introduction-to...