Running java application from usb - javafx

I am trying to build a cross platform (vista, xp, mac, Linux).
I need to put the application in the USB drive formatted in FAT-32 and it should run on any OS computers.
Planning to use Java/JavaFx to do it.
Any advice how we can run on the multiple platforms.
Hi, Can anyone advice use of uber-jar for the above requirment. Would that be good fit.

A few things to take into consideration:
The USB must be formatted with a filesystem compatible with all the OS you need to work with.
A Java application would be able to run on any OS that is able to run Java, but each OS needs a different Java runtime. There's a Java runtime for Linux, one for Windows, one for OSX, etc.
My suggestion would be to define which OS you want to support and create launcher scripts for each one of them on the root of the USB. For instance you would have at least a couple like: myapp.cmd (for Windows), myapp.sh (for Linux), etc.
Additionally you may want to have different Java Runtimes in the same USB, so with the launcher scripts you execute your Java application running it with the corresponding JRE in the USB filesystem.
A twist in the launcher script would be to somehow check if the OS has already a JRE available (Like checking for a variable JAVA_HOME in the environment, or checking the output of "java -version") and act accordingly (although, running a Java application from your own JRE would be safer).

Related

The QPSQL driver can not loaded

if i try to run my qt application on windows 7, the console print:
QPSQL driver not loaded ... available driver:...QPSQL...
After that, i've tried to include the following paths to the windows path variable
C:\psql32\bin;C:\psql32\include;C:\psql32\lib;
The application can connect to the psql db and all works fine. How can i fix this problem, without to install the psql software on all pc's. ?
Best regards, chris.
Usually you don't need to use the drivers from Postgres. At least in the version I use (commercial, 4.8.4, Win)
Qt provides the drivers in the directory <QTDIR>\plugins\sqldrivers.
When the application runs on the computer, where Qt is installed, nothing should be done explicitly - Qt should find the drivers.
When the application is deployed on a computer without Qt-installation, I copy release versions of the files found in <QTDIR>\plugins to <MyAppExeDir>\plugins.
Besides Sql drivers, same problem could apply also to jpeg an other pluggable components.
P.S.:
Make sure, not to mix Qt-dlls from one computer with Qt-plugins from other computer, even if the versions are the same.

Wrong Architecture when running executable from Xcode4 on UNIX

