What are my language choices for making a MacOS daemon? [closed] - java

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am a Windows developer (with some iOS Objective-C experience) and I am trying very carefully to choose the correct language to make a fairly simple daemon for the MacOS.
The app will download and upload files, communicating with our .NET web services that are already in place.
The installation will be done by non-technical everyday users, so asking them to do a lot of configuration/scripting on their end is not an option. A sleak package is a requirement.
I see my choices as:
Objective-C
Java
Mono
Scripting
Objective-C has the advantage that it is native, but I'm not the strongest with this language yet.
Java is very easy, but do all users have it? Is it going to be a problem asking people to install it?
Mono will let me leverage my .NET skills, but will it install elegantly as a daemon?
Scripting may be an option as it is very simple what the app has to do, but is this the norm, to deliver a product like this?
--
EDIT
There will be no GUI. I'm okay with not hiding the code, although a UID/PWD will be necessary in order to access the webservices (different for each client). It will always be running, for all clients.

Objective-C/Cocoa or C (esp. using Core Foundation) would certainly give you the most native implementation with performance and OS integration benefits.
Java is reasonable and will be built-in. You'll need some basic scripts to bootstrap it, but not much.
Mono is also reasonable and can be relatively easily installed by the user. You'll need to point them at the download page and specify that they only need the runtime, but it's do-able. Depending on licensing, you may be able to include the Mono runtime installer package within your own installer package so it's installed at the same time as your daemon.
Naturally, scripting languages will most likely leave your code exposed and modifiable, so you may want to avoid that route if that's of concern.
Regardless of the language used to develop the daemon, you'll want to consider installation & management.
For installation, Mac users are used to two installation methods: installing via an Installer .pkg file that the user double-clicks and then is brought through the installation process or by dragging an application into their Applications folder and double-clicking to launch. As a developer, the former gives you a lot of control over including README/license text, running pre- & post-flight scripts, building meta packages to install one or more packages (as mentioned above re:possibly including Mono runtimes right in your own installer), and also gives the OS & user the ability to see what files will be installed, where, and when (post-installation) if they so wish. Alternatively, many daemons will be actual Mac OS X applications which will then install themselves as background processes upon the first launch. The former would be independent of your language selection, but the latter would lean towards a Objective-C/Cocoa implementation.
This brings me to management. Most daemons will want to be run through launched as either a LaunchDaemon (for all users, typically launched at boot) or a LaunchAgent (for particular users, typically launched at login). If you integrate well with launched everyone will be happier and should be do-able in any of your language options.
The question then becomes will the user need to manage the daemon at all? If so, this is most frequently implemented as either a MenuExtra or a Preference Pane. In either case, the daemon could be developed in any language and controlled (esp. via launched) by the MenuExtra/Preference Pane, but in some cases the MenuExtra could actually function as the daemon and so you'd want to develop in Objective-C/Cocoa.
See also: Apple's Designing Daemons & Services documentation.

Objective-C is the best bet, native, fastest and suitable for a daemon, otherwise you can develop it in Java 6 that is already installed in Mac OS X even though could be not so simple to install it as daemon.
My advice is to go with objective-C or plain C ...
However if you are accustomed to working with .NET you can install mono and use mono-service to run the service as a daemon even on OS X, but in this case users will must install mono on their machine, so if you can deal with this trade off could be a viable solutions .

Related

