Java without Eclipse - Programming On Unix

Users browsing this thread: 1 Guest(s)
z3bra
Grey Hair Nixers
Hi geez ! I wrote an article about how to manage a Java project WITHOUT using Eclipse at all.


Some will disagree with me on a few points (see a previous discussion here), and they're not wrong. I'm not a full time Java developper, I just wrote a few projects in Java, and i came to this method (used here, for school).

It's probably not the best method to work in a company, where time is money, using 5k files per directory, private libraries, Java frameworks/plugins, but at least, I find it really worth trying, at least for learning purpose. The same can be applied to C/C++ projects, and many other languages.

Anyway, feel free to comment here, as I don't have a comment system on my website (and I don't want one ^^).
BANGARANG, MOTHERFUCKER
z3bra
Grey Hair Nixers
Meeeh... The server is under my desk, and the RJ45 cable was unplugged :/ Should be fine now. Sorry for inconvenience.
BANGARANG, MOTHERFUCKER
Ippytraxx
Members
Why not use a proper build tool like Maven or Gradle?
venam
Administrators
Coding on a simple text editor is fine but when the project gets huge it becomes too hard to manage with just a single MakeFile.
On the other hand, I personally prefer using a simple text editor for coding. We are taking java at university and I alternate between Eclipse and Vim.
crshd
Registered
I like your writing style. And I don't see the point in having to use an IDE - from what I just read, it really doesn't seem that complicated. But of course I've never done anything in Java...
z3bra
Grey Hair Nixers
(18-10-2013, 08:27 PM)Ippytraxx Wrote: Why not use a proper build tool like Maven or Gradle?
I never heard of them. But the point of the article is to show how to manage a project with the most basic tools. If you want to build the whole project from source, no need to download an IDE or a set of specific tools. Makefiles are a generic way to build project, and (almost) everybody has the "make" utility installed. I can't tell that for you tools ;-)

@venam
I think exactly like you, and I used to switch between vim and eclipse a lot at school. But using Eclipse just for building the project was too much for me. So I sat back and tough of this method for my next project. I had to learn the java buildings process from scratch, but it was worth it!
BANGARANG, MOTHERFUCKER
Miyazeaux
Members
Nice article! I've been working on a medium-scale Java project with a friend the past few weeks, with him using Eclipse and I using Vim. Eclipse is nice for certain things, however he has definitely wasted more time trying to placate Eclipse when packages weren't set up right.

I'm using an external tool kit to aid in my project, so I've added a "source /path/to/setup.sh" in my .bashrc so I never have to worry about "Symbol Not Found" errors during compilation. Doing it via a Makefile seems to take out the middleman though, I like that idea better.
tbuck153
Members
I've been doing some simple android development (java/xml) and managed to throw away eclipse in favor of vim and the command line. Not as bad as people make it out to be really. I've got some rudimentary omnicompletion via a plugin and with the tools provided in the SDK, eclipse just seems unnecessary for projects the size of mine. Building and installing to my device is as simple as 'ant debug' and then 'adb install'.
Ippytraxx
Members
(20-10-2013, 03:26 PM)Miyazeaux Wrote: Nice article! I've been working on a medium-scale Java project with a friend the past few weeks, with him using Eclipse and I using Vim. Eclipse is nice for certain things, however he has definitely wasted more time trying to placate Eclipse when packages weren't set up right.

I'm using an external tool kit to aid in my project, so I've added a "source /path/to/setup.sh" in my .bashrc so I never have to worry about "Symbol Not Found" errors during compilation. Doing it via a Makefile seems to take out the middleman though, I like that idea better.
As I said before why use actual makefiles when Java has its own build tools. Use something like Maven or Gradle, basically makefiles for Java, but better integrated.
Jayro
Long time nixers
I normally use Netbeans when working with Java but your post has given me some new things to try. I really like the design of your site as well.
z3bra
Grey Hair Nixers
Thanks a lot ! I'm glad it helped, or at least awaken curiosity ^^
BANGARANG, MOTHERFUCKER
Ippytraxx
Members
Okay so I've been using eclim the past couple of weeks and it's amazing! Sure there are still some IDE features I miss, but it's great on my low resource laptop. It adds a lot of IDE feautres to vim like project management, refactoring, moving, error detection, autocomplete, building, etc.

