OpenJDK builds and javaws bin file - java

I understand that Java Web Start is deprecated and not present in Java SE 11 and later.
I bumped into the Red Hat distribution of OpenJDK which says "OpenJDK 11 Windows installer includes an additional component - Web Start deployment protocol implementation based on IcedTea-Web open-source project." Red Hat's OpenJDK Overview. I thought "well they added it".
I downloaded it but in /bin there isn't any trace of javaws.
I also downloaded the OpenJDK 8 from Red Hat, and again, no trace of javaws in /bin. I downloaded the Reference Implementation builds of Java SE 8 from Oracle from https://jdk.java.net/java-se-ri/8 and again, no trace of javaws.
What am I missing?
P.S. despite a programmer, I know nothing of Java

Please turn to icedtea-web project. It is independent project, and in one way or another, it is what all distros are packing as javaws - http://icedtea.classpath.org/wiki/IcedTea-Web

In Red Hat Java 8 there are TWO downloads available for WINDOWS:
zip
msi
The MSI version does NOT contain the \webstart folder.
The zip version DOES contain the \webatart folder.
\redhat\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windows.x86_64\webstart\javaws.exe
Separately, unlike Oracle Java, openJDK does NOT have a Java console that shows output from the app when running.
But that output is written to a txt file. FOUND IT here:
https://access.redhat.com/documentation/en-us/openjdk/8/pdf/troubleshooting_openjdk_8_for_windows/OpenJDK-8-Troubleshooting_OpenJDK_8_for_Windows-en-US.pdf
C:\Users\XXXXX\AppData\Local\RedHat\java-1.8.0-openjdk-1.8.0.232-3.b09.redhat.windows.x86_64\webstart\javaws_last_log.txt

Related

I'm trying to run LWJGL 3 in Eclipse and it keeps showing this error message

When I try to use LWJGL 3, the console shows this
I tried to find fixes for this earlier, I reinstalled Eclipse twice and removed and added back the LWJGL 3 files into its user library and nothing seems to make it work.
I downloaded the Zip Bundle from the LWJGL website, Zip Bundle with preset "Getting Started" for windows x86. I downloaded the latest stable build of Release, 3.2.3 build 13
I followed the 1.2 Installation guide here:
https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install#eclipse
but still, I got the error message as linked on the first line.
I ran the sample code for HelloWorld from the LWJGL website.
here: https://www.lwjgl.org/guide
Edit: making it clearer
Here is the command line from Run Configurations:
>C:\Users\Me\.p2\pool\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.2.v20210201-0955\jre\bin\javaw.exe -Dfile.encoding=Cp1252 -classpath "C:\Users\Me\Documents\LWJGL\lwjgl.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-assimp-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-bgfx-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-glfw-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nanovg-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-nuklear-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-openal-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-opengl-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-par-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb-natives-windows-x86.jar;C:\Users\Me\Documents\LWJGL\lwjgl-stb-sources.jar;C:\Users\Me\Documents\LWJGL\lwjgl-vulkan.jar;C:\Users\Me\Documents\LWJGL\lwjgl-vulkan-javadoc.jar;C:\Users\Me\Documents\LWJGL\lwjgl-vulkan-sources.jar;C:\Users\Me\eclipse-workspace\helloworld\bin"
-XX:+ShowCodeDetailsInExceptionMessages helloworld.helloworld
Judging from the list of the jar names in the classpath, you have selected/downloaded the wrong architecture (x86) of the natives, as opposed to x64 (amd64, x86_64).
You are running a 64-bit JVM (a 64-bit process) and with that, LWJGL tries to load its 64-bit native files, which it cannot find on the classpath, because only the differently-named 32-bit native are on the classpath.
The jars with the natives for 32-bit have -x86 in their names. The natives which you need (64-bit ones) do not have that suffix.
So, to fix this, load the zip file from https://www.lwjgl.org/customize and specify "Windows x64" under section "Natives".

java 1.8 jar runs in Windows not Ubuntu, "could not find or load main class ..."

