Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Java X(


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Daggerbot   Members   -  Reputation: 127

Like
0Likes
Like

Posted 22 March 2011 - 10:02 PM

Most of the coding I've done throughout my life has been in either C or C++. I've done quite a bit of Java, but have been unable to complete anything substantial with it because of various little annoyances. I normally do my coding in Gedit for its simplicity, and simply type 'make' into the command line to build my program. But writing a makefile for a Java based app isn't as clean as it should be. When writing a C/C++ app, GCC can generate a dependency list for each source file. When any of the dependencies (headers) are modified, make knows to recompile the source. But in Java, if, for example, I change the constant 'ClassOne.CONSTANT' which is used by 'ClassTwo', there's no way for make to know that 'ClassTwo' should be rebuilt. I've searched for dependency generators with no luck.

After giving up on the simple command line + text editor style of development for Java, I tried out a few IDEs. I liked JCreator, but this appears to be for only Windows, which I try to avoid whenever I can. I also tried NetBeans and Eclipse, both of which I find completely unusable. Both of them try to write code for you, such as increasing indentation, writing closing brackets, and inaccurately predicting which method name I'm writing. And it appears that some of these annoying features are impossible to disable. Is there a single Java IDE out there with a text editor whose only purpose is to edit text?

Before giving up on Java development forever, I'd like to see if there are any other options that you guys think may suit me. Any help is appreciated ;)



Sponsor:

#2 Rycross   Members   -  Reputation: 576

Like
1Likes
Like

Posted 23 March 2011 - 12:36 AM

Ok, to answer the question directly, why not just use your favorite text editor and Apache Ant?

See http://ant.apache.org/

Its the de-facto standard Java build tool.

Also, I think you have some misconceptions about how Java's compilation model works. In your given example, you do not need to rebuild ClassTwo.

Edit: You might also want to peruse http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html Javac will automatically recompile dependencies if necessary and it finds the source code (i.e. specified on the sourcepath). But again, in cases like the one you outlined, recompilation is not necessary.

#3 BitMaster   Crossbones+   -  Reputation: 4234

Like
1Likes
Like

Posted 23 March 2011 - 01:38 AM

Adding to what Rycross already said, my experience with Eclipse is that you can configure practically everything, including what (and if) indentation and bracket placement is to be used, even though it can be a bit of a challenge the first time you try to configure it.

#4 rip-off   Moderators   -  Reputation: 8517

Like
2Likes
Like

Posted 23 March 2011 - 04:28 AM

Apache's "Maven" is another popular build system.

You can generally disable all that stuff in your IDE. It is actually helpful though, you can configure it to indent the way you want, and auto-complete is just plain handy so you don't need an API reference handy.

It might take some getting used to if you started with a "raw" experience. I used to be the same when I first started out programming. Now that I write bigger and more complex applications using a diverse set of libraries I appreciate that using proper tools saves me time.

If nothing else using an IDE will give you an excellent debugger, which is invaluable at times.

#5 e‍dd   Members   -  Reputation: 2105

Like
0Likes
Like

Posted 23 March 2011 - 04:18 PM

Also, I think you have some misconceptions about how Java's compilation model works. In your given example, you do not need to rebuild ClassTwo.

But your build system (or often your IDE in the case of Java) at least needs to check. If ClassTwo imports ClassOne, and ClassOne.java has changed then ClassTwo *might* need recompiling because without identifying exactly what in ClassOne changed you can't be sure that recompilation isn't necessary. Java dependencies such as this are incredibly difficult to express in a make-style dependency graph.

I'd actually go so far to say that to achieve anything close to minimal recompilation in Java builds, you really *need* a Java-aware IDE. An off-the-shelf DAG-driven build system will always struggle to get this right.

Edit: You might also want to peruse http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html Javac will automatically recompile dependencies if necessary and it finds the source code (i.e. specified on the sourcepath). But again, in cases like the one you outlined, recompilation is not necessary.

If you go this route and use make be very careful, as it will introduce race conditions in to parallel builds, potentially producing corrupt .class files.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS