I see that Java 6u65-apple is one of the available Java versions. Where does this JDK get installed on macOS? Will this JDK coexist with the newer (newest) Oracle Java JRE and JDK?
I tried what you intend using sdkman on macOS High Sierra. It should install it below ~/.sdkman but it seems not to work. This is what I and some others get, see for example https://gitter.im/sdkman/user-issues?at=5a1db5de71ad3f87363f4754
$ sdk install java 6u65-apple
tr: Illegal byte sequence
Apple requires that you agree with the Apple Software License Agreement
prior to installation.
The license agreement can be found in PDF format here:
http://images.apple.com/legal/sla/docs/JavaForOSX.pdf
Do you agree to the terms of this agreement? (Y/n): Y
Downloading: java 6u65-apple
In progress...
######################################################################## 100.0%
Binary validation passed...
We will be needing super powers...
Repackaging Java 6u65...
Attaching to the DMG...
Mounting DMG as Volume...
Volume(s) mounted successfully
Installing PKG inside DMG...
installer: Cannot install on volume / because it is disabled.
installer: Es ist bereits eine neuere Version dieses Pakets installiert.
Copy JDK Home to temp folder...
cp: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home: No such file or directory
unlink: /Users/gg/.sdkman/tmp/out/java-6u65-apple/bundle: No such file or directory
ln: /Users/gg/.sdkman/tmp/out/java-6u65-apple/bundle: No such file or directory
Preparing archive...
zip error: Nothing to do! (try: zip -qr --symlinks /Users/gg/.sdkman/tmp/.zip . -i .)
Unmounting volume...
"/Volumes/Java for OS X 2015-001" unmounted successfully.
Done repackaging...
mv: rename /Users/gg/.sdkman/tmp/.zip to /Users/gg/.sdkman/archives/java-6u65-apple.zip: No such file or directory
unzip: cannot find or open /Users/gg/.sdkman/archives/java-6u65-apple.zip, /Users/gg/.sdkman/archives/java-6u65-apple.zip.zip or /Users/gg/.sdkman/archives/java-6u65-apple.zip.ZIP.
rm: /Users/gg/.sdkman/archives/java-6u65-apple.zip: No such file or directory
Stop! The archive was corrupt and has been removed! Please try installing again.
So I found on http://osxdaily.com/2017/06/29/how-install-java-macos-high-sierra/ a link to https://support.apple.com/kb/dl1572?locale=en_US and just clicked "Download" and it does install JDK6 inside /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/ as expected. And you can switch as you like:
$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
$ export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
And since javac 1.6 worked fine and this was the only reason for looking into sdkman I removed it entirely.
Related
could someone suggest elegant way to upgrade javac in Debian to version 8 ?!
javac -version
javac 1.7.0_261
java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
to those who needs elegant solution:
download JVM from oracle: http://java.sun.com/products/archive/
if you use Linux as I do, *.tar.gz file can be chosen (it has all related binaries)
in Debian or other Linux untar it with command "tar xvzf PACKAGENAME.tar.gz", as a result all folders and subfolders will be created in related new folder, e.g. jdk-8u251-linux-x64. Related version of javac is in "dk-8u251-linux-x64/bin/" subfolder
copy this all structure e.g. "jdk-8u251-linux-x64" e.g. to /home/user1
modify PATH variable to allow system find related new javac: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/user1/jdk1.8.0_251/bin/
old javac can be renamed as a backup: mv /usr/bin/javac /usr/bin/javac_old
verification of the result:
javac -version
javac 1.8.0_251
Now javac on my system has the same version as java (as mentioned above, before they were quite different). In version 8 Java have several changes, e.g. some new ways how Time is handeling, which forced me to such changes.
STM32CubeProgrammer seems to be installed yet when I try to run the program I come across with this error.
I have OpenJDK, OpenJFX and Oracle installed on my computer.
How can I fix the error?
If you are using macOS please see my installation guide here (tested with macOS Catalina 10.15.1 (19B88).
1.To be sure you use the right java version deinstall all java versions first
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Application\ Support/Oracle/Java/
sudo rm -rf /Library/Java/JavaVirtualMachines
2.Restart your Mac
3.Check if the deinstallation was successful
~ java -version
No Java runtime present, requesting install.
4.Now install " jdk-8u231-macosx-x64 "
5.Check your java version after installation
~ java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
6.Go to the directory where the STM32CubeProgrammer installer is located. For example
~ cd /Users/myName/Desktop/en
7.Install STM32CubeProgrammer
en sudo java -jar SetupSTM32CubeProgrammer-2.2.1.exe
6. The result should be
Command line arguments:
====================
Installation started
Framework: 1.6.0_65-b14-468 (Apple Inc.)
Platform: mac_osx,version=10.15.1,arch=x86,symbolicName=null,javaVersion=1.8.0_231
Installation finished
8.Now you can start STM32CubeProgrammer
I was a little confused too until I noticed that the instructions above instruct you to download a past version of STMCubeProgrammer -> VERSION 2.2
When visiting the download page from the link emailed to you, note that there is a Version: selection box. Open it and choose 2.2 then click the download button. Resume the instructions above and you should be good to go.
Good luck!
actually i im learning Linux (CentOs 7). I installed Java on root (usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin/java).
Now i have one question. if i type "java-version" i get
[mibe#localhost ~]$ java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
I thought that java only works if i set the JAVA_HOME PATH in /etc/profile. Why do i get a result for this call?
Because you installed java in /usr/lib, this folder is in system environment. When you type java -version, the system can find the command java.
But if you install java in other folder not in system environment, you must set the JAVA_HOME PATH in /etc/profile to tell the system how to find the java command, and there are other important reasons why to set the JAVA_HOME not just for this.
https://stackoverflow.com/a/27996647/11559693
Complete error message:
The JDK is missing and is required to run some NetBeans modules
Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.
Some details: I just installed Netbeans on Linux mint for the first time and when I start it when its turning on modules this error message appears. But I do have jdk installed.
$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
$ javac -version
javac 1.8.0_66
Find the file [netbeans installation directory]/etc/netbeans.conf
Luckily, Linux has a find helper like
find /home/ -name "netbeans.conf,
in which you can change the /home/ to a location where you want to search.
I found it at /usr/local/netbeans-8.1/etc/netbeans.conf
Once, you found the file, the following property needs to be set:
netbeans_jdkhome="[jdk_path]"
where you can find the jdk_path using:
update-alternatives --config java
In my case, I found it at /opt/java/jdk1.8.0_191
[Solved] For Mac OSX 10.11 (El Capitan).
Solution may be similar for other Unix-based systems.
The problem may have occurred because I inadvertently installed the jre
prior to installing the jdk. I uninstalled the jre, installed the jdk
and reinstalled NetBeans but the problem (popup window) remained.
However, the fix was fairly simple.
1. Make sure NetBeans is not running.
2. Make sure the jdk is installed.
3. Determine the location of the jdk:
The jdk location can be determined by entering the following (in Terminal):
$ /usr/libexec/java_home
For my system, the output was:
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
4. Edit the NetBeans configuration file to indicate the location of the jdk.
Near the bottom of this Netbeans configuration file (or equivalent for your NetBeans version):
/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
Comment out the following line (insert a # before the first character):
#netbeans_jdkhome="/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/bin/jre"
Then, add the following line (or equivalent for your jdk version):
netbeans_jkdhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home"
Then, save and exit the editor.
5. Start NetBeans (no more popup window indicating that the jdk is missing).
When netbeans has problems trying to find the path of the jdk, it's mainly because the version of the jdk does not match. Open the file C:\Program Files\NetBeans 8.2\etc\netbeans.conf, and verify that netbeans_jdkhome = "C:\Program Files\Java\jdk1.8.0_111".
Open netbeans.conf
sudo nano "/usr/lib/jvm/java-8-oracle/netbeans.conf"
Set proper sdk path:
netbeans_jdkhome="/usr/lib/jvm/java-8-oracle"
Exit Ctrl + X and to save changes Ctrl + T
This error showed up when I updated the Mac to Mojave. To fix, I edited the netbeans.conf file with the current jdk by using Terminal to find the correct jdk. Type
/usr/libexec/java_home -V
Here was my output.
Matching Java Virtual Machines (4):
1.8.311.11 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_131 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
1.8.0_25 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
1.7.0_79 (x86_64) "Oracle Corporation" - "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Entering the first jdk listed did not work.
I edited the conf file with the second one listed:
netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home"
Restarted Netbeans. That fixed it.
This worked for me
1. install full JDK
2. either edit <netbeans-IDE-installation>/etc/netbeans.conf
2.1 unmark netbeans_jdkhome
2.2 link to JDK location e.g. /usr/local/share/java/jdk1.6.0_07/
3. or use --jdkhome command-line option e.g. ./bin/netbeans --jdkhome /usr/local/share/java/jdk1.6.0_07/
take care with the "/" at the end
More info in http://wiki.netbeans.org/FaqRunningOnJre
Ubuntu 16.04 LTS:
Uninstall the netbeans you have.
Delete .cache/netbeans folder
Download http://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-142931.html
Install your download
I have this problem to. But now i resolove this problem with edit one line.
Find and open this file /etc/netbeans.conf
If you see netbeans_jdkhome="C:\Program Files\Java\jre1.8.0_151" replace netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_131"
Save as adminstrator
Problem reseloved
In mid April 2019, Oracle has changed the JDK's licence. However, I was still able to solve this issue with NetBeans 11 and the JDK 12's open source build on my Windows machine. Just downloaded the open source JDK from https://jdk.java.net/ and extracted it. Then, in my NetBeans config file, I typed in the path to the extracted directory (NOT the "bin" folder!).
I resolved this problem by changing default version of JRE and JDK that I'm using to 11.x.x with following commands:
sudo update-alternatives --config java
sudo update-alternatives --config javac
I have downloaded eclipse classic x86_64 3.7 cocoa on my Mac Intel Core 2 Duo with snow leopard 10.6.8
I have extracted and copied the eclipse directory to Applications folder. When run,
I get following errors
System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
Unexpected error loading extension: org.eclipse.equinox.p2.metadata.repository.simpleRepository
java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.httpclient.HttpClient at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientBrowseFileTransferFactory$1.sendBrowseRequest(HttpClientBrowseFileTransferFactory.java:53)
Error while reading from repository: http://download.eclipse.org/releases/indigo/site.xml.
I have following java version
java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
I have tried with eclipse classic 32 and 64 bit versions, with both i have the same problem .
I have also tried tweaking around priority of java version (32 or 64) under Java preferences.
Deleting /Library/Java/Extensions/log4j-1.2.15.jar resolved the issue.
Incase you are using ubuntu instead and had this problem, just go
cd /usr/java/packages/lib/ext/
sudo rm log4j-1.2.15.jar
sudo rm slf4j-*
I also had this problem and had nothing under /Library/Java/Extensions
You can notice that Eclipse reports: "The value will be overwritten using values from the preferences". So what you can do - visit Preferences > Network Connections and under 'Proxy Bypass' add Host: *
This has resolved the issue for me.
I set this to solve the problem:
http.sslVerify false in the egit config file.