Author Topic: Java compiler cannot find files  (Read 2722 times)

gerardogleza

  • Guest
Java compiler cannot find files
« 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Java compiler cannot find files
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Java compiler cannot find files
« Reply #2 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 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Java compiler cannot find files
« Reply #3 on: April 13, 2022, 11:16:07 pm »
...btw: on the frontpage of Code::Blocks 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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