User forums > Using Code::Blocks

Java compiler cannot find files

(1/1)

gerardogleza:
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

stahta01:
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.

MortenMacFly:

--- Quote from: stahta01 on April 11, 2022, 08:42:35 pm ---Do you have reason to believe it can compile Java files when using an Compiler that works with Java files?

--- End quote ---
We only support Java files in projects, not compilation explicitly. The reason is quite simple: Often you have c-libs (f)or JNI 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.

MortenMacFly:
...btw: on the frontpage of Code::Blocks one of the first paragraphs is:

--- Quote ---The free C/C++ and Fortran IDE.
--- End quote ---
So I am not sure why people assume it could compile any other than that...

Navigation

[0] Message Index

Go to full version