Java perspective is not visible in eclipse - java

I installed eclipse on a new unubtu install, via the package manager. I have Galileo. I copied my home directory from an older machine, and tried to open that workspace. Now I dont see any java perspective.
(Possibly, all the info above is not relevant, but I just wanted to add any possible info, as this a clean install of Eclipse via package manager, so I cant think of any other non standard thing I might have done.)

What happens if you go to Window > Open Perspective > Other...? Don't you see Java listed there?
If not, I don't think the problem is related to the workspace from your previous configuration. But maybe you did copy a ~/.eclipse directory from your old machine and this one may cause problems. Try to rename it as ~/.eclipse.save for example and restart Eclipse to see if it helps.

Not sure if you mean you already checked in the usual places for perspectives, or if Java Perspective didn't show up by default...
Java perspective should be available under the "Open Perspective" icon in the top right, or by going to Window -> Open Perspective -> Java.
I don't use the Ubuntu-packaged Eclipse, though...

If you do not have a Java perspective even in "Other", you have downloaded one of the Eclipse versions intended for something else than Java. Do it again, but be certain to get the Java or the Java EE version.
Note that Eclipse IS available in the Ubuntu software repository, but it is the version which was current when that version of Ubuntu came out. For the 9.04 I use it is Eclipse 3.4 and I need 3.5, hence I downloaded it myself.

Yes, without perspective you will never be able to see an Eclipse from the viewpoint of Galileo.
The sun's radius (695,500 km) and its distance (149,000,000 km)
The moon's radius (1,737.4 km) and its distance (384,403 km)
You will need to do a "perspective divide". So the perspective radii are:
Sun: 0.00467
Moon: 0.00452
Thanks to this divide, the moon is almost big enough to block out the entire sun.
So, yes, Perspective is needed to show the Eclipse.

Related

How do I switch Eclipse from Java to C/C++?

I used Eclipse Java last year for a class, and this year I have another class that's requiring us to use Eclipse C. I tried installing the Eclipse C/C++ packages, but when I write in Eclipse it stays in Java. Please help!!!
Also, I don't really want to uninstall Eclipse if I don't have to, because I'm still actively working on projects.
You've basically downloaded 2 "modes" in Eclipse: Java mode, and C/C++ mode. If you type and it assumes it's Java, that's because the project you created is in "Java mode".
First, just quit out of the app and open it again. Maybe the update only enacts when the app is refreshed.
Now go File > New. If it's installed correctly, when you hover over "New", there should be the option "C/C++ Project". If there isn't, double check that you downloaded the correct extension. (Note that I'm on a Mac so the layout might be slightly different for you, but it's the same idea).

Visual Studio Code - Java - Import Errors and More

Just starting working on an existing project at work and wanted to use Visual Studio Code as my IDE (I have used it for a recent Rails project and loved it, so wanted to try with Java).
However, whenever I try to open one of the projects I receive a ton of different errors including:
When importing java.io, java.util, or anything similar, the error:
"The import of java.io (or java.util) cannot be resolved"
Existing classes have an error:
"The implicit super constructor is undefined for default constructor. Must define explicit constructor"
Other random "cannot resolve to a type" errors.
All of these seem to stem from some sort of setting error I have with VS Code but can seem to find what it is. I have already uninstalled and reinstalled the RedHat plug-in that enables the Java language for VS Code.
I have tried setting the java_home setting in the extension to the direct location of the install but that didn't work. Tried uninstalling and reinstalling java and that also didn't work.
My operating specs are as follows:
OS: macOS Sierra
VS Code version 1.15.1
JDK version 1.8.0.144
Any idea on what may be causing this? Do you think it may be an error in how I have VS Code set up or if it's an error (or rather incompatibility) with how the existing project is set up?
I ran into a similar issue. The solution was to remove everything from VS Code's workspace storage directory, which was located at $HOME/Library/Application Support/Code/User/workspaceStorage/.
I found this solution here: https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#clean-the-workspace-directory
Update: This can now be done from within VS Code as of Language Support for Java(TM) by Red Hat Version 0.33.0. Open the command palette and type "java clean" (see official description in link).
As already mentioned previously, you require to clean the project, but that is a bit difficult thing because every folder is a Guid, and you do not know which one to clear, thus requiring you to delete everything. Starting with 0.33.0 version of the plugin you can automatically do that from within the IDE as well, use CTRL + Shift + P and type, java clean, and IDE will show you the suggestion tip for, Java: Clean the Java language server workspace. Upon selection, agree and restart the IDE. It will clean the language server workspace for you.
Another approach can be, the Maven tools within the IDE. If you have this plugin installed, you can use the side bar and utilize the Maven project helper options to perform actions like, clean, install, and package etc. For example, here is the project I am having and the options this shows,
That can be used, graphically, to manage your Maven-based projects. Also, this would work with the Java Extension Pack, not sure yet as to how it would behave with other extensions.
For me: CMD + Shift + P
Then type "Java: Clean Java language Server Workspace"
Note: This will reload/restart vscode as well.
Update:
This appears to not fix it anymore for me. In my case I am using a gradle project, and needed to set the rootProject.name in the settings.gradle to be the same as the folder name that the project is in.
I faced this issue after creating a whole Java project in one computer and then trying to run it on another computer.
After doing everything said in the other answers, what really made VS Code compile was to open each single project java file in VS Code and save it (a simple Ctrl + S). Maybe there is a simpler way of doing it, but that is what worked for me and I hope this helps anyone stuck in this issue.
Press ctrl+shift+p
then search 'java clean' and click 'java: clean java language server workspace' then click restart IDE.
I found another simple trick at least to get rid of "cannot be resolved to a type" errors which were coming from older workspaces and wrong project files I guess?. I just ran an empty main(), with the body commented out, while still keeping my local package / import commands at the start - no errors. After commenting in again, the project compiled without errors. Perhaps this refreshing effect might also help in this context?
I had to clean this folder to get it working on Windows
%APPDATA%\code\Local Storage