What's the difference between Java (programming language) and Java (Control Panel)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Probably a stupid question but I would like to know. Not even sure what the technical name is (so feel free to edit question if it's unclear) but by "Java Control Panel" I'm referring to the component you find in Windows control panel:
I went to the java homepage but I'm still not sure... is the Java component you see in Control Panel simply a collection of Java programs built-in to all computers? If so, what exactly does it do? Is it only relevant to the Internet or is it necessary to run other applications or the operating system itself?
They are both parts of the same ecosystem.
The 'Java' you see in the Windows Control Panel is a Setting Option for the Java Virtual Machine, which is installed on your PC. A virtual machine understands its own bytecode and translates it for your CPU.
The 'Java' programming language is a computer programming language which allows you to write programs on top of this virtual machine. Java programs are compiled into Java bytecode and then executed by the JVM.
Java programming language is how you instruct java to do what with allowable set of statements which gets compiled using Java compiler and which gets executed by Java runtime environment (jvm)
when you install Java, it hooks into operating system settings (for windows family of operating system it is in control panel) it holds settings
which internally launches an executable jcontrol which comes with java installation
it holds Java runtime's configuration
The Java Control Panel is a multipurpose control panel. It allows you to view and set a wide range of parameters controlling how, or if, Java technology runs on your computer. It lets you view and delete temporary files used by the Java Plug-in, which allows Java technology to be used by your Web browser to run applets; and Java Web Start, which allows you to run Java applications over the network. It allows you to control certificates, making it safe to run applets and applications over the network. It enables you to view an active deployment rule set, and to manage the exception site list. It allows you to set runtime parameters for applets that run with Java Plug-in and applications that run with Java Web Start. It provides a mechanism for updating your version of the Java platform so that you always have the latest Java Runtime Environment (JRE). And it allows you to set options for debugging, applet handling, etc. The Java Control Panel includes the following separately viewable panels:
The Java programming language is a language for programming computers, but it's also a standardized programming environment. This is a little like English is a language for exchanging textual information between people, but you also need to know the environment to be used to do this, which might be paper and typewriters, paper and pens, verbal with sounds, or electronically with computers.
The Java control panel is a tool that goes along with the Java programming language when it is installed on your computer. The control panel lets technically savvy users control things like WHICH environment they want Java programs to use when they're telling the computer to do things, in case your computer happens to have more than one. The control panel also lets you change various preferences like how and when the Java software should check for updates to itself and the like.

