Create account / Log in

About IDEs

Discussion area for the development team.

Moderators: uckelman, Tim M

About IDEs

Postby Flint1b » July 22nd, 2020, 1:35 am

I know all about developers and their favorite tools, about these tools' hotkeys being in the muscle memory, but I have to try this, especially after the latest Eclipse+Maven escapade.

Eclipse users, please consider trying out an alternative, just so you have something to compare Eclipse to. Try IntelliJ for a week or so, you can still go back to Eclipse after that and keep using it for years to come.

One of the biggest problems with Eclipse is that it's trying to be smart and do things it's own way, it uses it's own compiler (called "eclipsec", yes it doesn't use javac internally, did you know that?), it builds the project automatically and reports errors, this might seem convenient at first but in reality all this is done entirely different from how the build server compiles the code and also from how Joel builds the releases at the end of the day.

The Maven integration in Eclipse is notoriously bad and has been like this for over a decade, the Eclipse platform itself is built on OSGi which is a very different way of managing dependencies, and the Eclipse people don't have much incentive to get Maven to run smoothly.

IntelliJ on the other hand uses the regular javac, it doesn't automatically build the project, it doesn't even have a dedicated "problems" view that is automatically filled with "problems". It can build the project on request and will report problems in the build log. Overall it is much closer to what happens later on on the CI server and during the release build.

The performance of IntelliJ is better due to this "Eclipse being smart" thing, IntelliJ doesn't try to be smart and due to that doesn't need as many resources, it only wants to be a good code editor, while leaving the build to the regular tools like maven and javac.

One other problem with Eclipse is that it is essentially a platform for developing desktop applications, and the "Eclipse Java IDE" is an application on top of that platform, every time you run it you run the platform plus the application, which is more expensive resource-wise than running the "pure" application that IntelliJ is.
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: About IDEs

Postby Brent Easton » July 22nd, 2020, 1:54 am

As I mentioned before, I am happy to try Intellij, however, my first attempt took too long to get things working between my different, but dependent projects. I have since converted my main projects to maven projects and am working on getting the proper Vassal dependency working (which I think I have), so it should make it easier for me to migrate. I will try again.
User avatar
Brent Easton
 
Posts: 3226
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: About IDEs

Postby Martinov » July 22nd, 2020, 6:08 am

I'm a big fan of NetBeans myself. It works great, except when it doesn't.
User avatar
Martinov
 
Posts: 53
Joined: March 30th, 2020, 10:58 am

Re: About IDEs

Postby Flint1b » July 22nd, 2020, 11:00 am

Martinov wrote:I'm a big fan of NetBeans myself. It works great, except when it doesn't.


If you want to elaborate, feel free to suggest NetBeans, I just know it's the third big player in the field but don't have any experience. How does it run in general and compared to Eclipse in particular, how much % of the development time does it steal when it breaks, is it as bad as Eclipse or as good as IntelliJ? How is Maven support? How is it's Git client?

How good is it at teaching you the new Java features?

I haven't read a single article or book about new Java features since Java 8, all I know about lambdas and stream API I got taught by IntelliJ, it just suggests to replace old-style code with new style, I did that, then compared old to new and learned the new features that way :D
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: About IDEs

Postby Brent Easton » July 22nd, 2020, 11:06 am

I have got vassal and my subsidiary projects working nicely under IntelliJ with just one problem. I was able to build vassal and install it into my local maven repository and added a dependency to my other projects and all worked fine.

The strange this is that even though I was able to successfully build vassal using a Maven run config doing a clean install, all references to several libraries including wizard, slf4j and apache-commons in vassal-app are reporting as 'Cannot be found' or 'package does not exist' errors.

Other than, you're right, it's pretty nifty!
User avatar
Brent Easton
 
Posts: 3226
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: About IDEs

Postby Brent Easton » July 22nd, 2020, 11:12 am

Sorry, that wasn't clear. The Maven build runs successfully with no errors. The in-built build is showing errors.
Attachments
Capture.PNG
Capture.PNG (30.76 KiB) Viewed 2289 times
User avatar
Brent Easton
 
