This question already has answers here:
Problem with IntelliJ -> Cannot create class with name "Main"
(2 answers)
Closed 2 years ago.
I cannot create java class file with name TokenProperties.java. I also tried restart and clean cache but doesn't help. Class with different name I can crate.
Here is error pop-up.
File will added but marked as plain text file, and no java file.
Do you have idea whats is going on? Thank you.
It kind of looks like you create a TXT file with the name TokenProperties.java when you want to create a JAVA file with the name TokenProperties similar to how DemoAAplication was created.
Right click com.example.demoa package.
Select New
Select Java Class
I wasn't able to fix it so I reinstalled Intellij and now it works.
Related
This question already has answers here:
Why do my java files look strange in Eclipse?
(5 answers)
Closed 1 year ago.
I have two class .java but in pdcController.java I cannot do anything:
Look the image:
Look the icon are different in BandoService works all, but in .pdfController I cannot do anything (for example I cannot suggest for method or error import). pdfController and BandoServiceare in the same project.
This is not the source file, check the file path, you're probably not in the correct package.
I guess you have several modules in your maven project and you opened the file from the parent module.
If you see the file only in the parent module it's time to git fetch.
This question already has answers here:
Error: Selection does not contain a main type
(24 answers)
Closed 4 years ago.
I'm a bit new in Java aka. IDE
As you can see, there is a Main Method, but it still does not accept it. I tried to rightclick the .java class and run, but still did not work
Thanks!
Right Click project-->Properties-->Java Build Path in source tab add your project src
This question already has answers here:
How to create a folder in Java?
(8 answers)
Closed 6 years ago.
I would like to write a Java Programm which should be able to create a Folder in Windows, but the Client should be a able to decide on the Name of the Folder. How can I do that?
Thanks for any suggestions!
A small google search would have given you the answer. If you want to name it a specific way, just grab the name from a JTextField or something like that.
Create a File object and use mkdir() to create a new folder.
File folder;
folder = new File("path/to/new/folder");
folder.mkdir();
Obviously you will need to check if the folder already exists and you will need to use an inputted string for the name of the folder.
This question already has answers here:
How to run a JAR file
(12 answers)
Closed 6 years ago.
I downloaded this file from a website ! The problem is that I have no knowledge of java :p ! ( I cannot execute that file )
Here's the file:
Atome.jar
When I double click, nothing happens !!
Please guys help me !
This jar was not created to be executed with a simple double-click but probably to be used in a program. In fact, in the Manifest file which is in the jar, there are no Main class defined and none of the class files in the jar is the Main class (I tried with the 3 principal classes)
So, this jar is probably just a library that should be used by a developer
This question already has answers here:
Programmatically list open projects in an eclipse workspace from outside of eclipse
(2 answers)
Closed 6 years ago.
I need a way to get the directory path of an eclipse project by deserializining the .location file found in the eclipe workspace at:
.metadata\.plugins\org.eclipse.core.resources.projects\myproject\.location
Its contents look something like:
#±‹#¼ %–磓¾ URI//file:/D:/proj/myproject ÀXûó#¼ QóŒ{»wÆ
so I would like to programmatically get the "D:/proj/myproject" string out of it.
Bonus points if the process doesn't use the Eclipse API.
Eclipse read this file in the method LocalMetaArea.readPrivateDescription(..).
It uses a SafeChunkyInputStream and DataInputStream for reading it.
It contains UTF8 strings and some integers.
For the complete code see
org.eclipse.core.internal.resources.LocalMetaArea at GrepCode.com