Is java right for this application? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I need a way to:
Create a GUI based front end to a database (MS SQL Server or MySQL).
I want it to be capable of running on Windows,Mac & Linux.
I want to be able to run the GUI as a desktop application or through a web browser.
(some people aren't allowed to install applications on their desktops and some people don't have access to web browsers.)
I need support for rich dynamic content, graphs, tables, possibly videos.
A nice IDE to generate the GUI where I can visually create and then code.
I don't want to deal with different web browsers interpreting the layout differently.
I have programming experience but plan on hiring a professional to get this project started. It is currently for a small business but has the potential to reach enterprise level with hundreds of users. This is a long term project. Some people say Java is a slow horrible language. Some people say it is great and many enterprises and financial institutions run java.
I have done quite a bit of research on oracle's website but am still lost.
Java? Java FX? Swing? JavaEE? Tomcat? Java webstart?
Where do I even begin. I don't even know what book to buy. If anyone can point me in the right direction I would greatly appreciate it. Maybe Java isn't even right for this?
Java is great for just about every project. But lets address your points.
1: Java can build a GUI and it can connect to Databases there are many APIs to make this easier, like JDBC.
2: Java is build for just that. Due to Java Runtime Environment which virtualises the execution it is easy to build Java based Applications for multiple Operating Systems.
3: This one could be a bit tricky since you would build an Applet for the browser and not an Application. But hey Java is just about the only Language that allows you to build an Application and an Applet for browsers in one step. Which is also the reason for it's big success. But beware companies may block Java in browsers for security reasons.
4: Java is capable of producing every graphic you can image a great example is Processing.
5: Well NetBeans and Eclipse both have great plugins for that. I personally love the Window Builder for Eclipse.
6: An Applet will give you that because it defines it's layout. Browsers are just running the Applet and are not doing any interpretations.
As for Java being slow: Naturally since Java Applications are run in a virtual environment they are slower then Applications developed in say C++. But this allows for Java Applications to be easily released for Windows, MacOS and Linux at the same time. Also Java uses some great technics like "Adaptive optimization" to increase it's speed and today Java isn't really all that much slower than other Languages (but still slower).
You can refer to the Java-Article on Wikipedia for some more info on Java.Link
I want to be able to run the GUI as a desktop application or through a
web browser. (some people aren't allowed to install applications on
their desktops and some people don't have access to web browsers.)
In this case Swing might not be the best solution since running a moderately Swing app in a browser as an Applet is a pain.
Java WebStart is a nice solution, but the application doesn't really runs in the browser: it just starts from the browser. If this is OK, than JFormDesigner http://www.jformdesigner.com/‎ is the best tool you can get.
If the application must run in the browser and without Java than you can achieve something similar with a RIA web application and package it in a similar way PhoneGap does mobile devices, e.g. with http://qt-project.org/doc/qt-4.8/examples-webkit.html and bundle the server together in background.
For the UI with this RIA framework http://www.sencha.com/products/extjs/ there's also a very advanced GUI designer: http://www.sencha.com/products/architect/ if that's an important part, but of course in this space there are many alternatives.

Alternatives to Java Web Start? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
We're having huge issues with Java Web Start in production. We're afraid to release because every time we do, help desk gets calls from 1/3 users getting an "unable to launch" error. It's hard to tell whether it's because of user error, cancellation in the middle of download, poor network connection or anything. But the bottom line is:
We find it terribly unreliable.
What are the alternatives for deploying and updating a rich Swing application? Either free or commercial, I'm more interested in features and robustness.
Reliability is key, but I would also like to have the following:
Install once, update automatically from a simple HTTP hosting like JWS
Differential updates
Support for multiple configurations (think of 30 instances which may have different versions of the application or different launch parameters - would be nice not to build 30 artifacts each time)
Win / Mac / Linux support. Hopefully one that does not mean I have to maintain 3 builds for each instance.
I feel your pain, the biggest issue I've had with JWS is visibility, that is, what is it doing and why is it doing it. Most of our issues were related to internal proxies (Java seems to really not like authenticating proxies) and the wrinkles seem to be ironed out for the moment. Nevertheless, I did consider simply writing a replacement. This is not as crazy as it sounds, JWS does an awful lot of stuff that I don't really care about, namely, integrating with the web browser and checking JVM versions. Consider the following scenario:
You launch a Java application (the launch app). This application takes a single parameter which is a URL of a JNLP file.
The launch app hashes the URL and uses this as the basis for a local folder (repository) in which to store any downloaded jars for the app. If the repository doesn't exist, it will create it.
The launch app attempts to download the JNLP pointed to by the URL. If it can't download it, it will just launch whatever is in the repository (maybe warning the user)
If it can download the JNLP, parse it and list any jars that need downloading. If you already have the jars, use something like Apache HttpClient in order to determine whether the server has a newer version and download if required. The important point is that any downloads should be stored in a temporary folder. Once ALL of the downloads have succeeded, you can apply these to the local repository. Ideally, you will back up what is already there in order to allow some sort of rollback procedure.
This should provide some very significant advantages over regular JNLP:
Visibility, you can log exactly what is happening
Much better failure modes: if the download gets interrupted just launch the version that's already there (obviously, this won't work if the interrption occurs on the first download), if you feel like telling the user about it then do so.
By running as a local app you should avoid running into issues with signing of jars, I honestly don't understand the Java Web Start security model with respect to signed jars but it seems that if different classloaders are involved, JWS will complain about it (I think)
Sadly, I'm not in a position to fire you over a working version of the above, I did start a prototype but suspended it. I may have to return to it in future in which case, I'll be happy to share the finished version.
Cheers,
Phil
Currently we are using GetDown to handle distribution of our swing applications. We use Tomcat to distribute updates and GetDown to download those updates. It's really flexible and powerful, and much better than java WebStart and because it produces check sum for changes it saves bandwith and downloads just changed files.
A good tutorial : http://www.hascode.com/2012/05/creating-updatable-java-applications-using-getdown-and-the-getdown-maven-plugin/
You could use an installer: for example Install4j.
You can find a list of installers here: What are good InstallAnywhere replacements for installing a Java EE application?
With Java Web Start being deprecated by Oracle, we are considering using Microsoft's .NET Click Once to download and launch our Java application.
We will have a Click Once .application file run a little MS program that detects Java, downloads our latest jar files and then launches our Java program using the detected version of Java and the Jar files.
Of course, this is only a solution for Windows machines, but we are customers are exclusively on Windows, so this works in that environment.
MS's Click Once: https://learn.microsoft.com/en-us/visualstudio/deployment/clickonce-security-and-deployment
You could also give Zero Install a try. It's cross platform (Linux, Win, Mac), offers jrd download and auto update and has a nice system integration.
Drawback in my eyes that its not easy to handle..
http://0install.net/

Is there a legitimate, automated, method for deploying Java applications on iOS4?

