A Java6 application sits in the system tray. It needs to be activated using a hotkey (e.g. Super-G or Ctrl-Shift-L etc) and do something (e.g. showing an input box).
How do I do that on:
Windows (XP or Vista)
OS/X
Linux (Gnome or KDE)
I've compiled a library for global hotkeys in java using JNA. It currently supports Windows, Linux and Mac OSX. It also supports media keys on windows and linux.
if anyone is interested, try https://github.com/tulskiy/jkeymaster
I would appreciate any feedback.
Thank you.
For Linux (X11) there is JXGrabKey: http://sourceforge.net/projects/jxgrabkey/
There is also a tutorial for grabbing a global hotkey on Linux: http://ubuntuforums.org/showthread.php?t=864566
I didn't though find a solution for OS X yet.
To build something for all 3 platforms I'd suggest stripping down JIntellitype (it's Apache license) to it's global hotkey functionality and extending it with the OS X and X11 functionality...
It seems that this is not doable in a cross-platform fashion without using the native interfaces.
On Windows, you can use the free JIntellitype library.
If anyone wants to do the OSX or Linux versions of the JNI part of Jintellitype I would be more than happy to add those to the JIntellitype library.
Melloware
http://www.melloware.com
I found this solution to work just great on windows. It does not require you to install any software like JIntelliType. Note that this is 32 bit dll and you can recompile for 64-bit JVM is do desire. All credits to original author of the blog.
I've written a Java library for global key/mouse events here. This works for Windows, Linux X11, and OSX.
https://github.com/repeats/SimpleNativeHooks
Related
How is it possible to use JIntellitype in Java? If that's not possible, how would I use Hotkey on a system tray menu, which would act even if application is not in focus.
However, I have not been able to get JIntellitype to work on MAC OSX.
How can I make this work on a mac?
I know this question is a bit old, but it has no answer. JIntellitype uses that Java Native Interface (JNI) to leverage C/C++ that talks to the operating system's API directly thus bypassing the sandbox limitations of the JVM. As you have already noticed, the native C/C++ code is platform dependent and will only run on Windows in this case. There are similar projects for Linux (JxGrabKey) and Mac OSX (OSSupport), however, the API for each platform differs. If you need better cross platform support, you can try using JNativeHook.
Can anybody give me suggestions about preparing a custom Mac Installer for a Java swing application. I have tried Xcode but of no use. Any suggestions would be really helpful.
Thanks in advance...
Take a look at http://izpack.org.
IzPack-generated installers only require a Java virtual machine to run. It is fully cross-platform and generates a single installer. As such, it is an alternative to native solutions like as platform-specific installers and package managers.
Or for a more Mac-specific option, see this 10-step tutorial:
http://www.centerkey.com/mac/java (Updated for Mac OS X 10.6 — Snow Leopard)
Do you actually need an installer? Unless you need to put files in very specific locations and need admin privileges for that, installers are uncommon on the Mac. Typically, you'd use a disk image with a self-contained application bundle. See my answer to this question. That answer also mentions how to create a standard OS X installer.
I am Java developer who is using Eclipse on a X86 computer to code. I am considering to buy for other reasons an Desktop Mac computer and I would like to use this computer to do my coding work. I know there is a Eclipse version for Macs, I am asking if there may be some problems/issues related to Macintosh computers. Thanks!
It really depends what you'll be doing.
In terms of the IDE, it will work just fine and you can copy your files/projects over and they will "just work".
However, there are some things you need to be weary of:
Key mappings might be different
You won't be able to do any JavaME programming as there is no Mac toolkit for that.
If you're doing Swing development, make sure you test your code on your target environment as things might look different.
Other than that, Macs work fantastic for Java coding.
No, Eclipse works just as well on a Mac as on a Windows or Linux computer. Key bindings are different though; if you're used to the shortcut keys of Eclipse on Windows, you'll need to get used to different shortcuts on the Mac.
Apple just announced that they are deprecating their Java platform. That may cause some problems in the future. Update: however, I have seen that Eclipse works with the soylatte OpenJDK port.
http://developer.apple.com/tools/eclipse.html
and if you want the non-Apple-bs experience:
http://cdtdoug.blogspot.com/2010/04/mac-gets-no-love.html
From my personal experience, Eclipse actually works better on OS X and Linux than it does on Windows. I'm a professional plugins developer and I do all my coding on Mac. I blog about Eclipse and Mac related topics, so I invite to read it.
Adding to the limitations mentioned in other answers, if you have specific plugins that you need, not all support Macs, although most. For example, The Eclipse TPTP (short for profiler) project doesn’t profile on Mac. There are alternatives in most cases, though (AFAIK, not free in the case of TPTP).
Personal experience for RCP-development: 2G of RAM are not enough (at least not for our project), so the current MacBook Airs are not suitable at all for development. But then, you're talking about desktop Macs anyway, so if you can get the >2G, it should be fine.
During the 64bit transition phase, there were some glitches with missing 64bit Cocoa, but that has been resolved. Some of the extensions may be platform specific: currently, TPTP (Test and Performance Tools Platform Project) still has some limitation.
eclipse for mac works exactly as you know it from your pc. the only thing that differs is the arrangement of some keys (the # is on L, the arrangement of the braces differs a bit)
Eclipse works fine, but with different keybindings.
I have found that sharing files with other computers - e.g. through a source repository - may give you character set conversion issues. If you stay with pure ASCII in your source you should not have any problems.
You can download Eclipse 3.6.1 from eclipse.org directly (where your platform is autodetected) or from http://download.eclipse.org/eclipse/downloads/drops/R-3.6.1-201009090800/index.php#EclipseSDK
I would suggest getting the Java EE version from the frontpage. It contains web stuff I use regularily.
I bought a new Mac book (MacBook Pro), and I am previously using Windows. I use this MacBook for personal (e.g. instant messaging, document, browsing the web) and development (writing C++ and Java code) purpose. Any recommended discussion group or forums (or I can directly ask here in StackOverflow)? I am a newbie.
Yes, you may be interested in my Development Environment Setup guides. I currently develop on Mac OS X 10.6 Snow Leopard. My recommendation is to install Xcode and MacPorts. I tend to edit everything using Xcode, and I use MacPorts to install pretty much all the various libraries (except Qt, for which it is more sensible to downlod the precompiled Cocoa 32-bit and 64-bit binaries). In terms of developing such that things also work on Linux, as long as you conform to the Single UNIX Specification (i.e. use the authoritative manual pages at the link instead of Mac OS X's man pages) and, other than that, you rely only on cross-platform libraries, then you should be fine. That said, it is reasonable to install a copy of VirtualBox and setup an image of Ubuntu in it for verifying that your code compiles and runs under Linux.
Start with Xcode and Developer Tools, and then look at NetBeans and/or Eclipse.
Others have already commented about XCode and you commented "How about Java programs?" so for Java on OS X, basically every single Mac ships with Java since a very long time.
You MBP probably has Java 1.6.
Two very popular Java IDE on Macs are Eclipse and IntelliJ (I guess NetBeans works on Mac too but nobody here is using it and it's been a long time I haven't checked NetBeans, I'm a long time IntelliJ IDEA user).
In addition to that, OS X being a Unx OS you get very powerful shells and you may want to learn how to use a Unx shell (like, say, Bash).
Welcome and good luck!
I am a Mac user who wants to run a few .exe files from my Java process using Process and Runtime classes.
I know that it is not possible to execute .exe files in general in Mac OS X.
Is there a Mac application which can wrap these .exe files so that they can be executed ?
Does Apple provide anything by itself ?
The alternative I am using now is to run the Java process in Windows. Yet, it is cumbersome in general.
Darwine
Edit: I should probably point out that this is not a 100% solution. Virtualized Windows will nearly always work better, through Parallels or some similar virtualization software. But Darwine is free and runs most Windows software acceptably.
Besides wine you can get VirtualBox(free), Parallels($$$) or VMWare($$$).
Well, if it's a .NET application then you can possibly run it with Mono, but I'm betting it's a native binary and you'll have to use something like the aforementioned Wine. I thought it was really cool the first time I ran a .exe using Mono on OSX, it just felt wrong, so I had to share.
I don't know if it exists, but you would need something like wine for OSX. The reason why is that the .exe would nearly certainly use OS specific system calls and library functions.
EDIT: looks like it does exist
java -jar file.exe and monofile.exe both works natively on MACOS with native MACOS java and mono
1)Install Wine and Winebottler from http://winebottler.kronenberg.org/
2)You may have to change the System Preferences >Security & Privacy>Allow Apps downloaded from>Anywhere
2)Click the xyz.exe and select winebottler for running application