Is it possible to edit, compile and run Java code in Xcode? - java

I am using Java for my CS class at school, and I am currently using IntelliJ IDEA as my IDE. Along with this, I am using C++ for my personal projects/college course. Is there any way to edit, compile, and run Java in Xcode so I don't have to switch IDEs?
My current Xcode version is Xcode 8.0 (8A218a). I would like to run using Java 1.8.*.

When I was in school, I attempted to do the same exact thing and I found that it took too much time compiling my Java code in Xcode, switching to my terminal to execute the executable, etc. In short, if you enjoy using Xcode, feel free to use it as a text editor but you won't get much use out of it beyond that using Java.
Not to mention, if you decide to pursue a career as a Java Developer, you're far better off mastering an IDE such as IntelliJ or Eclipse; most companies if not all use them. Good luck!

Related

Using Xcode5 to code in Java

I have been developing Java code for doing data analysis in astronomy and physical sciences for several years using xemacs and JDE, which I have grown accustomed to and like. However, I would like to use all the wonderful features included in Xcode to make my coding easier and better.
I know that Apple encourages developing in objective C, but I don't have the time or motivation to start with this at this time. I know Java pretty well, and therefore, I want to stick with it, as least for now.
After several hours of searching the web, I haven't been able to find any decent instructions on how to setup and use Xcode under Mountain Lion or Mavericks to develop Java code. And I don't really care about all the features that are related to developing application for OS X or iOS, I am coding libraries of classes to do statistical data analysis. I just want a nice IDE to do it in, and I don't really like the look and feel of Eclipse, which is the standard for Java.
So, in the end, my question is very simple, but I cannot find the answer by googling: how does one develop in Java using Xcode5?
XCode did previously support java development but that was removed when Apple decided to stop supporting Java on OS X.
Either you need an old version of XCode, or you should go - which I would recommend you to do - with a Java IDE like Netbeans! eclipse and/or IntelliJ. After installing oracle java 7, all of them run well.

How to debug a ImageJ plugin in Emacs by using JDEE environment?

I am currently developing a plugin for ImageJ, it's based on Java. I am not familiar with Java much since I used to be a C/C++ developer. It seems that debugging java program has a lot of differences comparing using GDB/GUD in emacs. I know I can use Eclipse to deal with the debug but I just don't want to waste my time on learning another IDE. Thank you very much for your thoughts!
Have you tried JDEE for Emacs?
If you are planning on doing Java for more than a week I really advise you to use eclipse or netbeans. Yes it is a new IDE. But the advantages of this type of IDE for Java are immense.

emacs jruby config -- using java

Is anyone using Jruby in emacs? I have setup emacs and it works perfectly for ruby code using jruby. However notice that java code isn't executing from within emacs. I have installed mode-compile and all my code except for java in jruby.
Been searching options for Java and of course found JDEE, noticed in a previous java specific thread however concerns with JDEE What is the best way to do Java development in Emacs? age/not developed/works only for Java5 etc.
I found another emacs how-to http://zarb.org/~gc/html/java-emacs.html noted the date it was posted was 2005 and the author advised to use Eclipse for Java.
Has anybody got suggestion on using Jruby in emacs?
Malabar-mode is the only real alternative to JDEE(especially for Maven based projects). I'm not sure how it will fit into your JRuby development toolchain, though. Another more general solution would plain old java-mode + CEDET + emacs code browser.

Lightweight Java IDE that Maintains Indentation?