I'm wondering if there is a standard method for deploying applications originally written in Java, to iOS4 devices.
I assume that the application in original format cannot be deployed - is there perhaps an emulation layer that I can use, or a stable compiler that compiles Java to ObjectiveC?
Option 1:
Use one of several cross compilers, compiling Java to ObjectiveC:
http://www.xmlvm.org/overview/
http://www.flexycore.com/ispectrum-overview.html
Option 2:
Package custom JVM with java application, with restrictions that meet the latest agreement (including no byte-code download capability and no JIT compilation). No JVM specifically designed for the iPhone is currently (Oct 2010) available, though the IKVM might run on top of Monotouch, and Oracle may build a version of the Java SE for the iPhone eventually.
Option 3:
Cross compile Java to one of the existing interpreters that are already accepted on the iPhone (eg, cross compile Java to C# and run the app on monotouch)
With the new current iOS SDK agreement and App store rules, it may be possible for you to embed a Java applet with your own JVM interpreter and runtime engine (but no byte-code download capability and no JIT compilation allowed).
Another seldom mentioned possibility for deploying any non media or graphic intensive networked app, such as many typical Java applets, is to run a customized RDP or VNC viewer on the iPhone and and view a Java app that is being hosted and run remotely.
Mechanically translating some of your code will likely work pending finding a cross compiler / translator. Trying to run a Java based GUI on iPhone is just plain stupid in my opinion. So the smart thing would be to port the GUI by hand.
The problem of course is if the app is mostly GUI you might as well write the whole thing over. Likewise if the app uses APIs that there is not a simple translation for you again might as well rewrite the entire app.
In a nut shell I think Steve J. Was right here, the route you are comtemplating just leads to poor user experiences. It actually makes me wonder why you would even think that a Java based app would be successful on iPhone.

Simple cross platform GUI app

I would like to know if there is any way that I could build a very simple GUI app (it doesn't even have to look good) that will run on a fresh install of Windows Vista and OS X with no other installations needed by the user. I would perfer not to use Java (just out of personal programming preference). I will use it though, if it is the only way. Specically, I am wondering if I can write a swing app with Scala or Groovy and run in on windows without them having to install anything. Sorry if this is a silly question, I am a Obj-C developer by trade.
You can pack the Scala jars into your own, which should work as long as Java is installed (which it usually is on a 3rd party vendor install of Vista or OS X). If you use Java web start, no installations are needed beyond Java itself. Plus, if you're going to install your own code, why not just copy along the Scala jars also?
If you really mean a fresh install--nothing but what the OS provides--then no, I don't think so.
Edit: You do always have javascript on the browser(s). I assume this won't cut it for what you want?
If you really, really don't want to install anything (or carry anything in your app), then write the application as a web app (possibly a javascript app). Then any user can run that UI from any machine with a decent browser. But then, this will require that you host the app somewhere.
If that is not an option, you can develop your app to as a single html/xhtml file containing a self-contained, self-modifiable javascript application (like TiddlyWiki which I use a lot). Then the user user can download on it on his machine, point his browser to it and voila.
If you combine javascript with HTML5 (and assuming the user has a HTML5 compliant browser like safari), your application can use localStorage to keep its state in the user's machine (thus no longer needing to be self-modifiable to save state as TiddlyWiki does.)
But this would break your rule of not downloading anything on the user's host machine. It is a chicken-and-egg problem that has no solution since each OS implements its own set of application libraries. For multi-platform support, you must use a layer that abstracts out differences between operating systems, be it a vm (like JVM, Ruby or Mono) or a set of libraries (Qt, Gnome).
As far as i know you won't be able to accomplish that with no other installations needed by the user. If you violate this restriction, mono (with gtk#) is a good choice.
Scala and Groovy will have the same deployment issues as Java; all of these require a JVM to be installed. You generally have to first install the JVM (which is not included with Windows) and then install your program. Java is included in OS X, however.
It is possible to use Ruby or Python and one of the cross platform libraries (like wxWidgets) and compile these to an executable file that includes the entire set of runtime libraries (e.g. all of ruby and python).
REAL Studio (formally REALbasic) certainly meets this requirement. It creates native applications that have no external dependencies for OS X and Windows (plus Linux).
In theory you could write a .net application using Mono that it should run without issues on any other one with the .net runtime environment installed.
But I'm not sure if it will work on practice.
I've had some success with XulRunner
There's also a couple of recommendations from these questions I asked
Building Cross Platform app - recommendation
Building XUL app a-la SongBird
XULRunner is pretty cool once you get into it, but it's a tad confusing at first (I thought).. the folks on the mozilla google groups are really nice and helpful though!

Categories