I read some tutorials about making Eclipse plugins, but every text was just about Java coding. Does it really have to be Java or there is some way to write a plugin in some other JVM language such as Scala or Clojure?
You can use all languages that are based on JVM. You need to simply add a dependency jar (e.g. Scala dependency).
Tested live, so it must work!
Current version of Scala IDE is written in Scala
Related
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?
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.
Given that Scala support is itself a plugin in intellij, is there any way of writing intellij plugins leveraging the existing Scala functionality?
Things like support for parsing Scala, getting an AST, traversing the class/trait hierarchy, etc. should already be a part of the scala plugin, and I was wondering if I could make use of all these niceties from the get-go without having to redo it all myself.
It's possible since Intellij plugins can depend on each other
See e.g. http://plugins.intellij.net/plugin/?idea&pluginId=7080 and http://plugins.intellij.net/plugin/?idea&pluginId=5007
Is there some tool that can analyze a Java program and strip down the Java runtime and the program itself to the essentials only? Can a tool analyze the programs dependencies and create a custom JRE just with the required libraries?
You are looking for ProGuard. They claim it also works on rt.jar from the JRE.
You could try http://proguard.sourceforge.net/. It allows you removed unused classes and methods. This can backfire if you're using things like Class.forName("myclass"), so be sure to test a lot. You could try to run the shrinker against the JVM libraries, but that seems risky.
I developed an application in eclipse that uses many of the classes of the eclipse framework and requires eclipse to run. But now I'm being required to decouple it from eclipse and make it a standalone application. How can I do this?
You might have luck using File / Export... / Java / Runnable Jar File. This will create a standalone .jar file that should be possible to run without Eclipse. You may however need to experiment with the various settings to get it to behave exactly how you want depending on what libraries you are using.
In general however, I'd suggest using a proper build/dependency management tool such as Maven. This will take a bit of time to learn at first, but my experience is that it will make you more productive in the long run....
Start by commenting out the imports for the offending libraries. This will turn red any references to those libraries in your code. Then substitute a different library or refactor your code.
What do you mean by "decouple" it from eclipse? Do you mean you can no longer rely on any of the eclipse libraries, or that you simply don't want it running as a module in the IDE?
If it's the former, you have a lot of rewriting to do.
If it's the latter, then you'll want to basically bundle your module with an "empty" eclipse framework application. This doesn't "unbundle" eclipse, eclipse is still there, but now you don't have any of the IDE modules etc, and instead you have a stand alone ECLIPSE BASED application.
Create a standalone jar file from the Eclipse project as mentioned by Mikera, or you need to re-factor the code such that it doesn't depend on Eclipse libraries.
There is no point in creating a Java application which depends on certain IDEs or platforms. Java code should be independent (which is why it has the power to run on any platform which has JVM installed in it.
Try removing the dependency from your project to the Eclipse libraries. See if you can simulate the same thing using Standard Java libraries. If not, try to create a JAR for your project from Eclipse. If nothing works out, try looking for some 3rd party APIs.