Fedora updates make Eclipse forget Java - java

(Not sure if this is an okay place to ask, but i'll try). After installing some updates in Fedora 16, Eclipse no longer knows how to use Java files. It can't make them, or compile them, or format the syntax. It's just eclipse without any Java whatsoever. I checked the yum.log and it installed about 6 eclipse updates and 2 java updates. A solution I found on the internet was to delete .eclipse and have eclipse regenerate it, but that didn't fix anything. Anyone know what's up?

The problem is documented here:
http://lists.fedoraproject.org/pipermail/devel/2012-January/161092.html
and this is the bug:
https://bugzilla.redhat.com/show_bug.cgi?id=760454
Basically, we were caught between a rock and a hard place and had to break a packaging loop so this broke people's existing installations. Move ~/.eclipse and restart Eclipse and you should be fine.
$ mv ~/.eclipse{,.bakBug760454}

I have faced a similar problem, it would be best in my opinion to remove every package for java and eclipse all together. You can find installed packages with:
sudo rpm -qa | grep keyword
where keyword would be for example 'jre', 'jdk' or 'eclipse'.
Once you find the packages you don't want, remove them with
sudo yum remove packagename
Then I would recommend you to skip default jdk available for linux and install the one provided from the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html
I have installed version 6 myself as I had some maven problems (m2eclipse) with Java 7.
Download the rpm, install it and set you path to java in .bashrc file.
Check all your installed jre/jdk with
sudo alternatives --config java
or
sudo alternatives --config javac
and set the apropriate option if necessary.
Next, go to the eclipse website and download the latest stable release of eclipse and you should be fine. You can integrate it with the desktop as well so you won't have to start it from the command line every time.

Check all of the available eclipse* packages. "Eclipse" itself is just a plug-in platform with a lot of UI components, it's not a Java IDE unless you also install those plug-ins. It's possible that the packaging was changed in a way that the Java plug-ins were no longer included in the packages you have installed after the upgrade completed.

Related

How to find the JRE location to use the system JRE in eclipse

I'm trying to set up a java project to use openjdk-11 and all the answers I have found so far have me going in circles. I'm using ubuntu 20.04, so I used the command 'sudo apt install openjdk-11-jre'. The installation seemed to be successful but now I can't seem to figure out the file path to the installed JRE. I thought it would be under /user/lib/jvm/java-11-openjdk-amd64 somewhere. When I point eclipse to that location and try to search for a JRE however it doesn't find anything.
I have found lots of examples with info on how to install but nothing about how to track down the exact file path. Any help would be greatly appreciated.
Update
While I was able to find the JRE location, the root problem turns out to be eclipse. I forgot I had an older version (4.6) open since that is what the project was originally using. Once I switched over to 4.18 I was able to add the java 11 JRE.
Using which will give you /usr/bin/java which won't help as it will be a symlink. You need something like
readlink -f $(which java)
you can use the following:
update-alternatives --list java
will gives you something similar to the below:
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

Switching Java 11 for Java 8 on the server

So I've seen a bunch of tutorials on switching from Java 8 to Java 11, but I actually need to do the opposite. And I am doing it on a server, so I can use only bash.
I am pretty clueless of how to do it. Any help?
You can run this command and chose version java:
sudo update-alternatives --config java
This is what I do on my Debian system:
alias j8='export JAVA_HOME=/usr/lib/jvm/bellsoft-java8-full-amd64;export PATH=$JAVA_HOME/bin:$PATH'
This will ensure all executables are of the same version, and is a lot easier than update-alternatives, even if it did work (see my comments below another answer) or update-java-alternatives and is less error-prone
I use this tool SdkMan Install, SkMan manual
skd list java
print the versions of java available, and you can install it with comands like
sdk install java 8.0.292.hs-adpt
After you install a java version with sdkman set the java Home with
export JAVA_HOME=~/.sdkman/candidates/java/current
export PATH=$JAVA_HOME/bin:$PATH
you can install many java versions as you want and set your default version with
sdk default java 8.0.292.hs-adpt
If you use maven or gradle install them from sdkman, because in this way autodetects the version switching.
If you want to switch java versions only for specific projects check the env and .sdkmanrc part in the manual. It switches versions when you cd into a directory and go back to default when you cd out.

How to fix error while installing NetBeans?

I have installed Java and am trying to install NetBeans 11.3 on my Windows 10 but after I ran the exe. installer, an error message popped up:
An unexpected exception happened in thread main
java.lang.NoClassDefFoundError java/util/jar/Pack200
NetBeans have problems with the jdk-14, because I suppose that you have install the jdk-14 so uninstall it and try it with the jdk-13.0.2.
Sorry, but in my opinion is to install an old version from Java no solution, just because it works. When someone has problems with his Firewall, simply disable the Firewall would also be no solution.
https://www.java.com/en/download/faq/other_jreversions.xml
We highly recommend users remove all older versions of Java from your
system. Keeping old and unsupported versions of Java on your system
presents a serious security risk. Removing older versions of Java from
your system ensures that Java applications will run with the most
up-to-date security and performance improvements on your system.
The "real" solution would be a reprogramming of the NetBeans installer.
This used function was suggested for deprecated on 2018-04-04, which was done on 2018-08-23.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8200752
The removal was suggested on 2019-10-08, which was done on 2019-12-18.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8232022
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8232022
We assume that developers who rely on Pack200 have had enough notice about its proposed removal to make alternative arrangements. … We assume that developers who use pack200 to shrink application JARs can switch to either the jlink tool or the jpackage tool to create application-specific runtimes with an optimized form factor.
edit: I solved it this way.
uninstalled JDK 14
installed JDK 13.0.2
installed Apache NetBeans
installed JDK 14
open C:\Program Files\NetBeans\netbeans\etc\netbeans.conf and changed path to JDK
uninstalled JDK 13.0.2
Now NetBeans runs with the JDK 14.
Yes, I got it working as follows from cmd, when referring to older version:
Apache-NetBeans-11.3-bin-windows-x64.exe --javahome "C:\Program Files\Java\jdk-12.0.2"
The https://netbeans.apache.org/download/nb113/nb113.html site now has this
memo:
The installers will not run under JDK 14 because usage is made of the Pack200 Tools and API, for packing and unpacking, which is removed in JDK 14, see JEP 367.
If several JDK versions are installed, then you need to define the environment variable "JAVA_HOME" where to set the path to JDK-12.
Details are described here. (Only in Russian)
An alternate way to Andy's.
(Windows)
1) Right click on "Apache-NetBeans-11.3-bin-windows-x64" installer and select "Create shortcut".
2) Right click on the created shortcut and select "Properties".
3) In the "target" textbox, add your under 14 JDK version path at the end, here is how mine looks like:
C:\Users\userfoldername\Desktop\Apache-NetBeans-11.3-bin-windows-x64.exe --javahome "C:\Program Files\Java\jdk-13"
4) Press Ok when done, double-click on the shortcut and it should install fine now.
Switching to openJDK 12 worked for me too. But instead of uninstalling JDKs or manually changing the env, I use Sdkman.io which works like Node version manager if you have used that. It manages your JDKS for you and offers downloads of different versions (Open, Zulu, Graals) and will switch between them with with just a quick command.
I found a nice solution in 3 steps:
check all versions of the JDK path in Environment variables, if there is an outdated path please remove it and keep the latest version of the Java JDK bin path.
after the second step, please uninstall the Netbeans and re-install the latest version.
Netbeans will found the latest JDK path in case it was jdk14 and choose JDK latest version path for NetBeans.
solved
Just install JRE from oracle. Everthing will run fine. I have the same issue