Whenever I am debugging a java program, I have to have the code indented! And I hate to manually indent code one by one (using Tab).
I would really like a lightweight Java IDE that automatically indents ALL your code at a push of a button.
A good example is "Ready To Program" Java IDE, but the downside to this IDE is that it is not compatible with JDK 1.5+
Are there any suggestions on such a Java IDE?
IntellJ IDEA and Eclipse come to my mind.
I wouldn't call Eclipse light weight though.
I use Notepad++ for quick indentation. It's called "Reindent C++ code" but it works just as well for Java code.
http://notepad-plus-plus.org/
You can use the Factor option in Netbeans to properly format/indent your Java code. It's even got a handy shortcut: Alt+Shift+F
Edit: Oh yeah, Netbeans is great, but not really lightweight...
In the good old days, I used to use emacs as an "IDE" for Java development. It has excellent support for code indentation and formatting.
Coding Java in NPP must be similar experience to shaving yourself with blunt stone and using vodka instead of aftershave. It may look manly, but there's no reason. It's XXI century. Intellij will run on any reasonable PC, same with NetBeans and Eclipse.
Those features are no-brainer for me, along with about hundred of others. Build in debugger with ability to execute any piece of code, or checking variable state are also necessary. I know that most of debugger may be replaced with good suite of unit tests, however sometimes you just need to check something live.
And as we are on topic of unit tests, even that is possible to simplify with good IDE. Intellij allows you to navigate between class and test class, run single test, whole class or suite with simple key stroke, generate test method from template, etc.
If you live from writing code, then don't do it to yourself and just buy a license, or use open version. Life is to short to work on NPP with plugins.
Disclaimer: Vim is okay, if you have to reconfigure something on live system in order to save a lot of $$$, c's it'll take time to deploy new version. In any other case, using advanced notepad is just stupid. Why? For same reason as coding not on decent hardware but on OLPC.

Emacs and Java change propagation and errors notification

Emacs and Java change propagation
Hi,
I'm mostly used to code in IDE like Eclipse but I wanted to try emacs. Because I keep hearing about how much better it is than big IDE like Eclipse and Visual Studio.
So I was looking at what emacs provides for Java (with the JDEE extension) but it doesn't seem as complete as Eclipse.
One of the most important thing I look for in a Java editor is change propagation and error notification. For example if I rename a class, I want to be able to have all the declarations of this class renamed automatically. And if I delete a method, I want to be able to see all the place where this creates errors.
I didn't find those things in emacs, and this is a showstopper for me, I can't see how I could work on big projects without those features.
So my question is : those features don't exist or is it just me that haven't looked at the right place?
Emacs can be better that Eclipse, but the question is "for what"? Emacs (and VIM) are generally smaller, faster and optimized for text editing and navigation*. In recent versions Eclipse are quite capable for editing and navigating java code but with different "style".
If you are willing to learn Emacs then learn it. You will get experiences on your own and it is very important for a developer (you are the only one can decide what is work for you). But learning Emacs does not mean to "throw out" Eclipse, they can co-exist quite well if you use ant or maven-based project building and a source control system. You can for example do all editing in Emacs while for debugging and refactoring use Eclipse.
There are some interesting thought in this thread about Emacs and java development. Also there is an interesting read and conclusions about Emacs and Eclipse from someone who tried both environment.
If you are not an expert Eclipse user yet you should look at the powerful editing and navigating features of Eclipse before starting Emacs:
10 Eclipse navigation shortcuts every java programmer should know
Effective Eclipse: shortcut keys
Effective Eclipse: custom templates
Effective Eclipse: fix it quickly
Back to the question: there is an Emacs extension called Xrefactory for Java but it does not support Java 1.5 features so it is useful only if you use Java 1.4 or older.
(*) of course they are much more, I know :)
Emacs is an incredible editor, with good support for developing in C. For developing in Java there is much better support in one of the Java IDE's which has deep knowledge about the programs being edited. You probably want something like Eclipse, JDeveloper or Netbeans.
In my opinion you will not be satisified with developing Java with Emacs, and you should use another tool.
I don't know much about Emacs (so you may regard the following as off-topic), but I work with both Eclipse and VIM.
I use Eclipse for big Java projects, and I can't live without the large-scale features (cross-project renaming/refactoring etc.). I use VIM for small scale stuff (e.g. knocking up code for StackOverflow examples in multiple languages).
Eclipse and VIM have very different capabilities and consequently I use each bearing this in mind. I don't expect VIM to do the heavy lifting, but on the other hand I don't expect Eclipse to start in a keystroke and to be able to write a new (small) project in a few seconds (in whatever language I require - not restricted to Java). Perhaps you should look at the Emacs/Eclipse pair in a similar light ?

Categories