Can cmake do an incremental java build - java

I work on a project which has a large C++ code base, and a large Java code base. We are in the process of migrating the C++ build to CMake, which should help us address our build issues on the C++ side.
On the java side we have the problem that our build is not incremental, which has become a major resource suck. I understand that Gradle, Ant and Maven are capable of running incremental Java builds. But since we are already using CMake on the C++ side, I'd like to know if it is possile and reasonably easy to set CMake up to build our Java code incrementally.
To make a well formed question out of this:
Is it possible to perform an incremental java build with CMake?
If possible: How, and what are the pitfalls?

Related

How to compile Java to WASM (WebAssembly)?

I wonder can I use Java and compile it to WASM (WebAssembly)?
The list https://webassembly.org/getting-started/developers-guide/ has no Java, Kotlin
GraalVM WASM project https://www.graalvm.org/reference-manual/wasm/ is for running wasm inside JVM, not for running Java projects within WebAssembly.
Here are a few compilers that can do this for you:
https://github.com/konsoletyper/teavm (most popular & my own reccomendation: https://teavm.org/)
https://github.com/i-net-software/JWebAssembly (only to webassembly, the others can do webassembly and javascript)
https://github.com/mirkosertic/Bytecoder
https://github.com/leaningtech/cheerpj-meta
Do note, that all of them have their limitations, most commonly that every Java class in Java's standard library won't work well with it (for example, TeaVM and others have problems with reflection).
They also require pipeline integration -- make sure to be using a build tool these compilers support, such as gradle or maven

Is it possible to add custom build tool to IntelliJ IDEA?

I'm currently working on some projects using the Eta programming language.
It is a new purely functional programming language that runs on the JVM. Because of this, sometimes it requires to write Java code to make wrappers.
Currently, I'm working using Emacs, but for Java, I think that IntelliJ is the best IDE out there.
The thing is, Eta relies on a custom build tool, called Etlas. And although there are plugins for SBT and Gradle, Etlas works the best for Eta.
Etlas handles maven dependencies itself. Is there a way of adding this build tool to IntelliJ so it can see where the dependencies were downloaded and one can use the Java autocompletion when working on Java code?

ImageJ no error messages for plugin development

I'm using ImageJ for image processing for a class, and I've been creating small plugins for a few weeks. It's been frustrating for me because I never saw any java error messages, such as syntax error on line 3 blah blah. When my plugins don't compile (due to some compile time error), all I see is "class not found", or if a plugin had compiled in the past and there is a class file available it will run the old compiled version and not give me any error.
I thought this was normal until I met up with my friend and he had been getting error messages the whole time.
Any idea why this is? I'm using windows (tried on windows 10, 8, and 7), he's using some osx distribution (most likely the latest). I've tried all available versions of ImageJ from the website, so I don't think it's a version issue. Is this the norm on windows for some reason?
I suspect you are using ImageJ 1.x, e.g. downloaded from here? And trying to compile via Plugins>Compile and Run...?
In general, I would recommend developing Java code in Eclipse - as having a proper IDE is vastly more powerful than what you can get in ImageJ.
If all you need to do is write simple Macros calling existing ImageJ functions then writing them in the various non-Java scripting languages within ImageJ is perfectly sufficient.
If you decide Eclipse isn't your thing and you want to continue developing within ImageJ, I would strongly recommend using the Fiji distribution of ImageJ - as it includes a robust script editor.
If you use this editor to write Java code, it will save your scripts to disk as .java files and then call the Java compiler (javac) on them, which will give you a more complete picture of any compilation problems.

MakeFile for Java?

I've looked at several questions and read through a couple of tutorials but MakeFile is still a bit of a confusing concept to me.
From what I understand, it is essentially a set of rules for building up Unix commands to compile and run the code?
So far, I have been just running my Unix commands as such:
>> javac Main.java SomeClass1.java SomeClass2.java
>> java Main input_file.txt
because my Main function takes in an input_file.
I want to be able to make this more efficient by using Make, but I am having trouble with understanding the concepts.
Any help is much appreciated!
Thank you!
Make is a build tool - a piece of software to compile the source code of software projects into an executable.
When you are creating small, simple programs, you don't really need a build tool. You can just compile your code by running the compiler javac on the command line. But when you start working on a larger project with many source files, it's going to be too cumbersome to compile all the source files by hand. You'll want to use a build tool. Besides compiling your code, a build tool can help you perform other tasks, such as automatically running unit tests and automatically managing dependencies (libraries that your program needs).
For a Java project, consider using a Java build tool such as Apache Ant, Apache Maven or Gradle. Those are the de-facto standard build tools for Java projects, and the big Java IDEs (Eclipse, IntelliJ and NetBeans) have support for these tools.
Make is mainly used for C and C++ projects and is not very well suited for Java.

IDE, Framework, code manager tool, thing that supports Java and C++ in one Project

I have inherited someone else's code. He used CMake to build the fragments for C++ and the fragments for Java/Android. I cannot believe that he would have used Notepad and Windows Explorer to manage his package/class structure and implementation. Is there a code manager tool or IDE that allows you to put your Java code in one package and your C++ in another package? The CMake scripts would build the projects separately, of course.
CMake is just a build tool.
You can use any IDE you like to write the code and then use a different tool to build it.
Eclipse supports both Java and C++, but I wouldn't recommend it for either.

Categories

Resources