Java swing on eclipse oxygen 4.7.3a?

I am trying to use windowbuilder on eclipse oxygen 4.7.3a on macOS highSierra. it installed fine but every time I try to open the design part it displays this error
Eclipse is running under 0, but this Java project has a 1.8 Java
compliance level, so WindowBuilder will not be able to load classes
from this project. Use a lower level of Java for the project, or run
Eclipse using a newer Java version.
I tried everything. like changing the running enviroment, .jre files, try different JDE. nothing working. any suggestions?
Your only short term solution is to use a Java version <= 9.
Initially WindowBuilder did not work with Java 9 for several reasons. See
Bug 526098 - WindowBuilder fails to work on Java 9.
One of those issues was that the the System Property java.version was unexpectedly just "9":
Please check that you have exactly 9.0 JDK, it worked for me with
9.0.1 until I downgraded target JRE to 9.0, which has unusual System.getProperty("java.version").equals("9")
The fixes to get WindowsBuilder working on Java 9 were only completed on 2/21/18, and based on your error it looks like a similar issue exists when running WindowsBuilder using Java 10. I suggest you create a Bug Report with Eclipse.
See also:
SO Post Eclipse Oxygen Window Builder Error with Java SE 10.0.1 where the solution/workaround was to regress to Java 9.
This Eclipse Forum post where a user is reporting a similar problem to yours.
Uninstall Java Version and Install lower version of Java(8).Support for WindowBuilder is not provided anymore.
How to uninstall current version?(Mac)
Go to /Library/Java/JavaVirtualMachines/ to see current version of java and replace jdk1.8.0_131.jdk with yours.
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf ~/Library/Application\ Support/Oracle/Java
Install Java 8:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Then:
Right click on your project and go to Properties
Make sure your configuration look like this,
At the top of picture Configure Workspace settings click on it (Uncheck project specification settings) and then see image below
Apply same as in picture Then enable "project specification settings"
Restart Your Eclipse
Done!!

