Java & openjdk Problems

Hi everyone. I’m pretty new to Linux, so hope I can explain this correctly.

I’m trying to open a program that uses Java to run, but it doesn’t know what application is needed to run it. I right click on it, open with, other application - but of course there is no correct application listed.

Have done some research and run the following commands in Konsole -

[FONT=arial]update-alternatives --list java

which gave the output

[FONT=arial]/usr/lib64/jvm/jre-11-openjdk/bin/java

I used this in the Open With / Other Application path without success.

When I use /usr/lib64/jvm/jre-11-openjdk/bin/java a Java icon briefly appears in the Panel, but disappears right away and the program doesn’t open.

I’ve tried several different paths but they either error as not found, or the Java icon appears briefly in the panel and disappears.

Any ideas how I can this program to run please?

With best wishes to one and all and many thanks

[/FONT][/FONT]

Hi
Is it a jar file your trying to run? If so, in the konsole try;


java -jar /path/to/file/some_java.jar

Thank you very much malcolmlewis. It is a jar file I’m trying to run.

Once I’d worked out what path I needed to put in to Konsole from your solution ( Linux newbie!) it worked perfectly.

I may be overly fussy here, but is having to use that command in Konsole the only way I can run the program?

This machine has (bold line is the active one):

**erlangen:~ #** update-alternatives --list java 
** /usr/lib/jalbum/jre64/bin/java **
/usr/lib/jvm/bellsoft-java15-runtime-full.x86_64/bin/java 
/usr/lib64/jvm/jre-15-openjdk/bin/java 
**erlangen:~ #**

Typical desktop file (invocation is bold line):

karl@erlangen:~> cat Schreibtisch/Jalbum.desktop 
[Desktop Entry] 
Categories=Graphics;Java 
Comment[de_DE]=downscales your images to web and thumbnail size, creates complete web pages, and uploads them to jalbum.net or your own website! 
Comment=downscales your images to web and thumbnail size, creates complete web pages, and uploads them to jalbum.net or your own website! 
**Exec=java  -jar /usr/lib/jalbum/JAlbum.jar **
GenericName[de_DE]=jAlbum is the best 
GenericName=jAlbum is the best 
Icon=/usr/lib/jalbum/icons/JalbumApp48.png 
MimeType= 
Name[de_DE]=jAlbum 
Name=jAlbum 
Path= 
StartupNotify=true 
Terminal=false 
TerminalOptions= 
Type=Application 
Version=1.0 
X-DBUS-ServiceName= 
X-DBUS-StartupType=none 
X-KDE-SubstituteUID=false 
X-KDE-Username= 
karl@erlangen:~>

Many different versions of JVM exist:

karl@erlangen:~> java -version  
openjdk version "14.0.1" 2020-04-14 
OpenJDK Runtime Environment (build 14.0.1+7) 
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode) 
karl@erlangen:~> 

Refer to the documentation of the application for specific requirements.

Try to install java-binfmt-misc package.

Hi
If it’s just a jar file, you can always create a desktop file (or script) to launch… what is the program your trying to run?

A Java Home-Banking application I use has the following line in the in the shell script (supplied with the application) used to start it –


LIBOVERLAY_SCROLLBAR=0 GDK_NATIVE_WINDOWS=1 SWT_GTK3=1 exec java $_JLP -Djava.net.preferIPv4Stack=true -Xmx512m -Xss64m $_JCONSOLE -jar jameica-linux${archsuffix}.jar $@

What I’ve done to use the thing from the KDE Plasma Desktop Starter, is to create a ‘.desktop’ file with the following content, which I then import into the KDE Starter –


[Desktop Entry]
Version=1.0
Terminal=false
Icon=/opt/jameica/plugins/hibiscus/icons/hibiscus-icon-64x64.png
Type=Application
Categories=Office;Finance;
Exec=/opt/jameica/jameica.sh
Name=Hibiscus
GenericName=FinTS Application
GenericName[de]=FinTS-Anwendung
Comment=Hibiscus die freie Homebanking-Anwendung
Keywords=HBCI;FinTS;
Encoding=UTF-8

It is a jar file and the program I’m trying to run is called iso2dsd. I have no idea how to create a desktop file or script as I’m Linux novice & never done it in Windows either I’m afraid, but willing to learn. I’ve learned some things already from this exercise, but most of the replies above are way beyond me currently. Nevertheless, I do really appreciate all you guys taking the time to reply with help and suggestions.

With your help earlier, this is the terminal command I use to run the program and it works, but a file or script would be nice.

[LEFT] [size=2]java -jar /home/bfg/iso2dsd/iso2dsd_gui.jar
[/size][/LEFT]

Many thanks to all

With plasma: Right Click > Create New > Link To Application > Application > Command: [size=2]java -jar /home/bfg/iso2dsd/iso2dsd_gui.jar[/size]

https://sonore.us/iso2dsd.html

Linux Usage

  • Right-click the iso2dsd_gui.jar, select Properties/Permissions, place a check in the Execute box, and press close
  • Right click the iso2dsd_gui.jar select Open with other application and select Jave

Thank you. This is what I tried at the start of all this, but realised I couldn’t find a program to open the application with. Couldn’t even find Jave on my system so assumed it was a typo instead of java.

Thank you for showing me how to do this. It worked and is easy when you have someone to point you in the right direction!

With best wishes . . .

I meant to add that I can’t believe how much faster this program runs under Leap compared to Win10:good:

Possibly due to some 64-bit versus 32-bit issues – Linux tends to use 64-bit Java – Windows often uses 32-bit Java – you have to be careful in choosing the Java version Windows uses.
Possibly a BIOS/UEFI setting on the Windows machines – “CPU Core Leveling = One Compute Unit Per Core” often helps on Windows machines …