Can't open file in java-eclipse neon - java

I am just starting off in Java and trying to follow buckythenewboston on you tube. I have java and eclipse neon both downloaded correctly. However, when I create a new project like he showed in the video, I click finish and nothing shows up, in the video it showed on the side there should be a like java symbol with the name of the project I created. Well nothing happens it is blank on my screen. I tried opening a file from the work space in my C drive and that doesn't work either as nothing shows up so I can create a class. I know there is a couple of forum questions with similar title but that is different I think as they can at least get code in where I can't. Any explanation as what is going on would be helpful. I also tried to go to file-import-existing project... but the existing project part isn't an option.
Thanks in advance.

go into your workspace directory and delete .metadata folder, then restart eclipse

Close all perspectives and open a new one, the one you like.

Related

"Workspace Currently in Use" in Eclipse

I normally only use Eclipse just to code in Java for class, but today I decided to use it for my own personal projects. I didn't download anything funky and essentially only used FileWriter, java.util, java.io, and ArrayLists.
Suddenly, after running some code, I was told that Eclipse was no longer responding and had to force quit the program.
Afterward, I couldn't open Eclipse again because the workspace was currently in use.
I've looked up this problem numerous times, and what a lot of people were saying was to end Eclipse through the Task Manager and then go into the metadata file and then delete the .lock file, which I did. However, every time I opened Eclipse again, the program would load up, but there would be no workspace for me to work on. I'd try clicking the icon again, and now the "workspace was currently in use" window would pop up, and I'd go and see that the .lock file had reappeared in the metadata file, again, even though I'd deleted it.
I read somewhere else that another option was to relocate the metadata file, open and close Eclipse, and then overwrite the new metadata file, and it still hasn't worked, considering the .lock file ends up in the metadata again, somehow.
Is there any way I can fix this or am I just better off reinstalling Eclipse?
Thank you for any help, and sorry if this is very simple—I'm still very new to all this!

Multiple persistent errors IntelliJ

I run IntelliJ IDEA version 2019.2.3 on a Windows 10. We use the same version at school. It works there, but not on my home laptop. I've set the environment and CMD shows the correct path of Java. The JDK 1.8 is also properly installed. Please , what could the problem be ?
I want to thank everyone for taking the time to give a helping hand !
The answers I received via Support at Jet Brains crashed the app or made it unusable. The FAQ links they provide is a collection of vague workarounds. And, especially for someone that is a total beginner and has no guidance in editing non-destructively, it won't work.
I would also like to post the only solution that worked on the Cyrillic issue with IntelliJ Idea, since I know other people have had it as well and I hope it will be useful for others in the future. This came from my teacher at Link Academy Bucharest, Mr. Bogdan Posa.
The actual thing that needs to be modified is the existent file called idea.properties, found in the BIN folder within the Idea installation folder. This only worked after I had re-installed Idea in a different place than "C:/Users/Cyrillic username/" which Idea was picking by default to install itself. So it will be something like C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2019.2.3/bin. The idea.properties file can also be opened with Notepad to avoid crashing Idea (happened many times). Within the text editor, find and edit the value of idea.config.path, removing the comment and writing the new location/path of the Idea installation folder. Windows might not allow you to save the edited idea.properties file in that original location and it might ask if you want to save it in the Documents folder instead. Just say yes, save it there and then copy/paste it back to the Bin folder, it will accept it. After this, you will have to open Idea with "right-click open as Administrator". Apparently, as long as there still is a path containing Cyrillics in a username, Idea will not run your project so if you can't avoid it, just play along and Run as Admin when opening Idea. That's how it NOW WORKS for me, after several re-installing and changing properties, environments and every damn thing. I was close to hugging ECLIPSE.... :) Hope this helps, Cyrillic users !
No, not at all. This is a kind of wird exception.
You can change the config location of intelliJ.,
This can be done in:
IntelliJ Menu: Help | Edit Custom Properties…
Then it will create a file under: IDE_HOME\bin\idea.properties
Example of the configs:
idea.config.path=c:/work/idea/config
idea.system.path=c:/work/idea/system
idea.plugins.path=c:/work/idea/plugins
More info:
https://intellij-support.jetbrains.com/hc/en-us/articles/207240985-Changing-IDE-default-directories-used-for-config-plugins-and-caches-storage

