Install New Software on Eclipse not working on Mac - eclipse

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.

Related

SBT fails with `String.class is broken`

sbt fails with a cryptic error on issuing any command (compile, assembly, clean or any other).
$ sbt --version
error: error while loading String, class file '/modules/java.base/java/lang/String.class' is broken
(class java.lang.NullPointerException/null)
I am on a machine running macOS, and sbt was installed via homebrew. I have tried upgrading to the latest versions of sbt (1.3.10), but the error still persists.
The issue is documented on the SBT Download page.
Homebrew maintainers have added a dependency to JDK 13 because they want to use more brew dependencies (brew#50649). This causes sbt to use JDK 13 even when java available on PATH is JDK 8 or 11. To prevent sbt from running on JDK 13, install jEnv or switch to using SDKMAN.
I was able to resolve the problem by using JDK 8 via jEnv.
Since sbt documents JDK 8 and 11 as compatible versions
We recommend AdoptOpenJDK JDK 8 or AdoptOpenJDK JDK 11
try controlling which JDK is used by sbt via -java-home setting which can be configured system-wide via sbtopts run configuration
/usr/local/etc/sbtopts
or per-project basis via
<project-root>/.sbtopts
For example, to configure JDK used by sbt in current project, try setting in .sbtopts
-java-home /Users/picard/.sdkman/candidates/java/current
This is what solved my problem on my Mac.
brew uninstall sbt
Install sdkman
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
Install sbt via sdk
sdk install sbt
I had the same issue recently. What worked for me is to install SDKMAN(https://sdkman.io/)
$ curl -s "https://get.sdkman.io" | bash
...
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
...
After installation, I wanted to see what versions of Java I can install. So I simply run this command to list all the available versions of Java
sdk list java
Choose the version you want to install (recommend installing either 8 or 11 as mentioned above) and simply run the command with the identifier that specifies your version from the list
sdk install java 11.0.3.hs-adpt
After installation, it set the Java 11 to default on my system. I then ran the sbt command again and it worked.
If you are using SDKMAN then in some cases certain versions of Java (i.e. JDK) from different vendor might help.
E.g. I was using Amazon Correto JDK8 (version 8.332.08.1-amzn) and it could not properly build my sbt project in IntellIJ IDEA, so I've switched to using Zulu's JDK8 (version 8.0.332-zulu) as default java version.
Hope this helps and good luck. :)

SonerQube doesnt start

Sonarqube Startup script does not start ob ubuntu 16.04
Error log shows:
Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
java.lang.IllegalStateException: SonarQube requires Java 11+ to run
at org.sonar.application.App.checkJavaVersion(App.java:93)
at org.sonar.application.App.start(App.java:56)
at org.sonar.application.App.main(App.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Startup failed: Timed out waiting for a signal from the JVM.
JVM did not exit on request, terminated
JVM Restarts disabled. Shutting down.
<-- Wrapper Stopped
If i run java -version:
java version "11.0.3" 2019-04-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode)
Open conf/wrapper.conf file
Change wrapper.java.command=java to path where your JavaDK is installed eg. wrapper.java.command=C:\Program Files\Java\jdk-11.0.4\bin\java
I had the same problem a few moments ago, my JAVA_HOME variable pointed to the correct version of my profile, but when I run java -version, it printed 1.8, so I run this command:
update-java-alternatives -l
This showed me all Java versions that were installed on my machine.
After that, I run this another command:
sudo update-java-alternatives -s java-11-oracle
This changed the Java version on my machine and it works just fine.
"Warning Support for Java 8 has been deprecated in SonarQube v7.8 and will be removed in SonarQube v7.9 LTS."
checkout you java -version, and the Supported Platforms requirements: https://docs.sonarqube.org/7.7/requirements/requirements/
Then go to the downloads and choose what is the best for you:
https://www.sonarqube.org/downloads/ (Show all versions)
Check for the JRE version, I have come across the issue where the Java SDK version and JRE -version was different. That may be the issue.
Most user would like to download JDK 11 here as mentioned in recent comments. That should works.
However, I would recommend to install latest version from following link (because you have just downloaded latest sonarqube) for better compatibility.
SDK download link: https://www.oracle.com/java/technologies/javase-downloads.html
FYI,
For mac user,
Install JVM on your machine (I installed it by Homebrew).
brew cask install java
and restarted the sonar by
./sonar.sh restart
it worked for me

Where is Java 6u65-apple installed?

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.

Why is this error showing when I try to use javaws?

When I try to use an application with the following command on Ubuntu:
javaws http://example.com.br/remote_example.jnlp
or simply type
javaws
The followin error shows up:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /usr/lib/jvm/java-6-oracle/jre/lib/amd64/libdeploy.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'.
I've searched on Google, but didn't find the answer. I'm sure i'm using 64 bit Ubuntu with 64 bit 1.6 jdk, my coworkers are using the same set up but have no idea what this message is about.
The problem is the java 6 loading screen pops up but after that no signal of the application being opened.
I've installed execstack with apt-get and run execstack -c on the library, the message doesn't show up anymore, but the application still won't open.
Running this on the command line solved the problem:
update-alternatives --config javaws
And then selecting the 1.6 jdk instead of any other appearing there.
For some reason it was using the my java 8 jdk even though my $JAVA_HOME variable was set to jdk 1.6 path.

The JDK is missing and is required to run some NetBeans modules

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