Eclipse 3.6 Helios for Ubuntu 10.10 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have ubuntu 10.10 net book edition installed on my dell studio laptop. I downloaded helios for the eclipse site but when I am not able to run it. I have downloaded eclipse 3.5 from synaptic package manager but I am not able to update eclipse 3.5 to eclipse 3.6. Is der any other way to have updated eclipse? Eclipse 3.6 supports HTML 5.
Please let me know, thanks a lot in advance
Try this:
To install eclipse on ubuntu you need to download it first from http://www.eclipse.org/downloads/
Extract the downloaded file by right click on it and extract here or running the following:
tar xzf dir/eclipse-SDK-3.3.1.1-linux-gtk.tar.gz
Where eclipse-SDK-3.3.1.1-linux-gtk is your eclipse-SDK name with version and dir is the directory of eclipse-sdk.
Now move it to the root directory. Apply the following command to do this.
sudo mv dir/eclipse ~
Now you are ready to configure your eclipse. To do this follow the following step by step...
sudo mv eclipse /opt/
Take care of the permissions:
sudo chmod -R +r /opt/eclipse
sudo chmod +x /opt/eclipse/eclipse
Create an executable in your path:
sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudo gedit /usr/bin/eclipse
Copy the following content and save the file:
#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"
$ECLIPSE_HOME/eclipse $*
Let’s also make eclipse executable everywhere by creating a symlink:
sudo ln -s /usr/bin/eclipse /bin/eclipse
Create the menu icon:
sudo gedit /usr/share/applications/eclipse.desktop
Type in this content and save:
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
Run for the first time:
eclipse -clean
You can now start Eclipse by simply typing eclipse in the terminal or from the GNOME menu Applications -> Programming -> Eclipse
At least, you still have the manual install, which leaves your current Eclipse3.5 untouched (allowing you to go back to it if 3.6 gives you too much troubles)
To get your 3.6 download running:
Unzip the download into a directory you have complete control of, usually a directory under your username, preserving folders.
Create a shortcut to the eclipse executable, usually in the resulting "eclipse" folder.
Run the program using the resulting shortcut.
When your new eclipse install starts, point to your existing workspace.
You can continue with both 3.5 and 3.6 installed using the same workspace, or you can remove 3.5 by deselecting it from your software management program (one of several ways).
Alexander Pogrebnyak actually points out in the comment:
workspace cannot round trip 3.5->3.6->3.5.
The usual solution is to keep 3.5 and 3.6 versions of workspace in different directories.
The idea to have one workspace for each version is always the safest route to take, with each of your project imported into each respective workspace.
Note, you have to make sure your java is correctly installed (which should be already good for you, but just in case):
Installing Helios 3.6 on Ubuntu 10.10 is rather simple.
Download eclipse package from eclipse.org and extract it to a folder in your home directory.
The tricky part is setting up java6-jdk from the sun partner repository but there is a easy to follow guide:
basically you have to enable the partner repository, then install java6 jdk with:
sudo apt-get install sun-java6-jre sun-java6-plugin
and then if necessary update your java alternatives with:
# shows a list with available java alternatives:
sudo update-java-alternatives -l
# sets the alternative
sudo update-java-alternatives -s java-6-sun
sudo update-alternatives --config java
The Eclipse version available through the official Ubuntu channels is 3.5 and should not be manually upgraded to 3.6. You probably will not have write permission to do so.
If you must have 3.6 the easiest way is to download the official distribution from eclipse.org, unzip it and run the eclipse binary directly. This also allows you to fully administer it by yourself with upgrades and extra modules.
The Eclipse version available through the official Ubuntu channels is 3.5 and should not be manually upgraded to 3.6. You probably will not have write permission to do so.
There is a PPA available, that should let you upgrade through package management before the packages reach the Ubuntu repos. Sadly, the packages seem broken right now.

Categories

Resources