[Geany-Users] Java in Geany - Fully Qualified Classname

Lex Trotman elextr at xxxxx
Wed Nov 7 20:05:55 UTC 2018

On Thu, 8 Nov 2018 at 06:00, es noyo <esnoyo at contactoffice.com> wrote:
> How do I get Geany to automatically pick up the fully qualified classname from the java project that I'm working on in order to run the project?
> I'm trying to import some java applications I had previously written elsewhere (Windows + Eclipse, though I've only imported the java files, not attempting to import projects).  I've been looking at https://wiki.geany.org/howtos/configurebuildmenu but can't seem to get the settings right.
> So far I've worked out how to get javac up and running. I'm using this entry in the build menu:
> Command field:   javac "%f" -d /home/me/Documents/Java/Classes -cp /home/me/Documents/Java/Classes
> so that it finds source files and leaves classfiles in the structure below:
>    /home/me/Documents/Java/Source/ProjectA
>    /home/me/Documents/Java/Source/Utilities/etc/etc
>    /home/me/Documents/Java/Classes/....
> As I said, this looks like it is working ok.
> The problem is what command string to use in the execute part of the build menu. I've tried:
> Command field:   java -classpath /home/me/Documents/Java/Classes "%e"
> Working directory field:   /home/me/Documents/Java/Classes
> However I'm getting the error: "Error: Could not find or load main class".
> Clearly I can see that it doesn't have the right form of classname in it. I know the java command is supposed to use the Fully Qualified Classname of the form "java com.example.ProjectA".  Obviously I want it to pick this up automatically from the project. How do I do this?

Geany works on filenames, it doesn't know about Java specific stuff
like classnames (or any other language specific stuff either).  So you
will either have to do some shell smarts to extract the classname or
hard code it in a project specific run command.


> Thanks for any clues
> Duncan
> --
> Professional Virtual Office
> https://www.contactoffice.com
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users

More information about the Users mailing list