1

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?

Bee Kay
  • 166
  • 7
  • It looks like Anjuta does not understand that your project is a Java project. Why don't you just use Eclipse on your Fedora machine? Eclipse is available for Linux as well as Windows and OS X and it's free. – Jesper Feb 19 '15 at 21:54
  • 1
    I understand that Eclipse is the best option in this scenario because I started the original project in Eclipse, but how would I add an existing Java project to Anjuta in general? – Bee Kay Feb 23 '15 at 18:39
  • I have related problem for a [Anjuta JavaScript project](http://stackoverflow.com/questions/30143764/anjuta-configuration-for-gnome-javascript-application-development). Do you solved your problem? – BuZZ-dEE May 09 '15 at 21:54

1 Answers1

0

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.

jcoppens
  • 5,306
  • 6
  • 27
  • 47