Posts: 3226
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: About IDEs

Postby Flint1b » July 22nd, 2020, 11:45 am

Does the project structure look something like this, after you tell it to reimport the structure from maven e.g. by clicking this circle-arrow button, the one I put a red circle around?

intellij-example-1.png
intellij-example-1.png (180.21 KiB) Viewed 2288 times


And does the build path of vassal-app look like this?

intellij-example-2.png
intellij-example-2.png (91.95 KiB) Viewed 2288 times


Alternatively, you can turn off the internal build entirely and delegate all build actions to Maven, in the Settings (ctrl+alt+s), in the search field at the top left, search for "delegate maven".
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: About IDEs

Postby Brent Easton » July 22nd, 2020, 12:06 pm

Ok, the reimport structure seems to have fixed that.

My last problem is that in my subsidiary project for a module, when I click on a Vassal class and ask to go to the Declaration, it is decompiling the Vassal.jar I installed in the local repository. How do I set it up to reference the actual source, or export the source of the vassal module to the local repository for use by my subsidiary projects?

Thanks.
User avatar
Brent Easton
 
Posts: 3226
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: About IDEs

Postby Flint1b » July 22nd, 2020, 1:10 pm

Brent Easton wrote:Ok, the reimport structure seems to have fixed that.

My last problem is that in my subsidiary project for a module, when I click on a Vassal class and ask to go to the Declaration, it is decompiling the Vassal.jar I installed in the local repository. How do I set it up to reference the actual source, or export the source of the vassal module to the local repository for use by my subsidiary projects?

Thanks.


This is a good thing actually, this is how it will work "in the field" later on. We still need to setup maven to put a source jar next to the bytecode jar, it's at the top of my todo list, I already have a version that does that but the javadoc generation is still giving me issues, the default javadoc generation settings are too strict and result in hundreds of errors.

You can try a temporary solution in the meanwhile, add this in the build plugin section of vassal-app/pom.xml:
Code: Select all
         <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
               <execution>
                  <id>attach-sources</id>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>


This should create a "vassal-app-source-x.x.x-snapshot.jar" together with the regular jar, then run the "mvn install" goal to generate them and install in your local maven repo. I think... you might have to tweak it a little according to https://maven.apache.org/plugins/maven- ... usage.html

Eclipse has this "resolve workspace artifacts" thing where it skips going through the jar and links to the code in the workspace, but this is not how things will work in production, so the IntelliJ way of going to the referenced .jar is safer at the end of the day and will uncover possible problems early on.
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: About IDEs

Postby Flint1b » July 22nd, 2020, 1:19 pm

Btw I am working on what I think is the easiest possible solution of making the vassal.jar available to module developers -- deploy it right there in the github repo, next to the source code.

Here is an example, the modules will have to add 2 things into their pom.xml, our "custom maven repo" and the actual artifact, like this: https://github.com/javaterminal/Termina ... dependency

And the "custom maven repo" will be right inside the GitHub repo, like this: https://github.com/javaterminal/Termina ... terminalfx, under /releases/org/vassalengine/vassal-app/3.3.3-SNAPSHOT for instance.

Any objections to this, do we possibly want to deploy to some external site like Bintray, or go the official way and deploy to Mavencentral? This will need additional work, the GitHub way is by far the easiest and we could have that within the next days.
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: About IDEs

Postby uckelman » July 22nd, 2020, 1:29 pm

Thus spake Flint1b:
> Btw I am working on what I think is the easiest possible solution of
> making the vassal.jar available to module developers -- deploy it right
> there in the github repo, next to the source code.
>
> Here is an example, the modules will have to add 2 things into their
> pom.xml, our "custom maven repo" and the actual artifact, like this:
> https://github.com/javaterminal/Termina ... dependency[1]

This would have the JAR on our releases page and pull from there?

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8985
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: About IDEs

Postby Flint1b » July 22nd, 2020, 4:06 pm

Whoops this is the IDE thread, I'll write about the build process in the other "moving on " thread
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina


Return to Developers

Who is online

Users browsing this forum: No registered users and 8 guests