Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: gerardogleza on April 11, 2022, 11:29:31 am

Title: Java compiler cannot find files
Post by: gerardogleza on April 11, 2022, 11:29:31 am
Hi,

I am new in the forum but I have been using Code::Blocks sparcely (mainly in Linux). Now using Windows 10 Home, at my home laptop, with the las version of the IDE, I have created a Java project, edited the Main.java file and when compiling I got this:  :( :o

||=== Build: Debug in Life_GDP (compiler: GNU GCC Compiler) ===|
||warning: C:\Users\gerardo\Programming\LearningSwingJava\Life_GDP\Main.java: linker input file unused because linking not done|
 obj\Debug\Main.o||No such file or directory|
||error: no input files|
||=== Build failed: 2 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|

Any suggestion?

Thanks,

Gerardo
Title: Re: Java compiler cannot find files
Post by: stahta01 on April 11, 2022, 08:42:35 pm
I got the same error because my GCC Compiler does not support compiling Java files.
I was surprised that Code::Blocks does anything other than being a Text Editor for Java files.
Do you have reason to believe it can compile Java files when using an Compiler that works with Java files?

Tim S.
Title: Re: Java compiler cannot find files
Post by: MortenMacFly on April 13, 2022, 11:14:02 pm
Do you have reason to believe it can compile Java files when using an Compiler that works with Java files?
We only support Java files in projects, not compilation explicitly. The reason is quite simple: Often you have c-libs (f)or JNI (https://en.wikipedia.org/wiki/Java_Native_Interface) for low-level function in Java projects. By supporting Java files and syntax high-lighting you can search for code-snippets you may need when actually working on a support C-project. I find this very useful and use it quite often.

But sure: You should not try to compile a Java project. I set the target style to "commands only" in that case so the respective target is just skipped during compilation.
Title: Re: Java compiler cannot find files
Post by: MortenMacFly on April 13, 2022, 11:16:07 pm
...btw: on the frontpage of Code::Blocks (https://www.codeblocks.org/) one of the first paragraphs is:
Quote
The free C/C++ and Fortran IDE.
So I am not sure why people assume it could compile any other than that...