I have a jar file that runs fine from the Windows 10 command line, but is not working on my desktop Ubuntu 18.04 command line. The file was exported from Eclipse as a jar, and copied to Ubuntu. The project has about 30 classes over a half dozen packages. I've done some renaming in order to simplify things for this question.
This is the command used to run the jar:
java -jar myproject.jar
On Ubuntu, I get the error "Could not find or load main class com.a.b.LaunchThis"
Following are some of the things I've tried, based on suggestions from many similar posts. Sorry if this is a duplicate, but I couldn't find a workable answer.
I verified that the current Java is 1.8 using the commands:
$ update-alternatives --config java
and
$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
(I also verified that the program runs using java 8 on Windows.)
I ran the following check, which displays all the files, and confirmed that com/a/b/LaunchThis.class exists and is spelled exactly the same way.
java tj myproject.jar
The manifest seems correct.
Manifest-Version: 1.0
Main-Class: com.a.b.LaunchThis
I also tried unpacking the jar and running the program directly from the folder /myproject which contains both /com and META-INF. That should work, shouldn't it?
java com.a.b.LaunchThis
java com/a/b/LaunchThis
java com.a.b/LaunchThis
And from one level outside the myproject folder:
java myproject/com/a/b/LaunchThis
java myproject.com.a.b/LaunchThis
java myproject.com.a.b.LaunchThis
java myproject/com.a.b.LaunchThis
I am not totally clear on when the syntax requires . or /. The package command in "LaunchThis" which holds the main entry point is the following:
package com.a.b;
And in each of the above iterations I also tried including "-cp myproject.jar" as an option.
Always the exact same error message.
To be careful about not having a typo in the above, I first ran the ls command to make sure the file could be found (then edited this line to create the variants).
ls myproject.com.a.b.LaunchThis.class
Any suggestions as to what else to try?
For grins, running with Java11 gets this response:
Error: Could not find or load main class com.a.b.LaunchThis
Caused by: java.lang.NoClassDefFoundError: javafx/event/EventHandler
This makes some sense, because Java11 does not include JavaFX. But Java 8 does include EventHandler. It's been a part of Java since JavaFX 2.
UPDATE: I made two "Hello world" jars, one with and one without JavaFX on an Ubuntu installation of Eclipse running OpenJDK 8. To get the version with JavaFX to run, I downloaded the Oracle JDK 1.8, and linked to /lib/etc/jfxrt.jar as an "external jar" library. Both programs run in Eclipse but only the non-FX jar works. The FX jar gives exactly the same error message.
I think this pretty much establishes my problem to be one of not having JavaFX as part of OpenJDK 8.
My plan is to now try out two solutions: (1) copying the Oracle jfxrt.jar into the OpenJDK lib, (2) backloading OpenJFX 8.
Simply installing OpenJFX from repository loads OpenJFX 11, which is a little dated but will work with the OpenJDK 11.
The issue here is that the repository OpenJDK 8 on Ubuntu 18.04 does not include JavaFX. I'm guessing that the error message results from the fact that a JavaFX main() is located on a class that extends the JavaFX class Application.
How to fix this?
There are a number of things I tested.
First, one could use Oracle's JDK 1.8 instead. I ruled this out due to licensing issues.
Some sites suggested copying the jfxrt.jar from either the Oracle JDK 1.8 or from a working Java program that uses JavaFX and uses a self-contained JRE. I found that if I linked to the Oracle jfxrt.jar (located in the /jre/lib/ext folder) as an external jar, I could run a simple, "Hello world" javafx program in Eclipse. But I could not run the program after it was exported to a jar.
One answer on a related stackoverflow thread suggested copying over several additional files along with jfxrt.jar, which I tried. This did not work, so I'm not going to pass that on.
The solution that has been most successful came from a link provided in the comment by #dave_thomson_085, How do I get Java FX running with OpenJDK 8 on Ubuntu 18.04.2 LTS?.
This answer involves purging and reinstalling openjfx with an older version, and marking it to NOT be subjected to updates.
The code provided by Wolfgang Fahl (which he credits to Druidefix) follows:
apt purge openjfx
apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2
apt-mark hold openjfx libopenjfx-jni libopenjfx-java
Now, I can run and test jars containing Java8 using JavaFX that were built on my Windows Eclipse, on my Ubuntu desktop.
I do get a warning message which I haven't dealt with yet:
Gtk-Message: 13:25:40.829: Failed to load module "canberra-gtk-module"
But this is not preventing my programs from running.

