I am currently trying to use HERO Designer, a Java program, on Ubuntu 16.04. All other Java programs work as expected (i. e. I double click on them and they start without issue).   If I run it from the command line (java -jar HD6.jar) everything works fine. If I double click on it, it locks up. The splash screen comes up and it stops a few moments later. When executed by double clicking the program starts, then hangs on the splash screen.  According to the developer, this means I don't have write permissions. I looked in Properties > Permissions. I am the owner. The owner and group have read/write access, and the executable flag is checked. I also created a bash script that just runs the above line with the same results.   The result of the ps aux | grep HD6 is:    daniel   13216  1.0  2.6 5019752 214316 ?      Sl   19:28   0:18 /usr/bin/java -jar /home/daniel/Programs/HERODesigner/HD6.jar   I'm opening with "OpenJDK Java 8 Runtime". Other Java programs run without issue by double clicking the icon. Any suggestions?
109794
I have a problem running .jar files by double-clicking them. When I go to the Properties dialogue I can't find Java--only Archive Manager in the list of programs. But java -jar somefile.jar opens the program.
22283
Before I add more detail to my question, I have to say something very important: Yes, my script has &quot;Allow executing file as program&quot; turned on. The question itself: For programming reasons (shared libraries), I can't execute my program just from the executable, because I need to access LD_LIBRARY_PATH before executing the program. I created this script to do this (baring in mind this is my first time ever writing a script): #!/bin/bash #Get the current directory and append the SO's location currentDir=$(pwd)'/libs/'  #Change the library path export LD_LIBRARY_PATH=$currentDir  #Run the program ./program  After running this from the terminal I thought that it has worked, there were no errors and the program didn't complain about shared libraries. But unfortunately, if I try to double-click the .sh file from Nautilus, nothing happens. The worst part as well, is that since I'm running it from the GUI, I have no idea what error it is getting. I'm running Ubuntu 14.04 and the executable is a C++ program using the SFML libraries (Yes I could just have the dependencies, but SFML isn't commonly installed on Linux computers, and this is besides the point).
82102
I have installed JDK 6, but I can't execute a Java program.   For example, I have made test.java.  I compile it with javac tes.java and there's no error when I compile it, but when I want to execute that program it always displays an error.  I execute the Java program with java tes.  Exception in thread "main" java.lang.UnsupportedClassVersionError: tes : Unsupported major.minor version 51.0     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:634)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)     at java.net.URLClassLoader.access$000(URLClassLoader.java:73)     at java.net.URLClassLoader$1.run(URLClassLoader.java:212)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:205)     at java.lang.ClassLoader.loadClass(ClassLoader.java:321)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)     at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: tes. Program will exit.   My javac version is 1.7.0, my java version is 1.6.0.  Here is my tes.java code:  class tes{      public static void main(String[]args){         System.out.println("hello");         }     }
8935
While installing Android Studio on Ubuntu 14.04 I get the message that my Java version (javac 1.7.0_79) is causing problems. I found a  of how to install a newer Oracle version of Java:  sudo apt-add-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer   However I'm afraid that this might overwrite my existing open-jdk version of Java. Since I don't know which of my programs depend on Java, I fear that this could crash these other programs.  Is there a way to make sure apt-get doesn't overwrite my previous Java? I would basically like to have installed both and be able to switch between them manually, depending on what version I need.
93571
For users running Java application or applets in the browser, what difference does it make running either Sun Java or OpenJDK?  EDIT  Oracle will be , and basing the proprietary implementation on OpenJDK. Can we expect similar experience in running Java apps using either OpenJDK or Oracle JDK?
16499
If yes, on which operating system, shell or whatever?  Consider the following java program (I'm using java just as an example, any language would be good for this question, which is more about operation systems):  public class ExitCode {     public static void main(String args[]) {         System.exit(Integer.parseInt(args[0]));     } }   Running it on Linux and bash, it returns always values less equal 255, e.g. (echo $? prints the exit code of the previous executed command)  &gt; java ExitCode 2; echo $? 2  &gt; java ExitCode 128; echo $? 128  &gt; java ExitCode 255; echo $? 255  &gt; java ExitCode 256; echo $? 0  &gt; java ExitCode 65536; echo $? 0     EDITED: the (only, so far) answer below fully  explain what happens on UNIXes. I'm still wondering about other OSes.
16794
I installed Java JDK on Ubuntu 12.04 and added Java home to my path at ~/.bashrc:  export PATH=/opt/jdk1.7.0_40/jdk1.7.0_40/bin:$PATH   This looks a little bit strange but it's really my path.  After this I installed maven through:  sudo apt-get install maven   It installed all the needed libraries and now when I run mvn -version, I see:  Error: JAVA_HOME is not defined correctly.   We cannot execute /opt/jdk1.7.0_40/bin/java   What is wrong with it?   How to solve this trouble?
82161
Sometimes I have to use some propriety softwares which I don't trust or even pre-compiled open source ones which I don't know if they've been compiled as their source are.   Lets say we installed a propriety application in /opt/software, then we run it as a normal user (without sudo, gksudo, etc).   I know when we run a program it is able to connect to the Internet, monitor X, keystrokes, collect user data and so on. It can't change anything important in the system or infect the system, (because of the Linux permissions system). It is possible for program to add some plug-in/extension to a user's browser (Because browser profiles are available in user home directory). After closing the program and rebooting it can't do anything anymore. Wrong because:   Program can add itself to a shell/file/directory which does the autostart process, so it will run at any login.  If we consider the autostart process clean, without rebooting there is a chance that a process of the program is still active. Programs can delete or modify any file in the user home directory (or any other file which a user has write permission to).   So what should we do?   I think the only safe way to run a propriety program is running it as another user. If running the program as another user somehow is not possible then we should change the autostart files permission so only root can change them. then after closing the program a reboot will do the job.   Am I right? Is there anything that I'm missing?
40941
After running:  sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts   I try to setup a software sybase sudo ./setup.bin but I get the following problem:  exec: 2508: /tmp/install.dir.30906/Linux/resource/jre/bin/java: not found
102856
This is probably a question more for unix systems but because i have it on my Mac Pro i hope i will find an answer here :  When i browse to /Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/db/bin  with a cd I can't execute the command startNetworkServer present in bin , instead i can run it via ./startNetworkServer.  However from ~  MacCris:~ cris$ /Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/db/bin/startNetworkServer   it works without ./  Any idea why ? (rights related ?)  Thanks
6919
I'm going according to the steps mentioned on the cs colby .  First, I installed java on my system by typing the following commands-  sudo add-apt-repository ppa:linuxuprising/java sudo apt-get update sudo apt-get install oracle-java10-set-default sudo apt install oracle-java10-set-default     Then, according to the instructions, I downloaded the .zip file, extracted it and then in the terminal typed   java -cp .:richtextfx-fat-0.6.10.jar:reactfx-2.0-MR.jar -jar CPUSim-4.0.11.jar   But this didn't work.  of command 1 terminal.  Here is a screenshot of all the files that are there in the CPUSim folder,   On observing the names of the folders present, I thought that the previous command was wrong. So I tried the following ones,  java -cp .:richtextfx-fat-0.6.10.jar:reactfx-2.0-M4.jar -jar CPUSim-4.0.11.jar java -cp .:richtextfx-0.6.10.jar:reactfx-2.0-M4.jar -jar CPUSim-4.0.11.jar   But none of them seems to work. Now when I click on the CPUSim-4.0.11.jar file, nothing happens. I have just switched to Ubuntu from Windows 10, and have a very little knowledge about how things work here. Please tell me how I could install and run CPUSim 4.0.11 on Ubuntu 18.04 LTS.
109961
I use ArchLinux, and an IDE called PyCharm. On its , it recommends using Java 6 instead of OpenJDK. ArchLinux has an OpenJDK package (jdk7-openjdk) that I have installed, installed, and from what I had read in the , it should be possible to install Oracle Java 6 along side OpenJDK 7 via a packages called jdk6-compat and jre6-compat, which install these versions of Java in /opt/ instead of the normal location.  However, after installing jdk6-compat and jre6-compat, I still see that I am running OpenJDK 7 when I run the following:  % java -version java version "1.7.0_09" OpenJDK Runtime Environment (IcedTea7 2.3.3) (ArchLinux build 7.u9_2.3.3-1-x86_64) OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)   ...even after I have set JAVA_HOME and added /opt/java6/bin to my PATH in my .zshrc file.  How can I get PyCharm (or other applications) to use Oracle Java 6 instead of OpenJDK?  Thanks, and apologies if I've posted in the wrong place.  Other information that might be helpful:   Using Gnome 3 as DE
27787
Trying to install Eclipse on fresh Ubuntu. Got error:    If I type java command I have output:    Can I install default OpenJDK or should I go to Oracle site and download Java there? Why I can't use OpenJDK?
62780
Possible Duplicate:          I'd like to create a Windows .exe for a Java program. Previously, I've used JEXECreator for this, but it's not entirely satisfactory because:   The executable sometimes works on the machine on which it was created but not on others. The program is commercial; if you use the trial version, it adds a nag screen to your application.   I don't need the generated .exe to work if Java is not installed on the target machine (in fact, I think this is impossible).  Any recommendations?
6208
I'm trying to run an executable (testdisk) but double click doesn't work. The only way is to run:  sudo ./testdisk   from terminal. But I'd like to open executables with double click in future. How can I do this?
2245
In my Java application, I want to run a batch file that calls "scons -Q implicit-deps-changed build\file_load_type export\file_load_type"  It seems that I can't even get my batch file to execute. I'm out of ideas.   This is what I have in Java:  Runtime.    getRuntime().    exec("build.bat", null, new File("."));   Previously, I had a Python Sconscript file that I wanted to run but since that didn't work I decided I would call the script via a batch file but that method has not been successful as of yet.
37625
I have tried right clicking on the file selecting properties and then the permissions tab and setting it to execute. However, when I double click the file it opens in gedit. What do I do?