How to import an existing Java project in the Anjuta IDE?

两盒软妹~` 提交于 2019-12-08 06:04:02

问题


I have an existing Java project that I created using Eclipse on a different computer and uploaded to github. On my Fedora machine, I used Anjuta's github plugin to import the project and the import worked fine (I can see all my java files in the Project pane).

However, when I click Run -> Execute I get the following errors:

/home/bhavesh/AnjutaProjects/word_wave.git/deltaHacks/src/deltaHacks/LeapFun.java: line 1: package: command not found
/home/bhavesh/AnjutaProjects/word_wave.git/deltaHacks/src/deltaHacks/LeapFun.java: line 2: import: command not found
/home/bhavesh/AnjutaProjects/word_wave.git/deltaHacks/src/deltaHacks/LeapFun.java: line 3: import: command not found
/home/bhavesh/AnjutaProjects/word_wave.git/deltaHacks/src/deltaHacks/LeapFun.java: line 5: public: command not found
/home/bhavesh/AnjutaProjects/word_wave.git/deltaHacks/src/deltaHacks/LeapFun.java: line 7: syntax error near unexpected token `('
/home/bhavesh/AnjutaProjects/word_wave.git/deltaHacks/src/deltaHacks/LeapFun.java: line 7: `    public static void main(String[] args) {'

It seems that Anjuta doesn't recognize this project as a Java project. What setting should I change to make it recognize the Java?


回答1:


It's not that easy - Eclipse has (maybe hidden) files which contain the dependencies between the modules, and how each file has to be treated. I doubt that anjuta imports that information.

So, it might be necessary to define a project, make the .java files part of that project. Then hit compile.

The fact anjuta is trying to execute a source file, is probably because in the 'run' options, the executable is set to that java file.



来源:https://stackoverflow.com/questions/28617645/how-to-import-an-existing-java-project-in-the-anjuta-ide

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!