Other Java Proposals Missing From Eclipse

The "other java proposals" that allows you to use the Ctrl+Space shortcut is missing from my Kempler install. I have redownloaded and reinstalled fresh from Eclipse and still do not have access to the shortcut from "other java proposals".
When searching here it's been suggested it should be checked in the advanced section of the editor preferences for Java. I can't find anything about how to enable to disable it here or in the Eclipse help files so I thought I would ask.
Thanks,
Omega
Kepler doesn't have "Other java proposals" but just Java Proposals.
This option (or Java Proposals (Task-Focused)) is sometimes left unchecked when importing the project to Kepler from a workspace on an older version of eclipse. Hence, your problem might be with workspace than the eclipse dist you are using.
I just thought I would "answer" this question incase someone else had the same problem.
It turns out that Synergy+ uses the same keystroke to lock screens. Even when it's closed, and the service is still running it holds on to key binds.
So, how I fixed it was to go through task manager and kill processes one at a time until I was able to use the shortcut, then went in to Synergy and changed the keybind.

Why does Eclipse showing errors when I load my workspace on a different computer?

I have the Eclipse compiler saved and booting from my portable HDD as well as it's workspace. I was working on my assignment at school and had to leave. I saved my work and checked to make sure it was on the drive. It was so I disconnected the drive and left. Now that I'm home, I load my workspace and it has errors everywhere. Even the import codes are showing errors.
Does anyone know or have an idea as to what's going on and how to fix it? Everything is loading and running from the portable HDD so the actual computer shouldn't have anything to do with it. The assignment is due soon and I need to have this fixed asap.
Thanks in advance for any assistance.
Could the drive be registering with different labels on the different computers (eg G: on one and H: on the other)? Maybe there are some hard coded paths that are causing you problems.
Possible cases
JDK/JRE paths in both machines do not match.Go to Windows -> Preferences -> Java -> Installed JREs. Check if the JDK/JRE location is same as your installation path.
Path for external jars added to your build path do not match. Right click on your Project ->Properties -> Java Build Path -> Libraries.Check jar locations.
Perhaps you have a different JDK? I know that I have issues when switching between my Mac 10.5 desktop (Java 1.5) and Mac 10.6 laptop (Java 1.6) unless I explicitly tell Eclipse to use a certain JDK via the "Installed JREs" pref
Depends on what kind of project you are doing! Check for any hard coded paths, the imports that you could have made in your projects. See where u need to reset the path where you have made the imports.
Here are the some steps If you want to move your project to one PC to other, hope this help.
When you are copy to Pen drive or Hard drive follow these steps
Open Eclipse and switch to Workspace1 using
Switch To Workspace...
Check the projects in Workspace1
Switch to another workspace to make sure that Workspace1
is closed completely by Eclipse (Critical step!)
Quit Eclipse
Copy Workspace1 and name the copy Workspace2
Copy Workspace2 to a USB flash drive
Copy Workspace2 from the USB flash drive onto the hard disk
of a different computer
Open Eclipse on the new computer
Switch to Workspace2 using Switch To Workspace...
The projects open normally from Eclipse on any machine as though
that workspace had been there all along. The critical step seems
to be switching to another workspace before quitting Eclipse. If
you skip that step the copied and transferred workspace does not
open correctly.

Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files

I'm a Java noob (but have been programming for 25+ years, and have worked with OO languages from day 1).
All of a sudden I started getting this error:
Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files.
Not sure what caused this condition, and not sure what Java's asking me to do. I'm working in the NetBeans IDE. The last thing I attempted to do is add some binary (image) resources to my project.
In my case the JDK setup in Netbeans was fine. It was just one of those strange Netbeans issues that come out of nowhere.
My fix was:
Clear the Netbeans Cache i.e. delete the folder:
C:\Users\\AppData\Local\NetBeans\Cache\
It means you haven't told netbeans where your Java 1.6 installation is. Go into settings, add the JDK (JDK->Add->New), and select the directory above 'bin' for your JDK16.
This error can occur at two scenarios:
Right click your netbean project -> Properties -> Libraries
After select Libraries , right panel on top you can see "Java Platform" combo box. This Jave Platform is missing for your project. You need to add using Manage Platforms bottom beside Jave Platform combo box.
Even thought scenario (1) is correct it can happen. Because your project has reference to another netbean project in your Libraries. This reference project is missing Jave Platform.
I have Linux in my office and Mac in Home and this problem is frequently when I share projects in github, I solve it removing the build directory and doing clean and build.
Right click on project - Properties - Libraries - Select the correct jdk version from the Java Platform combobox.
NetBeans bug
If your project depends on other projects, open and clean build all of them(that fixed it for me).
Most likely cache-related stuff. Clean up NB cache as suggested by someone before
You should remove the files under private folder in the nbproperties folders.
for me any recommended way early didn't helped, but changing in project Properties -> Source/Binary format to JDK 7, Save than change back to JDK 8 fixed this error

Categories