Using Xcode5 to code in Java - 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.

Related

Java or Objective-C for MacOSX (back to 10.3 & PPC)

We are starting some new app development but because of special business requirements, need to support back to Mac OS X 10.3 as well as PPC/Intel CPUs.
The latest Xcode 4 isn't an option, from what I can tell it only goes back to 10.5 and doesn't support PPC at all. Is Xcode 3 an option? Would it be easier to just use Java?
P.S. From anyone experienced in either, can you please comment on some of the pros and cons you've bumped into?
EDIT
As requested, here's a brief overview of the app:
The app needs to talk to a server which will expose JSON web services. The app itself needs to be built in a way that will allow plugins (not 3rd party, but in-house with the ability to customize which features the customer owns). Each plugin will gather specific information about the host OS - such as running apps, users, CPU usage, etc.
If you can find a way to make Objective-C work with your requirements, it is worth it in my opinion.
I myself am a former Java developer who has moved into the creation of native Mac OS and iOS apps. I tried using Java for some of my early Mac OS projects and always found the support to be lacking. It can be done, but it was always more difficult than it should've been and never worked as well as a native app.
Here is a link to another SO post that describes some workarounds for getting older SDK versions working in Xcode 4. I can't vouch for how well they work with current versions of Xcode, but it's worth trying.
In view of your requirements, especially the need to do some system evaluation, I would strongly recommend to use Objective-C and the Apple development environment. You will have a lot of difficulties using Java to retrieve the neccessary information about the host OS, that you want to use in your application.
You could try to run Xcode with older SDK versions, but I have virtually no experience on OSX to give you solid advice on how to do this.
EDIT: My Xcode 4 gives me an option to select a "Deployment Target", where I can go back to supporting 10.1, but I have no idea, if this is the right thing...
Well,
Apple isn't a Java friendly company. You don't have all the bindings you may need on their JVM.
So I strongelly recommend (given that your project will be Mac OS X only) Objective C instead of Java
I program in Java but on Mac OS X, Objective-C is better than Java because it is faster and developed by Apple itself. Moreover, if you develop a program in Objective-C, you can sell it on the Mac App Store while if you develop it with Java you can't.
So go with Objective-C.

Starting with Android: Java or Python (SL4A)

I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.
I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.
At the moment you cannot create a releasable program with Python (or any other scripting language) using SL4A. I have heard rumours that this is something Google is working on, but even if they do enable it Python apps are likely to be slow and power-hungry compared to Java. Also the scripting API only gives you access to a limited subset of the native Java API. I would not consider using SL4A for serious development work at the moment, only for one-off scripts and prototyping.
Take a look at Scala. It is a statically typed language on the JVM, but uses type inference to remove most of the noise that you get in Java. It also fully supports functional programming, and has a lot of pythonish features. Because it is statically typed it is as efficient as straight Java with none of the disadvantages. IMHO it is the language that Java should have been in the first place.
A lot of people are blogging about using Scala on Android, so Google around for more information.
More likely will depend what type of applications you will develop.
I would start with Java to become familiar with Android SDK. Anyway first you need to look into some examples, tutorials. Most of them are done in Java, and only a few, probably on the dev site of SL4A for that.
Also there is native development Android NDK, that can be programmed with C++.
But anyway Java rules for general applications.
Adding an update to Dave Kirby's answer:
Issue 55, Distribute scripts as APKs, in the issue tracker at SL4A deals specifically with that.
There is a solution being worked out (may be complete by now) described at SharingScripts. The only issue seems to be that you need to have a interpreter APK already installed.
you may want to check out Ruboto it is a framework for developing Android apps based on JRuby which means your JRuby code can call Android APIs and can also be called back from the Android Java side.
Here is an introduction article .
Consider ising Kivy, if you want to write Android apps with Python. The process of packing script to .apk file is described here.
The problem is, resulting .apk will be big (~7Mb for 300Kb data). It is obvious, because you need to pack there Python runtime and all libraries.
Another solution I have heard of, is Pygame for Android, but it works on lower lewel, so you need to draw graphics manually.
Unfortunately, I have not tried any of this ways yet, but it looks, that I'm going to start using kivy soon.

Java in a Microsoft shop