import javafx can not be resolved

I am using Windows 10 64-bit and eclipse java 2019-06.I have installed jdk 12.0.2 and jre 8u221. I have set environment system path in environment variable to C:\Program Files\Java\jdk-12.0.2\bin.I can easily compile and run java file in windows command prompt. I can not import javafx.
I have used e(fx)clipse (javafx1 in the following picture). I have also tried adding jfxswt.jar into external library(javafx2 in the following picture).
enter image description here
As per this article, Future of JavaFx
Starting with JDK 11, Oracle is making JavaFX
easier to adopt by making the technology available as a separate
download, decoupled from the JDK.
As you mentioned, you are using JDK 12.0.2. JavaFx library are no longer part of JDK, they need to be added separately.
Here you can find official documentation on how to proceed with JavaFX 12 development
Install JavaFx
JFX is not part of JDK since Java 11. They are now distributed as standalone packages. Some reading can be found here
You can either add the OpenJFX libraries by downloading them from here, or you can use another JDK distribution such as Azul, which bundles the OpenJFX with their OpenJDK distributions.

How can I install Netbeans with JDK 10

I try the command line with JavaHome:
netbeans-trunk-nightly-201803230002-javase-windows.exe --javahome "C:\Program Files\Java\jdk-10"
It should work, but I receive a message:
There is no JRE at the specified location C:\Program Files\Java\jdk-10
Thanks!
Updated on July 31, 2018 to strikethrough obsolete information, and add details on the official release of NetBeans 9.
You are downloading NetBeans from Oracle's site, so you should have no expectation that even the nightly dev build will work with Java 10.
NetBeans is currently being handed over to Apache from Oracle, and there is a development build available for download from Apache in the form of a zip file from here:
https://builds.apache.org/job/incubator-netbeans-linux/
You can unzip that file on Linux, Mac or Windows and it will work with Java 10. Just be aware that it has not yet been formally released; that is a few weeks away.
You can check for bugs and/or report bugs here:
https://issues.apache.org/jira/projects/NETBEANS
UPDATE June 4, 2018
Apache NetBeans 9.0 RC1 was released on May 28. The source and the binary can be downloaded as zip files from here:
https://netbeans.apache.org/download/nb90/nb90-rc1.html
UPDATE July 31, 2018
Apache NetBeans 9.0 was released on July 29. The source and the binary can be downloaded as zip files from here:
https://netbeans.apache.org/download/nb90/nb90.html#_downloading
!!! IMPORTANT NOTE !!!
NetBeans 9 officially only supports Java SE which means:
The Project Wizard is limited compared to NetBeans 8.2. For example, it does not even allow you to create a Java web application.
Most plugins are not available. The unzipped download of NetBeans does not even allow you to install plugins for Java EE, C/C++, Fortran, Grails, Groovy, PHP etc.
However, it is a simple process to enable that functionality (at your own risk). See the answer to How to get Netbeans 9 to deploy a valid webapp on Tomcat for details.
For an explanation on why the plugins are not available by default see What's Happened to My Favorite NetBeans Plugins?.
For Windows you can install with NetBeans Extracted bundle :
Open cmd as Admin User
netbeans-XXX-windows.exe --extract
then run
java -jar bundle.jar
Netbeans won't work properly with jdk version 10. Install jdk 8u/17l and everything should go well.

Unable to run JAVAC in Windows 7

Probable JAVA Version 7 Update 67 Installation Problem - javac.exe not found
I think that there is no problem in giving contact numbers and this is not a same query as it is on Windows 7.
After installing I tried to check javac.exe in this dir C:\Java\jdk67\bin and it was not present there. Then I searched C:\ and could not find there.
I installed JDK from the site:
https://java.com/en/download/index.jsp
I think that the installer has some problem.
Regards
Rohan Sarker
www.rohansarker.com
+913324288069 / +917278539338
Rohan, You can download Java for software development or running applications.
For java software development You need to download the Java JDK (which contains the java compiler javac.exe) at: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
For Java application execution You need to download the Java JRE (which contains the java interpreter) at: http://java.com/download/index.jsp
Best regards.

Categories

Resources