It's basically a headless eclipse + vim as the editor.

I highly recommend you guys to check it out. I still use Netbeans with the vim plugin but eclim comes very close to being able to just replace it entirely.
jmbi
Long time nixers
This will be very handy for me next year doing a CS course using exclusively Java, thanks!
pvtmert
Members
i am using nano and a simple makefile for java... creating own directories for every project and compiler - i think - handles it...

im using netbook 1024x600 of screen resolution... eclipse's panels occupy more space than code area... so i gave up at first try...

the only thing may be is suggestion from eclipse, but i found out that suggestions does not help a lot, you need to google anyway so eclipse is nothing more than bloat-shit

i personally prefer processing which is more simple and nice. bare-java has some weird behaviors... especially with swing...

also i never understand why that fucking java creates 4 threads in an hyper-threaded 1.6ghz atom processor... why for counting 1 to 10... it just laggs...
dami0
Long time nixers
One of the reasons I was reluctant to try out Java is because it's all locked up with IDEs and proprietary nonsense. Thanks z3bra!
ki113d
Members
Like venam said, when it comes to just coding a quick application, I'll opt for vim, but when it comes to larger projects, I'll use IntelliJ IDEA, which I must say shits on both Netbeans and Eclipse :P
neeasade
Grey Hair Nixers
I'm currently practicing java with intelliJ and gradle, been pleasant thus far.

I also had eclim(headless eclipse under vim) working for awhile, that was interesting.
jaagr
Members
FULL RANT WHICH I SINCERELY HOPE YOU CONSIDER VALID:

I work professionally with large code bases in Erlang, Scala and Java. There's a
bunch of tooling written in alot of other languages but those are the major ones.