I've been introduced to this wonderful project, xhtmlrenderer; the flying saucer project. Problem is, is that where I work, it's strictly a microsoft shop and I haven't done any java development since college, and a smidge of WebSphere a few years back.
I was wondering what it takes these days to do java development? I set up a quick proof of concept to see if I could do what I wanted with this project and it works great, however, I used jnbridge whose licenses are a bit on the expensive side but Visual Studio was what I had handy and got the job done with an hour of finagling.
I'm wondering what it take to do java development these days? Are servlets still the norm? Is Apache where I should start looking to get a small web server up and running? Is Eclipse/Ganymede the IDE to use?
Essentially what I want to do is pass a url to the service and have it spit back out a PDF. Just on vacation right now, and stuck on dial up, but can't stop thinking about this.
Thought I'd post these thoughts now to see if I can get a jump start on next weeks work.
Eclipse is certainly the IDE on no budget, NetBeans is also free. I prefer IDEA from Intellij, but for something that sounds like such a side part of your project, it probably isn't worth the money.
In terms of servlets, etc., it really depends on the archetecture/scalability you are looking for.
If you are looking for something that needs to run as a small web interface, then something like Jetty or Tomcat with a basic servlet should be fine.
You might be looking at something invoked via the command line, although starting a JVM for every conversion is going to be too heavy for all but the most trivial usages, but a little program that monitors a directory and pulls stuff out of it for the conversion may be what you need.
If you give more details about the archetecture and how you are planing to use it you could get some more specific advice.
In general .NET and Java development are quite similar (.NET was started to compete directly with Java, after all), but the real practical difference is that a lot of the .NET environment is kind of provided to you on a silver platter. You need a web container, you have IIS, you need a database, you have MS-SQL, You need an IDE, you have Visual Studio, etc., etc. In Java development, these are all choices to be made, there isn't really a default obvious good choice for a lot of things - there are many competitors. That can create a larger curve for a Microsoft shop than you are expecting.
Java's not all that different, although generics add some excitement; PDF with iText is fairly straightforward; and the IDE world is pretty much the same as ever. Eclipse and Netbeans are common, there are several others, and real programmers still use EMACS.
Apache is pretty generic, but with servlets in mind you might think about Tomcat.
If you want a small enough web server, you can always use an embedded Jetty. If you need the full services of Tomcat, it's also available. For Java development, I use Eclipse for an IDE. Not only is it free, but its support of refactoring is ahead of Visual Studio. Actually, if you used the WebSphere development environment, then Eclipse will be very familiar.
Consider sneaking in IKVM (http://www.ikvm.net/) as it allows you to use Java components in a .NET environment.

Is it possible to use Visual Studio as an IDE for Google Web Toolkit?

As a long time user of Visual Studio, I feel comfortable using this as my primary IDE for editing code (I primarily code in C#/ASP.NET). Lately I've been looking more in depth into the Google Web Toolkit (or GWT) as a potential tool for building rapid web client tools for the web. I would therefore like to know whether it is possible to edit Java syntax, and otherwise set Visual Studio up to built web applications for GWT?
The option i m using is using Eclipse with an IntelliJ Idea key mapping ( i m a resharper fan and I miss it)
Another option is take the plunge and get IntelliJ Idea, its a fantastic IDE and it was really easy to get used to it, it has some nice pluggins for GWT development too
Cheers
What is Visual Studio's support for Java like, I assuming that its GWT support is not as good. ;)
I think you are better off using an IDE which actually supports GWT.
You could have a look at http://www.jetbrains.com/idea/features/gwt.html The demo is rather old (from 2006) but if you haven't seen IntelliJ it might be interesting.
Visual Studio used to be the best Java IDE in the 90's.
Since then much better alternatives came out.
The 3 most commonly used right now are:
Eclipse
NetBeans
IntelliJ.
Microsoft stopped supporting Java development a long time ago. At that time Java was still at 1.3. With Java 1.5 the language was extended with generics and other constructs that Visual Studio will certainly not support.
If you manage to use Visual Studio for Java (or maybe J# could work?), integrate Maven in it and then use the maven gwt plugin to translate the java to ajax, it shoooould be possible.
But this is just an idea, would probably take a lot of efford, if it works at all.

What language / platform would you use for a shareware / freeware desktop application?

I have a DVD cataloging application that I wrote a few years ago with MFC. Records are saved in a sqlite database, so basically it's a CRUD app. UI-wise, it has a tree view on the left, a list view (grid) on the top right, and an HTML view (embedded IE) on the bottom right. Nothing fancy.
I wanted to update the app with more features, but I've been using Java EE for the past couple of years and I realized that I wasn't productive at all with MFC. So I'm thinking maybe I should use something else to boost my productivity. Cross-platform would be a big bonus, but it's not absolutely required.
Here are the options based on my research:
Java / Swing: I can utilize my Java knowledge; great third party libraries (such as Spring for IoC and Hibernate for ORM); cross-platform. Downside is, JRE required for users; Swing seems to be in the "maintanence" mode and it's not getting much attention from Sun.
C++ / Qt: native application;
cross-platform. But I'm new to Qt so
I have to learn it first.
C# / WPF: WPF seems to be the future
of Windows GUI development and I'm
impressed by some WPF sample apps. I
have some experience with C# but I
need learn WPF. Downside is, Windows
only; .NET 3.5 runtime required.
So what would you use if you were in my situation? Thanks in advance for any suggestions.
If you want to learn some new skills while developing this application, then C# / WPF, and LINQ in C# 3.0 is really great if you didn't have it in Java.
If you just want to get on speed, then you already answer your own question, Java / Swing. It is what you are good at.
I'm actually a big C# fan, but since you said that cross-platform would be a huge bonus, I think that Qt might actually be better for that. C# can be cross-platform via Mono, but I've had better results with Qt in that respect. They also have real good documentation in QtAssistant to get you started.
Consider PyQt + Python as well if your productivity is a big issue. Trust me when I say the learning curve for Qt is well worth it, and not as hard as it may seem at first.
Sqlite support is in both the Python standard libraries and the QSql module in Qt if you prefer to use that.
PyQt + Python is a cross-platform option as well, since Python is available for many platforms and Qt's cross-platform to begin with.
The controls you mentioned you used in your application are all available in Qt.
The only other tool apart from raw C++ is Delphi. Period.
With other tools you will have problems in the deployment.
With Delphi you will produce native exes, self-contained. Also, the database connectivity is great.
You never will be dissapointed by lack of controls or 3d party tools, a lot with source code and with free/commercial toolset.
And the compiling times are the fastest in this galaxy ;)
So, if you are serious in provide no-hasle app for your customers, and that customers are not tech-oriented like developers so could be confused because which one of the 4 .NET runtimes install, want minimal support, easy downloads, click-click-install-go, apps that work instanly like Skype,TopStyle (made with Delphi) and others,then Delphi/C++ is are your only option. Seriously. The ONLY options.
If you want a cross-plataform solution, then FreePascal/Lazarus could work if your GUI is minimalist.
In most cases, as long as the scope of the project is reasonably small, and the computational needs are modest, I tend to favor using TCL/Tk. I have not yet learned a gui api in which I'm more productive than tk (not to say that there isn't one, just that I've tried several and found them slower). TCL is not the most wonderful language to program in, to be sure, although there are a number of add-ons that help a lot, specifically [incr tcl] and tcllib.
The reason I choose this instead of other systems, I prefer coding in python, for instance, is because deployment with tcl/tk is close to unbeatable. With Starkit, you end up with a single file double clickable application that requires no installer, and is trivially portable.
Well if you really want a class platform type of application, I would convert it into a web application and host it. That way if one user uploads dvd information or a dvd cover picture another user could take advantage of that information already input into the system.
If your going to develop for the desktop try to make feel like its an application made for that platform by utilizing the OS UI tools. And for windows, pick your 3rd option C# /WPF.
If you have some non UI code in your MFC app that you would like to reuse then consider QT. Otherwise pick whatever you prefer to learn.
Instead of C#/WPF you could give Silverlight a look. You app seems simple enough that it would not take a lot to get up and running. Similar to the demos that are shown off at conferences.
Once you get the basics down it will be fairly easy to add some cool features like animations, movie clips, album art, coverflow like interface etc.
You will be able to target Windows/Mac users and possibly Linux with Moonlight. But I haven't looked at Linux in the past 8 years so I really can't say much about it.
With Eclipse RCP, you get Java, cross-platform development (see Delta Pack), native look (via SWT) and a great framework collection for desktop development (declarative UI, plugin management etc.). You should definitely give that a try.
I went the C++/wxWidgets (but you could do Qt) route a few months back when presented with almost the exact same scenario (upgrade an app with a SQLite db). wxWidgets was fairly easy to pick up, had everything I needed, and was way easier than MFC. The best part was I found a good C++ wrapper for SQLite on CodeProject (e.g., CPPSQLite) and had the whole thing up an running in no time... The project sold me on wxWidgetss, in case you couldn't tell.
I would actually look very closely at something like adobe air. It is cross platform and can be html/javascript based so chances are you won't have a heck of a lot to learn except maybe a javascript library or two. It has the ability to talk to a local datastore or over the interweb to a webservice or RESTFUL service. Development is free with aptana. Check out some of the stuff written in it:
http://www.adobe.com/products/air/showcase/

Categories