Can i use Java swing application in a freshly installed Linux - java

Do the big Linux distributions support java when freshly installed?
If i have a Java Swing application, will it work in a freshly installed Linux with no internet connection?
I understand that there are no guarantees, but how likely is it for a Linux machine NOT to have any java/Swing support?

if you can check the o/p of command java -version in a terminal, it'll show if you have java installed or not.
So if Java or JRE is installed you can surely use your Swing application.
But if you are planning to develop a swing app you need to have JDK installed in your system.
you can if the command javac -version is working then you have JDK installed in your system.
But I suspect if any Linux distribution comes pre-installed with a JDK. For once you can find installed JRE by default but it is difficult to get pre-installed JDK in any Linux OS.

Related

Do all operating systems already have JRE installed for running java applications?

Let say I am not a java developer and an ordinary person, and installing any application that is written in Java. So, do I need to first install the JRE or no all operating systems already have JRE installed on them?
Do all operating systems already have JRE installed for running java applications?
No.
First of all, Java is not necessarily available for all operating systems. (It is probably available for most operating systems that are targeted by your application ... but it might not be.)
Secondly, most operating system platforms don't have Java installed by default. Indeed many OS vendors don't support Java at all: Java is provided by a 3rd-party vendor.
So, do I need to first install the JRE or no all operating systems already have JRE installed on them?
Prior to Java 9, the answer is that you have to install a JRE or a JDK. This can be done by downloading and installing it directly, or installing it via a package management system on some OSes. It can also be done by embedding a JRE in your application's installer.
From Java 9 onwards, you can also use "jlink" to create an executable that contains a cut-down JRE which is tailored to run your application on a specific target platform. This is the approach recommended by Oracle for people who want to distribute "consumer grade" Java applications.
And from Java 11 onwards, for some Java vendors (Oracle for example), the JRE option is no longer available. For these vendors, if you want "full" Java to run your application, you / your users need to install a JDK.
The Java Runtime Environment has nothing to do with the OS. You could install any OS with or without the JRE. If you installed the OS yourself, I'd guess it doesn't have it. If you bought the computer with the OS on it, it depends who you bought it from.
Checking if you have JRE installed is pretty much the same on all OS. Open a Terminal (on windows run CMD) and type java --version.
If you don't have it, you need to install it. Just google install JRE on [insert your os here]

How to make installer on Linux, Mac, and Windows?

I have developed a program using Java SE on Windows 7.
I build this app and it runs well on Windows.
I tried to run on Linux, so it runs but after some steps of:
Removing OpenJDK app.
Install Java JDK from terminal
Run jar file from terminal.
I need to make an installer on Windows - Linux - Mac, which installs JDK package and make the program run by double clicking.
Try using JarSplice. It is a nifty tool for converting Jar files into runnables for different systems. There are lots of tutorials on the internet on how to use it, although it is very well labelled and I found it simple enough to use.

What is appropriate Java Platform in Windows XP?

I created Software Project in java Netbeans 8 and running on JDK 8.My Operating System is 64 bit.And My client Machine running on Windows xp 32 bit operating system.Would it work in xp if i made exe ?
What is appropriate Java Platform in Windows XP?
None really. Read this: https://www.java.com/en/download/faq/winxp.xml which explains why Oracle no longer supports Java on Windows XP.
Now you can probably find older versions of Java that will run on Windows XP, but you won't be able to get (reliable) security patches any more, either for the OS or for Java.
Would it work in xp if i made exe ?
It probably wouldn't. For a start, many of the ways to turn Java code into an exe do it by embedding a JRE inside the exe!
Do yourself a favour and upgrade to a PC with a more up-to-date Windows operating system. Or install Linux on it ... for free.
You can still install the Java 8 version in windows XP. When you generate the exe file, try to generate with 32bits.
You can do it with Launch4j for example.

Developing Java desktop applications on Microsoft Surface Pro/Pro 2

I have a working Java SWING-based desktop application, and I'm being asked if it can be run on the Microsoft Surface Pro or Pro 2. As I understand it, these are using stock Windows 8/8.1 and will be able to run any Windows app normally, is this correct?
Are there any caveats or special considerations when running my app on these devices?
Edit: If it matters, the JRE would be distributed together with the application, so installing Java isnt an issue.
... will be able to run any Windows app normally, is this correct?
You will be able to run Java programs, but only in Desktop mode after installing the JRE. Java 7 Update 10 added official support. See Java on Windows 8 FAQ.
By default, Java is not installed on the Surface Pro. There is no java.exe or javac.exe when attempting to run from the command line. You have to go to Oracle and fetch it.
I was able to install the JRE on my Surface Pro. The package was installed in C:\Program Files (x86)\Java\jre7\bin. After the install, java.exe -version worked from the command line (after fixing PATH). The install also included an IE plugin, and it appears to have worked with IE 10 from the tablet. I was also able to install the x64 JRE. I did not try to install the JDK.
There may be something offered on the Windows App Store, too. But I don't use the store, so I don't know.

How to check if Java 7 version is installed via Cocoa?

I have an Cocoa Xcode application that I am writing and I need to check what Java versions are installed on the user's machine. I know I can check /System/Library/Frameworks/JavaVM.framework/Versions/ and see what folders exist; however, this does not work for Java 7.
When I installed Java 7 on my Mac OS X 10.7.5, it was installed to /Library/Internet Plugins/JavaAppletPlugin.plugin. But this doesn't let me know the version of Java that is installed. If a newer version of Java is installed, I'm assuming it will install to the same place.
If I need to test if Java 7+ JRE is installed on the user's machine, should I just check if the file /Library/Internet Plugins/JavaAppletPlugin.plugin exists? Is there a better way to check?
Although you may have installed Java 7, you should have installed the Apple's Java Mac OS X 2012-006 update before. Having done that (and then installed java 7 again), java -version should tell you java version "1.7.x..."
Determining the Default Version of the JDK

Categories

Resources