Intellij IDEA "Decompiled.class file, bytecodeversion:52.0 (Java 8

I'm new to Java, I started to use it a year ago.
I was using IntelliJ IDEA Community Edition, but I decided to install the full version of it, and then something went wrong. It always stays in kind of "Decompiled" mode and does not allow to edit file or work with it. I reverted back to the Community Edition, but the problem did not disappear.
Can you please help me how to get to normal mode to work? Any help is appreciated.
It looks like you're opening the class files within the left hand navigation window. Find the source code instead (the .java files) and open those instead - then everything should be normal.
(Look at home05\Solution.java for example, instead of home05\Solution.class...)
Please look at the "src" folder and not the "out" folder. The out folder in intellij shows the decompile version of the code.
In Intellij you need src, not out.
Example is here

Can't get R.java back in eclipse

I have a massive problem, and I can't find a single thread out there that specifies this problem.
I'd been watching Google IO, and the Android Studio was mentioned, I downloaded it, installed it, and opened my project into there, as I wanted to try out some of the new features, Fine and dandy, (on a separate note, I love Android Studio)
It was working before in Eclipse, and I literally changed nothing about my project, I was only looking around at the device preview features and stuff, didn't touch any piece of code what so ever, just having a look at some of the features..
Went back to eclipse, and my generated folder only showed R in, no tree structure of R or anything, just R.java, and R inside it, and everything in my classes were underlined, but it wasn't the R that was, it was the value after it (ie. Cannot find R.layout.main) which I thought was really weird, so I cleaned my project, and it disappeared, I now have a project without a generated R.java file.
To note; I changed nothing about my project, all my XML files were absolutely fine, i've tried every trick I can find on StackOverFlow and other websites (removing some of the XML's, painstakingly going over my 15 layout files character by character for an hour, removing imports, build paths, etc) and nothing works, and i've been trying to do this for almost 3 hours now.. Does anyone have any experience doing this, or any solution?
in the Gen section of your project, try to delete the R.java
It should re-generate, I had some issues like that in the past..
Give it go.
The R file may not be generated due to errors in the project.
Check your xml files in res folder. Also read Error log of the eclipse.
(Windows -> Show View -> Problems)
The best way is copy R.java from another project and Past it in gen
And then Delete R.java file then the system will recreate R.java back for you..........

Executable jar file won't run after doing some updates

I am working on Java project (A terraria like sandbox game) and I have come across something that I just don't understand. I have been exporting the project as .jar's as I go along to upload and share with my friends, but the last time I did this, the .jar won't run, but when I run it in eclipse, it runs fine. When I try to run the jar all it does is lose focus on the explorer window for a split second, then goes back. I have tried many things, like changing the main class, changing the META, and moving the files to specific packages, but nothing is working.
The project is 9 classes, so I won't paste all the code for it here, but the latest, non-working source code can be found here (http://www.mediafire.com/?fiw6wq73j7cff4t), the non-working jar here (http://www.mediafire.com/?bhjo162oh3hi2j9), and the working jar here (http://www.mediafire.com/?h918s8xpyxw4psr). If someone with more experience in java could please take a look at this it would be much appreciated.
One of the things I tried was not adding the JPanel (the game), and just leaving the splash screen, and the jar worked. This shows that it must be a problem in the coding somewhere.
Thanks for the time,
I.D.
Couldn't find message comes from your ReadMap class. So check which circumstance leads to this error. Most likely you did not add all classes or other files to your JAR, so file is not found. Check that all needed files are added to exported JAR in Eclipse export dialog. It's also a good idea to provide more debugging info (stacktrace is ok), especially when you are studying. BTW, cool game :)

Categories