I have a problem with a particular windows installation where any graphical element of java refuses to run.
Java has previously ran successfully on the current Windows installation, but was probably over 12 months ago.
This issue presented itself when I tried to run a .jar and no window ever opened (nothing showing signs of life in task manager).
Clicking 'Java' in control panel results in the 'waiting' cursor for a quarter of a second then nothing.
Running 'About Java' and 'Configure Java' shortcuts also results in this same behavior.
I have tried:
Uninstalling Java, rebooting and re-installing the latest x64 version (1.8.0_271)
Running 'JavaRa' (JavaRa) in the hopes of cleaning up something that the uninstallation missed
Removing '.\Oracle\Java\javapath' from PATH environment variable as suggested by java x86 stackoverflow question
The only signs of life I can get is in powershell/command prompt.
Running java -version results in the output as expected:
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
However running, java -jar 'jarfile.jar' does not launch the application window.
Amendment:
I have resorted to trying a fresh copy of Windows installed on a USB drive. I have installed the same x64 version of Java using the same offline installer .exe
Java works normally on this fresh install.
Running a .jar on existing windows install
running java -jar "technicLauncher.jar" results in
Settings for exe: /D:/TechnicLauncher.jar
Portable settings dir: E:\technic
At this point, the applications user interface does not open, powershell displays: Setting up logging then the program exits.
Running a .jar on fresh windows install
running java -jar "technicLauncher.jar" results in
Settings for exe: /D:/TechnicLauncher.jar
Portable settings dir: E:\technic
At this point, the applications user interface opens and I can continue as normal.
Related
Situation
The problem I have encountered is that there will be no sound output from running my *.jar file. I will start it with java -jar cgoban.jar and it works fine except there is no sound.
Possible Solutions
There is a workaround for this problem discussed here: https://senseis.xmp.net/?CgobanProblemsAndSolutions.
It says to employ the Java Web Start with
LIBXCB_ALLOW_SLOPPY_LOCK=true padsp javaws http://files.gokgs.com/javaBin/cgoban.jnlp
and use the jlnp file from here: http://files.gokgs.com/javaBin/cgoban.jnlp.
However, since this workaround includes downloading the jar-file on every start this is not an option for me (as I use an offline machine, bandwidth limitations etc.)
A possible solution might be to run (since it works with javaws)
LIBXCB_ALLOW_SLOPPY_LOCK=true padsp java -jar cgoban.jar
but there is still no sound. I don't understand why it works for javaws, but not for java -jar.
Unluckily it did not help to run
java -jar -Dsun.sound.useNewAudioEngine="false" cgoban.jar
But thanks for commenting.
Another possible solution that I attempted was to download and edit above jlnp-file. I don't want to download the jar-file every time the application starts. So maybe it is possible to download the jar-file once and then have the local jlnp-file point to the local copy (instead of the remote jar-file). However, as my programming skills suck, I have not been able to pull this off.
Additional Information
I'm running an Ubuntu machine with Java installed. java -version gives me the following output:
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
An up-to-date version of cgoban.jar for download is available from here:
http://files.gokgs.com/javaBin/cgoban.jar
I downloaded eclipse neon version from here
elipse-neon for 32 bit
When i tried to run eclipse,error i am getting is:
ujjwal#ujjwal:~/Downloads/eclipse$ ./eclipse -vm /usr/bin
Gtk-Message: Failed to load module "overlay-scrollbar"
Gtk-Message: Failed to load module "unity-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/ujjwal/Downloads/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.401.v20161122-1740/eclipse_1618.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
My system is 32 bit. And java version is:
ujjwal#ujjwal:~/Downloads/eclipse$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Problem 1: Why java HotSpot server is 64-bit? Will it work with my system which is a 32 bit system.I think the error is related to this.
Problem 2: How to launch eclipse neon with java 8 support. What am i missing.?
PS: I have tried this, this and this, but nothing worked for me.
Download eclipse-java-neon-2-linux-gtk.tar.gz click here
than
Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the command below to extract Eclipse to /opt/:
cd /opt/ && sudo tar -zxvf ~/Downloads/eclipse-java-neon-2-linux-gtk.tar.gz
You may replace “eclipse-*.tar.gz” (without quote) to the exact package name if the command does not work.
Don’t like Linux commands? You can do this by opening Nautilus file browser via root: Press Alt+F2 -> run gksudo nautilus.
Once done, you should see the eclipse folder under /opt/ directory.
Press Ctrl+Alt+T, paste below command into the terminal and hit enter (install gksu from Software Center if below command does not work).
gksudo gedit /usr/share/applications/eclipse.desktop
Above command will create and open the launcher file for eclipse with gedit text editor.
With regard to the answer by Raj: installing Eclipse with root permissions is not recommended, because Eclipse prefers to update configuration files inside the installation. If that's not possible, any configuration updates are written to ${HOME}/.eclipse/ which is sligthly restricted in several regards.
In particular selecting the correct JVM to run Eclipse can be done via editing eclipse.ini.
EDIT: In fact much installation hassle can be avoided by using the installer, see the corresponding box on the download page, which has a nice explanation when you click on Find out more.
I have a JNLP application that uses the local $PATH variable. It launches and behaves correctly from the web, command line, menu system, and Java control panel. When I launch it from the desktop shortcut on CentOS 7, the $PATH is simply
/bin:/lib:/usr/bin:/usr/lib:/usr/share/bin:/usr/share/lib
regardless of what else I put in the /etc/profile.d/, or ~/.bashrc, or anyplace else that I can find. It only seems to affect CentOS 7. CentOS 6.x, OS X, and Windows all behave normally when launching from their Desktop environments.
I am using Oracle's 32-bit Java 1.8.0_60 on the 64-bit CentOS 7 for specific application requirement reasons. I have uninstalled IcedTea, but still have OpenJDK 1.7 installed, though it is not used by the JNLP application and the alternatives have been configured to use Oracle's.
The best solution that I have found is:
Disable shortcut creation in the Java control panel > Advanced settings
Create a shell script that contains these two lines:
source /etc/profile
javaws < location-of-jnlp >
Create a .desktop file that calls the shell script
It's not an ideal solution, but it works for the short run.
I have Mac OS 10.9.3 installed, and when entering java -version in the Terminal it shows:
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
My problem is that applications which use Java don't work when double-clicking on the .app folders. For example, TuxGuitar just does nothing, and Eclipse gives the No Java virtual machine error. When launching them with the command
open TuxGuitar.app
open Eclipse.app
.. they work both. What could be the problem?
I had the same problem and I fixed this by installing a patch from apple at
http://support.apple.com/kb/DL1572?viewlocale=en_US.
Something is different in the environment of the shell you get in Terminal, compared with the environment Finder.app is running in. You need to figure out what's different.
A few relevant facts:
OS X windowed applications do not read your shell startup files like ~/.bash_profile, so changes you make there to your ${PATH} or ${JAVA_HOME} will not affect windowed applications.
It used to be the case that OS X windowed applications read ~/.MacOSX/environment.plist but apparently that's no longer true in 10.9 Mavericks; see for example this other StackOverflow question.
Java on Mac OS X keeps changing, and can be installed and controlled in a variety of ways. So it's hard to give a general answer; it depends on the history of your system.
Java Mac GUI applications can place restrictions on which JVM will run them, in Contents/Info.plist of the application bundle; look for key JVMOptions and in particular at JVMVersion within that.
Things to try:
Open System Preferences and see if you have a Java Control Panel. If you do, you can use it to select which JVMs are available for running GUI applications, and in what order they will be tried.
Open a "clean" shell by running env -i /bin/sh and then try running /Applications/TuxGuitar.app/Contents/MacOS/TuxGuitar inside that shell; you may get a useful error message.
Use /usr/libexec/java_home -V to see a list of JVMs the OS knows about.
/usr/libexec/java_home -v 1.7 to see which JVM the OS would choose for an application that needs Java 7.
I have the exact same issue after upgrading to Mavericks and I noticed it with muCommander.
As I can run the app manually from the command line, I have the following workaround which I am quite happy with:
Create a shell script workflow using Automator:
Spotlight -> Automator -> Workflow -> "Run Shell Script" -> [shell command]
Then save the Worflow, but instead of .workflow, choose file format Application. Now you have an App you can double-click.
Addendum 1: This is not the answer to your original question as I don't know exactly what the problem is (jbyler's answer might point you in the right directions here).
However, I assumed that your question implies Can I get double-click to work again?, and this workaround helped me to do that.
Addendum 2: I have JAVA_HOME set up and the same version installed as you have. This is a screenshot for the Workflow in Automator:
I managed to fix this by installing the developer kit.
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
I had the same problem. Open the /Applications/TuxGuitar.app/Contents/MacOS/TuxGuitar with your favourite text editor (it's a shell script) and add "-d32" option to the last line "exec java ...." (position doesn't matter). This will launch java in 32-bit mode. Alternatively you can launch TuxGuitar with "-d32" option (it passes arguments to java) from the terminal.
I have to start by saying that I have just switched to Ubuntu from Windows and I am new to Linux in general. Coming from Windows, I really am not familiar with how exactly the permissions work, the Linux file system, where I am able to create folders that I can use without the sudo command etc.
I use eclipse on a daily basis for android development and other simple java swing projects. I was able to download and extract the latest available version of eclipse (kepler) to this path: /opt/eclipse. Inside this directory is the eclipse executable and other eclipse related files.
I also installed the JDK and verified with the java -version command. It says:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
I am running on a 64 bit CPU architecture so both programs are the 64 bit version.
Now, my problem is that if I open eclipse from the Unity dash or from the file explorer, it give me this error:
However if I run sudo eclipse in the terminal, everything runs just fine as long as I do it as the super user. I have a hunch that the JDK is installed in a folder that is restricted to normal users and only works if I run the sudo command but this is just a hunch. As I said, I am new to Linux and I am not really sure what I am doing wrong here, I am learning as I go. I need a good explanation as to how to make it start from the Unity dock without the sudo command. Thanks in advance!
You'll want to use the chmod command from the terminal to change the permissions on the Java folder. See this link for more information:
http://www.linux.org/threads/file-permissions-chmod.4094/
Well after running the which java cmd, I noticed that the path to the JDK from the eclipse.ini file was not pointing to the correct location. I fixed the path and now it works. I don't know how the sudo cmd overrides the eclipse.ini path to JDK but well, it works