Unusual problem in the Eclipse

Asked

Viewed 145 times

0

Guys I’m starting in the Java programming language, but is giving an unusual error, the lines of code are right but I can not solve, I’ve configured the environment variables (I do not know what this is) by youtube, and it seems that had a progress but still gives the same error, see the code below:

inserir a descrição da imagem aqui

  • You can try using Netbeans, it is easy to install and will probably work first. https://netbeans.apache.org/download/nb110/nb110.html

  • 1

    At first glance seems to be missing the file Teste.java (Ctrl + S).

  • @Piovezan when executing the code, usually Eclipse already saves the file. But it can be just that.

  • @yurishimoki When it runs it usually asks if it wants to save unsaved files, but since they are code writing time errors, it might not have run yet. Although the description of red error at the bottom may have been an attempt to execute.

1 answer

0

Try to put it in the file eclipse.ini (will probably be in the Eclipse installation directory) the following line just before the sentence -vmargs:

-vm %JAVA_HOME%\bin\javaw.exe

If it doesn’t work, instead of javaw.exe try java.exe.

Another error may be the environment variables. See my answer to this question: What are the Java-related OS variables for?.

Note: Open the file eclipse.ini with the notepad (Notepad), and if it is separated into lines, put in a new line -vm and on the other line the rest.

If command javac does not work then the error is somewhere related to Java, not Eclipse. Most likely the environment variables. If possible please edit the question showing what happens when typing java --version and javac --version.

  • Guy unfortunately did not work, I entered his link on the environment variables, I made some modifications but it did not work, the funny thing is that when I write this project from another: "editor error does not contain a main type". I also entered the eclipesis.ini and put the line you speak, but the error persists, I do not know what to do, I need the eclipse can not be another IDE :(

  • Maybe your file is outside the folder src that Eclipse uses as reference to execute the code

  • If not, then you could edit the question and show how your folder is organized Teste? And also talk warning lamps with an X show?

  • And just one more thing in case it’s not the folder problem src. Open the menu Iniciar windows and write cmd, with this open it (it is basically a notebook with black background) and type java --version, if running and showing the Java version, type javac --version. Let me know if you show anything other than the Java version

  • Yes I know the cmd, it gave a strange error, after typing java --version (it does not accept javac) in the line below it says that it could not create a virtual machine that the eclipse uses

Browser other questions tagged

You are not signed in. Login or sign up in order to post.