I do almost all my coding in Vim, thanks to Eclim (the headless server neeasade
just mentioned (over half a year ago apparently).

It is a must if you are working in Vim with large projects, at least if you want
to focus on writing good code.

Try doing some more complex refactoring in an existing code base for example.
Should I come back with food in say... never? That's what I thought.

I recommend trying out Eclim and see how it can help improve your productivity!

> "Eclim doesn't work with editor X so Java sucks.. and slow if making AAA games"...

ok you're lost.. can't help you.

I use the IDE when I find a task or when I need to run some tooling, or whatever,
that is easier when done using the GUI built specifically for that task.

Enough on how to easily solve that editor issue.

---

And why was Eclipse even a problem?

OK - the JVM startup time can be a few seconds but once it's done booting up you're in.
Waiting for your slow computer to boot is not something that bothers you, but when the Editor takes a few seconds it's a disaster?
Still slow when it started? Go play developer on a faster computer.

Is it the GUI part you don't like because "that's not what they used to build X" then get your
head out of your ass (http://lists.gnu.org/archive/html/emacs-...02254.html).

I'm sure they would love the tools Eclipse exposes, but they didn't have the
wide range of tooling that we can choose from today.

But the language sucks if I need to use... *sigh*

These kind of reasons are more common than you'd think

The problem isn't the Editor.

The problem is that some arrogant idiot (the attitude is pretty obvious while reading)
who doesn't know Java, doesn't know the JVM and who thinks that the available
tooling is bloat... and that using your daily (undefined set of) tools is better.

I know you will all disagree and that I'm being a douche, bla bla old post bla
bla but posts like that is fucking stupid, and people just swallow it.

How many reads it and starts fixating around your mindset? Well, who knows.
But we see and hear this shit everywhere.. People who give advice about something they
think they know. Hopefully you'll meet some smart people who understand
that it doesn't work to be that close minded in this field.

If you want to teach them how to use make, manually write build specs and
grabbing dependencies - just show them the way to the local museum because
I'm sure they'll have time for an interactive workshop.

No one - except proud arrogant dicks like you - wants to manage that manually when
there are great tools to generate it for us, based on a set of rules.

The reason for these tools being invented in the first place was because the old
ones didn't do what the new environment needed done.

Send your build for a review and we could at least have some fun while we're at it.
200% performance miss because you prefer building Java with your own tools.
The tools who actually got to experience woodstock knows how this bloated java source
wants to be compiled. Compile dynamically in the JVM? No it will be too slow for my
stove led hud.

So stop being a reactionary dick and start using what's suitable for the task, if
what you intend to do is development. Is the goal a good application or 412 LOC?

Make is great, when Makefile's are generated for you.

"But X is using only make with 2000 lines of code" - ask the build team if they
finally enjoy reading through logs 8 hours aday.

Yes, your shitty project with 3 source files works great without a generator
and is really "leightweight, fast and posix-compliant". No one forces you to use
anything else but stop teaching others on how to build X better because trust
me that you are doing more harm then good.

One more time... Stop telling them X is better than Y.

I don't want my future pacemaker have (knock on wood) have a builtin update module
checking for patches because people are taught that it's easy to write C.

As a member of a community with 10k members you probably have a bunch of kids
looking up to you - which sets the whole fanboyism in action once again.

So get your mindset fixed, be responsible and DON'T tell them not to use A because
it's not fast or lightweight enough... for the desktop email indicator they are
planning to write.

"But I made a program in C and it's only 21K. Super leightweight, and posix which
obviously means that Java, Go, Rust, Ruby, Python or whatever sucks. Because
it's big and I might run my programs on devices made 80 years ago..."

It's fun to write programs or services that people enjoy using, and that's
probably something 90% of the kids won't experience since they're still looking
for a bug in Makefile.platform15 caused by someone telling them that abstraction
is bad and that you suck if you don't use foo, bar and of course C.

I love C, when we're separated by an abstraction layer..

"It gets so slow if you don't do it the hardcore way!!!1"
I hear this alot but I never see any valid tests being done. Fascinating.

---

A few days after I joined I saw a kid in the channel ranting about how much Java
sucks. He was talking about how much he hated object oriented programming.
A few hours later he asked what an object was.

That pretty much explains how easily affected they are because some asshole
tells them about what is right and what is wrong. Teach them stuff they
actully can use.. then the College professors won't have to deal with trying
to find "that guy" and make sure he doesn't get everyone else onboard.

There's some cool ppl on here, but I think I'm going back to the 21st century
where people are pushing software development in the right direction.

peace.

-- exaggerating? me? really...? (in case of ban - please add warning for future
readers who might risk getting polluted)
jmbi
Long time nixers
Ah, found the Java developer.

(04-06-2016, 06:40 PM)jaagr Wrote: I do almost all my coding in Vim, thanks to Eclim (the headless server neeasade just mentioned (over half a year ago apparently).

<b>It is a must if you are working in Vim with large projects, at least if you want to focus on writing good code.</b>

Maybe you need a large set of tools to baby you along in your programming, but most people get by with vanilla Vim. Of course, Java is a bloated language, so it's probably normal to use a bloated editor.

(04-06-2016, 06:40 PM)jaagr Wrote: Enough on how to easily solve that editor issue.

YMMV, editor wars will never be "easily solved."

(04-06-2016, 06:40 PM)jaagr Wrote: And why was Eclipse even a problem?

Did anyone ever say Eclipse was a problem? Z3bra posted this to "show how you can avoid [using eclipse], in favor of your daily tools." He even prefaces that saying "I am not saying that IDEs are evil!"

This is nixers, we are hackers, we enjoy <b>doing things because we fucking can.</b>

(04-06-2016, 06:40 PM)jaagr Wrote: Is it the GUI part you don't like because "that's not what they used to build X" then get your head out of your ass <a href="http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg02254.html">http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg02254.html</a>.

Okay, so you're quoting a mentally ill person who thinks the Eclipse GUI has "neat features?"

(04-06-2016, 06:40 PM)jaagr Wrote: The problem is that some arrogant idiot (the attitude is pretty obvious while reading) who doesn't know Java, doesn't know the JVM and who thinks that the available tooling is bloat... and that using your daily (undefined set of) tools is better.

Who are you to say that z3bra using his daily tools isn't better <b>for him</b>? Z3bra says, "I just finished a java project for my CS studies, on a bare notebook (without X.org). And I had NO PROBLEM with not using Eclipse at all!" He isn't advocating everybody do this, he's experimenting and sharing his experience. As a hacker, that's exciting, he's going outside the box. If you're so offended by people going outside the box, <b>you don't belong here</b>.

(04-06-2016, 06:40 PM)jaagr Wrote: If you want to teach them how to use make, manually write build specs and grabbing dependencies - just show them the way to the local museum because I'm sure they'll have time for an interactive workshop.

Just because makefiles don't align with your questionable philosophies, the fact is: makefiles aren't going anywhere. Check github, virtually every open source project has makefiles. Regardless of whether or not writing things manually is smart, knowing how they work is important and will come in handy.

(04-06-2016, 06:40 PM)jaagr Wrote: So stop being a reactionary dick and start using what's suitable for the task, if what you intend to do is development. Is the goal a good application or 412 LOC?

Maybe the goal is to <b>not have to change his entire fucking programming workflow just to program in Java</b>. That sounds like an admirable goal to me, and it's why I enjoyed reading his article.

(04-06-2016, 06:40 PM)jaagr Wrote: "But X is using only make with 2000 lines of code" - ask the build team if they finally enjoy reading through logs 8 hours aday.

I'm sure you have plenty of experience with logs if you mainly write Java and Scala.

(04-06-2016, 06:40 PM)jaagr Wrote: Yes, your shitty project with 3 source files works great without a generator and is really "leightweight, fast and posix-compliant". No one forces you to use anything else but stop teaching others on how to build X better because trust me that you are doing more harm then good.

It's a blog post dude, not a book. Again, he says, "<b>I am not saying that IDEs are evil! I am just showing how you can avoid them, in favor of your daily tools.</b> I just finished a java project for my CS studies, on a bare notebook (without X.org). And I had NO PROBLEM with not using Eclipse at all! Now let me introduce my setup. Of course, it's not as easy as double-clicking on the eclipse-setup.exe. but it follows <b>my</b> ideas, and <b>I'm happy with it!</b>"

(04-06-2016, 06:40 PM)jaagr Wrote: I don't want my future pacemaker have (knock on wood) have a builtin update module checking for patches because people are taught that it's easy to write C.

Maybe your future pacemaker should have it's builtin update module written in Java... oh wait...

No one says writing C is easy, but C isn't going anywhere, people have to learn.

(04-06-2016, 06:40 PM)jaagr Wrote: So get your mindset fixed, be responsible and <b>DON'T tell them not to use A because it's not fast or lightweight enough... for the desktop email indicator they are planning to write.</b>

This thinking is cancerous. Desktop email indicators should most definitely be fast and lightweight.

(04-06-2016, 06:40 PM)jaagr Wrote: "It gets so slow if you don't do it the hardcore way!!!1"
I hear this alot but I never see any valid tests being done. Fascinating.

Write a desktop indicator in Java, mine written in C will be faster and I guarantee it will be a fraction of the size. Is that a valid enough test for you?

(04-06-2016, 06:40 PM)jaagr Wrote: There's some cool ppl on here, but I think I'm going back to the 21st century where people are pushing software development in the <b>right direction</b>.

Hackers like z3bra are pushing software development in the right direction. Experimenting, documenting, tweaking, ricing, it's all part of the process. If you don't agree with that you definitely don't belong here.
jaagr
Members
I get that you're pissed but you did obviously not even grasp the point I'm trying to make.
Laserswald
Members
This is a great place, I think, to talk about ranting about tools.

The thing about human nature is that we really really like to feel right. We love telling ourselves that we have the ultimate truth about something, when there is really no ultimate truth. We can only get close enough, but it's advantageous to have convictions about what we think back when natural selection had a stronger influence on us. When it comes to tools, this makes sense, because we are finite beings and conserving our memory for things that are actually important is better than having information about how many tools work.

This is why I like to use my editor of choice instead of using an IDE. One environment that I can focus all of my effort into improving.

As far as languages are concerned, different languages are designed differently for different things. This seems obvious, but a lot of programmers don't realize this when they are talking about their pet language of choice. Realizing this is something that defuses me from talking about how language x is better than language y.

Popular languages like Java are popular for a reason. Java, in particular, is popular because it has a lot of features that make it appealing for writing business software. Most of these features are all about minimizing how much risk is associated with writing software in a business environment.

For example, Java is a managed language that runs in a VM. This reduces a lot of risk. For one thing, you don't have to compile your code more than once if you are moving to a different platform. It makes migration easy, which is very important for minimizing cost when it comes to expanding your business. Being a managed language also means that things like buffer overflows or segfaults are not really an issue, which is a big advantage for large business software.

Java is also object oriented. This is another big risk reducer: OO enforces encapsulation, which is very good when multiple programmers are writing code, which is what most use cases are in Java. It effectively disallows people from doing too much damage.

These properties make Java great at building big iron business code. And those limiting factors, the things that it enforces, are great for minimizing risk, but horrible for us hackers.

I don't know if you noticed, but we really like being in full control of our systems. It feels really good when you have something that works well that you made or you tweaked. Java is terrible for this because it's too safe of a language. It doesn't allow us to be in full control of how it works, which is why we don't like C++ either. We love simple and powerful, and that's not exactly what businesses like.

So yes, you are entitled to your opinion, jaggr. I hope I gave you enough reasons for ours. If you don't like our philosophy, then it's totally fine.
jmbi
Long time nixers
(04-06-2016, 08:40 PM)jaagr Wrote: I get that you're pissed but you did obviously not even grasp the point I'm trying to make.

What point is that? Make it more succinct (and less ranty), we might have an easier time grasping it.
jaagr
Members
You should like your editor and you should use it. I even explained How you can use it.

Simple and powerful - exactly. Using the knowledge shared in the public post, you'll achieve the exact opposite.
An weak build, an unefficient build system. If you don't understand how and why, you will need more experience. Simple as that.

You'll agree with me one day - when you start meeting yourself. Then you'll notice that you need to revise
that C++ comment as well since you think that C++ is further away from the metal. Then dig.

Good luck.
venam
Administrators
(04-06-2016, 06:40 PM)jaagr Wrote: How many reads it and starts fixating around your mindset? Well, who knows.
But we see and hear this shit everywhere.. People who give advice about something they
think they know. Hopefully you'll meet some smart people who understand
that it doesn't work to be that close minded in this field.
What's cool about the internet is that everyone has a freedom of speech.
We're no sheeples we make our own mind from what we read.
It doesn't mean that something is written online that it's the truth.

It's common to have people nag about things they don't know.

(04-06-2016, 06:40 PM)jaagr Wrote: So stop being a reactionary dick and start using what's suitable for the task, if
what you intend to do is development. Is the goal a good application or 412 LOC?

There is no "suitable way" for any tasks and it's always a pleasure to find someone hacking another way to do something.

(04-06-2016, 06:40 PM)jaagr Wrote: "It gets so slow if you don't do it the hardcore way!!!1"
I hear this alot but I never see any valid tests being done. Fascinating.

Speed doesn't matter in most cases (99%), you are right on that.
However, yes, there are benchmarks everywhere.

Now, it's the person's own choice if they want to write something in the C programming language or in python or perl or haskell or whatever.

(04-06-2016, 07:23 PM)jmbi Wrote: This is nixers, we are hackers, we enjoy doing things because we fucking can.

(04-06-2016, 07:23 PM)jmbi Wrote: Who are you to say that z3bra using his daily tools isn't better for him? Z3bra says, "I just finished a java project for my CS studies, on a bare notebook (without X.org). And I had NO PROBLEM with not using Eclipse at all!" He isn't advocating everybody do this, he's experimenting and sharing his experience. As a hacker, that's exciting, he's going outside the box. If you're so offended by people going outside the box, you don't belong here.

Ok... So it is an attack to z3bra's post. Like Jmbi said, he's not advocating using vim over eclipse at all, he's just showing a hack.

(04-06-2016, 06:40 PM)jaagr Wrote: There's some cool ppl on here, but I think I'm going back to the 21st century
where people are pushing software development in the right direction.

21st century? No idea what you mean.

If you are only looking in one direction and think it's the "right" direction there's no room for free thinking and improvement.

It's the internet, no one forces you to do anything.
Peace out!
z3bra
Grey Hair Nixers
I must have hurt yourself or someone close to you to receive such a huge amount
of insults from you.

You don't know me, you don't know my beliefs or ideas, and yet you judge me
based on a single post you (mis)read that I wrote almost 3 years ago. That's
rude.
I hope that after reading the following, you'll stop thinking that I am a
"fucking stupid arrogant idiot reactionnary dick".

part 1: Why makefiles + java

I've always been really curious to know how everything works under the hood.
When our high-school teacher taugh us Java, he asked everyone to fire up
eclipse, copy-paste an "hello world" he wrote and press the magic green button
to show that it works. During the C courses, the teachers were asking us to
compile everything by hand on the command line, and write makefiles so we could
understand the full process from writting the code to running it.
So, this "magic green button" in eclipse left me quite curious, and I wanted to
know more about it. I then asked the teacher what it was doing, and all I had
as an answer was: "You don't need to know how it works, as it has all been
automated for you." (or something along those lines).

Needless to say, I wanted to know more about it, so I started googling "how to
build a java project", and things like that. I was already good enough in java
to "skip" the basics the teacher was explaining, and digging how it works
under the hood.

So during the first courses, I started trying to "replicate" the job done by
this magic button with the only other build technology I knew: make.

When we started a project with my classmates, everyone was assigned a role by
the teacher, and I was designated "architect". We were using Ant to build the
project, but after setting it up correctly, I wanted to check if I could apply
what I learnt with the makefiles to this project, as a proof-of-concept.

I did, and it worked! My teacher was telling me all along that java projects
*HAD* to use eclipse to build them (or any IDE basically). Proving your teacher wrong is something oddly satisfying (even if today, I understand what he was
saying), so I wanted to share it with the world! Hence this blogpost.

This was an anwser to my teacher saying "You NEED Eclipse when you work
with Java". To whom I replied "No, you don't need Eclipse. All you need is an
editor and a build system."

Makefiles might not be the best way to build a java project. At my company, we use gradle, which works perfectly fine, and builds our big project perfectly.
And even if some of our developpers use Eclipse, everyone fires up a shell
when they need to build the project. That's why I think the point I was making
in this post is still valid.

part 2: misleading people

The point of this article was not to make people use makefiles + java instead
of an IDE. It was to show that all the magics that happens behind the scene
can be written by hand using a well-known build system.

Quote:but posts like that is fucking stupid, and people just swallow it.
The goal of this post was to teach people how to build a java project "by-hand"
rather than just clicking the magic button. I think it's important to
understand how the tools you're using actually work.

Quote:A few days after I joined I saw a kid in the channel ranting about how much Java
sucks. He was talking about how much he hated object oriented programming.
A few hours later he asked what an object was.
That's sad.
This chan actually suffer the "rant on everything mainstream" illness, and I
encourage people to check by themselves instead of repeating shit they hear.
Whenever I suspect someone to rant without particular knowledge/reason, I try
my best to prove them wrong, even if it's about a topic I don't agree with.

I also try not to tell people "Use X because Y sucks".

Now please stop being a jerk on people you don't know, for no particular
reason. We try our best to make this place a fun and peaceful place for
everybody, and it starts by avoiding insulting random people.
So yeah, in case you get banned, I hope this would serve as a warning for
future readers that we expect our users to respect each others.

peace.
jaagr
Members
Hi z3bra. I just wanted to say that I'm sorry for my obnoxious post. I don't know what flew into me, probably some other unrelated stuff that made my brain malfunction.

I'm usually a sympathetic and nice guy, even though I understand that's hard to believe considering...

So please understand that it was nothing personal towards you.

Keep doing what you do.
z3bra
Grey Hair Nixers
I'm glad you apologized for this. These look sincere so you're all forgiven!
I hope we'll deal more with the sympatic guy you're talking about, which seems tech savy and willing to try new technologies. This could lead to interesting discussions! You also pointed out valid problems, which have to be addressed, just not the wsy you did :)
As for my article, well maybe it's not clear enough that the point was about hacking stuff, and not encourage people to follow my lead. To be honest, I won't update it as it's old and that I don't think many people would read it anymore... But I'll definitely take your critics seriously and try to be more explicit in my future posts, so thanks for that!