JAVA SE x86 or x64? - java

So this is probably a stupid question but I need to start working on a JAVA application and I should update my jdk I presume. So I go to the website and it has Windows x64 and x86 downloads.
My question is this. I have a 64-bit system, but my Program Files is x86. So does that mean I should use a x86 jdk or x64? I guess I am confused on why my program files folder has a different size than my system itself, or is my system x86?
I hope you can see my silly confusion on this matter.
Thank you,
-Austin

Download the x64 version since it's designed for the computer with your architecture. You have x86 Program Files folder only for application which can't run under 64bit environment. It's basically just backward compatibility.

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]

Can java JDK be portable?

My java programs are stored in my flash drive.
I just want to know if it is possible to store the JDK in the flash drive so that I can compile and run my programs at any computer (i.e., portable).
Thanks in advance.
The JDK itself is a compiled application. You can define JAVA_HOME to point to your JDK wherever you want, to force compilation. However, you can't take a 64 bit JDK and run it on a 32 bit Windows machine, and likewise you can't take the Windows version and run it on Mac or Linux, so no it's not portable.

JMF on 64bit java?

I know JMF is pretty much dead and whatnot, but I do know that it can still be used.
I intend to use it for personal uses and don't expect that much from it.
I have managed to install the 32bit JMF and when I run JMStudio it somehow magically works even though all of my java jres and sdks are 64-bit.
I personally believe that this proves that it CAN work.
When creating a program importing the jmf.jar as a library, my code compiles perfectly.
Only at runtime do i get any form of error with the common:
Exception in thread "VFW Request Thread"
java.lang.UnsatisfiedLinkError: JMFSecurityManager:
java.lang.UnsatisfiedLinkError: C:\Program Files
(x86)\JMF2.1.1e\lib\jmvfw.dll: Can't load IA 32-bit .dll on a AMD
64-bit platform
Obviously there is a problem with using a 32bit dll on a 64bit system.
My question is if its not compatible:
how does JMStudio work perfectly fine (it definitely uses java)
how can I fix it so that my program can run without depending on this dll
or other workarounds
Thanks a ton to anyone who has ever tried this before.
Java is definitely lacking in native specific tools such as webcams.
I think the main issue is the 64bit Java JRE/JDK trying to use the 32bit JMF, and/or JMF having a problem with the path that Windows 7 chooses as a default to install it to.
I have had success following the instructions posted here:
Oracle Forums: Install JMF on Windows 7 64bit
It basically boils down to:
Install a 32bit JRE/JDK, and ensure that this is what your code uses.
Install JMF to simple directory in the root of C: (i.e. c:\JMF2.1.1e)
Good luck!
JMFStudio is 32 bit supporting software so we must install 32bit support JDK and also Eclipse then we not get any exceptions as you mentioned in above and errors.
For my case it works fine.
and also
Try to remove unused jdk path in environment variable, if duplicate path present then also it not works fine
other wise you should re-install OS.

need on capturing image from webcam

I am working on a project where I have to capture images from webcam.I thought of using LTI-CIVIL api for this purpose. But it does not work on 64-bit os(I tried to run demo programs on windows 7(64-bit), it didn't work).
Please let me know how to make LTI-CIVIL api work with 64-bit os.Or If you know any other API(Open source or at least free) which will work with 64-bit os.Thanks in advance.
Not versed on LTI-CIVIL, but has native implementations (swt and capture dll) for Linux and Mac 64bit but only Windows 32 x86, so try to use a 32bit JRE in Windows x64 in order to link the 32bit dll of LTI-CIVIL. this kind of problems are related to the JRE, not the Windows architecture (32 vs 64).
I had the same problem, after i change from Jar 7 to Jar 6 the problem is gone

Java pre-installed in Windows and Linux?

I know that Java is pre-installed in Mac OS X but i wonder if it is pre-installed in Windows XP, Vista, 7 and all Linux distros?
Java isn't preinstalled in any Windows version (OEM not included - depends on the manufacturer then).
I think it is not common in Linux distributions at all, but I don't want to make a general statement about ALL distros here ;-)
Fedora Linux comes with IcedTea, an open source Java.
Some Linux versions I experienced comes with old versions of Java JDK (so you must take care developing for these distributions!) or with an alternative version of the compiler: Gnu Compiler Java (GCJ).
About the virtual machine, I've just seen the JVM in Windows and Linux, provided by Sun.
I understand that the vast majority of PCs come with the Sun JRE installed. There was a bit of a law suite between Microsoft and Sun (my employer, now a wholly owned subsidiary of Oracle).
The "6-open" OpenJDK is a backport of the GPLed JDK7. General purpose distros should include it, but of course with Linux you are fighting with package management.

Categories

Resources