First of all, I'm very new to programming.
I have a build a program using Xcode 4 on Snow Leopard.
Architecture of the project is set to "Standard (32/64-bit intel)"
Afterwards I have exported the executable file to a UNIX computer for running.
ssh to that computer
Typing ./programname in the terminal (Of the UNIX computer) gives the following response:
Exec format error. Wrong Architecture.
The program runs just fine on my Mac laptop.
When you compile a program it will (*) be compiled for a specific platform and a specific operating system. It will also most likely be compiled against a specific set of libraries. Usually those parameters are exactly those of the computer doing the compilation (the other cases are called cross-compilation).
In other words: compiling a program on a Mac will produce a binary that runs only on a Mac (unless, again, you're doing cross-compilation). Your UNIX system (which UNIX, by the way?) has a different operating system, different libraries and probably even a different CPU architetcture.
Somewhat related: Apples advertised (or used to advertise) Mac OS X as a UNIX. While Mac OS X is certainly a UNIX-class operating system, that doesn't mean that it's binary compatible with every other UNIX-class OS out there.
* almost always, with the exception of systems designed to avoid this (e.g. Java)
Programs compiled by XCode will only run under MacOS X. Unless the "UNIX computer" in step 2 is running MacOS, the program will not be able to run.

OpenCL development platform?

I am developing OpenCL code on a linux cluster through SSH -
are there any tools that would make this process easier, i.e.
something like NVIDIA Parallel Nsight for OpenCL ?
No there is no such tool, though you might try developing your code using ordinary computer and post production versions there..
If the computer where you perform development is also running Linux, you can easily mount a remote folder as local. In a Gnome environment, open Nautilus (the file manager), click File => Connect to server, chose SSH, fill the required parameters, and you have a remote folder as local.
You can then use any IDE you want to develop code, and maybe perform simple runs, tests and debugs if the OpenCL tools (compiler, debugger) you're using remotely are also installed locally. However, To compile and properly run the code on the cluster, you need to use the ssh client on the command line.

Moving a Java JAR file to a new machine

I have a Java program that connects to com ports when it's running. All I have is a .JAR file. I recently attempted to move this from a machine that the program runs on to another machine. I know the serial devices work on the new machine because I can interact with them thru a program called Putty. When I execute the .JAR file it comes up and seems to run just fine, but is unable to connect to the com port. Could this be a missing library that is installed in the JRE of the other machine? How would I figure out what is missing to make this program run?
Yes that could very well be the problem. Legacy ports (parallel and serial port) support in Java is provided by the Java Communications API, which relies on native code to support low level access to those ports. That API it's an extension to the JDK and not part of it.
Of course it could also be that on the new machine the user running your program doesn't have permissions to access the port, which is a different problem.
EDIT: For cross platform support for legacy ports, hell even if you only intend to use your program in one platform I recommend RXTX, an open source replacement for JavaComm.
Open the jar, look at META-INF/MANIFEST.MF file to see if it specifies any jar dependencies.
If not, it is possible that the JAR is using some native libraries to connect to COM ports.
Using the Serial port with Java normally involves addition of a compiled native (.so or .dll) file to the LD_LIBRARY_PATH.
I think you're using Linux, so look out for a file called librxtxSerial.so on the original machine (it'd be called rxtxSerial.dll on Windows)
The library path can be set in a few ways, but your best bet is to check for this file within the original Java installation:
e.g. /jre/lib/i386/librxtxSerial.so
Another thing to look out for is the rxtx jar itself (this may have been bundled inside your jar, or maybe not).
You may get better results by simply following instructions on the RXTX website, but I'd try understanding the original installation first.
http://rxtx.qbang.org/wiki/index.php/Installation
Good luck!

setup Qt and PyQt on mac osx so my app can also deployable on windows

I've been coding with Python and C++ and now need to work on building a gui for data visualization purposes. I work on Mac Snow Leopard (intel), python 3.1 using gcc 4.2.1 (from Xcode 3.1)
I wanted to first install Qt and then PyQt. And my goals are to be able to:
- quickly prototype GUI and the accompanied logic that drives the GUI using PyQt and python
- if I decided I need the speed, or if it's fairly easy to translate my GUI into C++ using the Qt tools, I have the options to translate my app into C++
- Be able to deploy my application onto Windows (both the python and c++ version of my app)
Give the goals above, what are the correct steps I should take and what issues i should be aware of when setting up Qt and PyQt. Which other deployment tools do I need?
From my readings so far, here's what I have:
download the Qt source for mac and configure it with
-platform macx-g++42 -arch x86_64 -no-framework
(i've read somewhere that
building as framework causes some
trouble in deployment and/or
debugging, can't find the article
anymore)
download latest SIP source and build
download latest PyQt and build from source (any special options I should pay attention to?)
For deployment, I've read that I would need to use py2exe/cx_freeze for windows, p2app for mac:
http://arstechnica.com/open-source/guides/2009/03/how-to-deploying-pyqt-applications-on-windows-and-mac-os-x.ars
but seems like what the article describe is deploying an app you build on windows on the windows platform and vice versa. How do you deploy to windows (is it even possible?) if you are writing your Qt app on a mac ?
Really appreciate the help
I'm guessing by deploying, you mean a compiled version to users that have no Python or Qt or anything.
I'm been trying py2app for a while now and never really worked out for me. You can try PyInstaller. It worked out pretty well for me since it's made to work with plugins like PyQt and PIL etc. I put up some instructions here
http://tech.xster.net/tips/deploy-pyqt-applications-on-mac-os-x-with-pyinstaller/
They don't really support cross-compilation though. Just recently, they made cross-compilation for windows binaries on linux possible. If you want to spend some time hacking it, it's probably possible. But probably easier just to get a windows machine and building a binary with it.

Resources