Eclipse/NetBeans and Maven integeration - java

I'm going to ask about Eclipse/NetBeans and Maven, but first let me state my higher goal for which I'm only guessing Eclipse/NetBeans and Maven will be a good combination.
I'm an experienced programmer and computer science tutor in several languages, but I'm learning Java for the first time. I'm helping a student learn it along with me.
I'm most used to Emacs, and I got the JDEE mode working together with Maven quite nicely.
My student finds Emacs unwieldy and wants to use something else. He only knows Atom so far, but that doesn't seem very well integrated with Java yet. Eclipse or NetBeans seem like good bets. (Any known differences, especially for a beginner learning Java?)
My student and I would like to work from the same repo. Because I have a Maven project working nicely with Emacs, I'd like him to be able to work on the same project in Eclipse or NetBeans.
Can I get some suggestions about how to go about this?
I already tried importing my project into Eclipse, but it doesn't work. I go to the importer, then the Maven section, and try to select my project directory. The importer shows the pom.xml but it's grayed-out and can't be selected.
Alternatively, going back to my higher goal which is for my student and I to be able to collaborate, with me on Emacs and him on something more modern and easy for him to assimilate ... a different idea altogether, perhaps?

NetBeans treat maven project as first class citizen. You can open a maven project as is without installing any plugins. That'll be the easiest way for you to forget setup and start coding.

Related

How to Convert jbuilder(jpx) project to eclipse new project

we have a jbuilder project which supports java 5. Need to convert this to latest version. Like to change the IDE to Eclipse too.
The code is working in ongoing project need to reuse the same. Plz help on this
in this form I'm afraid community won't be able to help much, SO is intended for asking very precise questions to get precise answers. That's why you've got a downvote I believe. Welcome to the SO though.
Anyway, JBuilder is somewhat old (very old) so If you really think about updating the system, I suggest starting with building a build script in something like maven or maybe gradle.
If you go with maven, for example, you'll have a file pom.xml (or maybe many files if its a multi-module project) that describes a build process. Then it's possible to take advantage of eclipse maven integration and just open a pom.xml as a project (it will work in IntelliJ as well).

Gdx.files.internal won't work (blueJ)

I am trying to make the HelloWorldImage example from Beginning Java Development with Libgdx but I can't get the project to read the image.
This is what the project directory and first class looks like:
And this is the error I get when I try to run the program:
I also used "Beginning Java Game Development with LibGDX" to learn LibGDX, so I know you are using BlueJ because that's what the book does. You definitely can build LibGDX games with BlueJ: the author uses it to develop dozens of games in the book. That said, the other commenters are correct: BlueJ is an "educational IDE" arguably suitable for learning Java. You could consider using a different IDE, especially if you already know Java.
The book's source code is available for download on GitHub. Download and extract the "978-1-4842-1501-2_Ch01_code.zip" archive and see how the project files are supposed to be arranged. If you compare your project to the source, it looks like you're missing the "+libs" folder which should contain gdx.jar, gdx-backend-lwjgl.jar, gdx-backend-lwjgl-natives.jar, and gdx-natives.jar. I know the author described several ways these dependencies could be installed, so perhaps you have used an alternative method, but I recommend you use the structure you find on GitHub to ensure it's working.
(If you want to use a different IDE like Netbeans or Eclipse but don't want to use LibGDX's Gradle build tool, I wrote a short Maven pom file that can be used to build the LibGDX games in the book.)
You don't have libGDX's dependencies (i.e. libGDX libraries etc.) included in your program's classpath.
I don't think BlueJ even has an option to use dependencies. Use Eclipse, NetBeans or IntelliJ, the only 3 officially supported IDEs for libGDX (and the most commonly used).
Edit: You can add your libraries in a folder called +libs in the BlueJ project directory.
I would not recommend using BlueJ - BlueJ is, IMO, often used for teaching Java concepts (because of its object visualizer etc.) but has an extremely limited feature set.
Also, BlueJ Gradle integration doesn't exist (a useful tool for development in general.)
Instructions for setting up libGDX with these 3 IDEs are available here.

Make Gradle use Eclipse project

I'd like to make Gradle use Eclipse project dependencies. Unlike this question, I don't want to do any export as I don't want to hunt down problems due to forgetting to re-export after a change. And unlike this question, I don't want to integrate Gradle into Eclipse at all, as I'm satisfied with how my Eclipse works (it's much faster than a Gradle build) and I'm also afraid that my Eclipse 3.7.2 may be too old for such games.
Ideally, I'd like something like
dependencies {
compile allFilesFromEclipse()
}
Actually, getting the JARs would suffice.
What I've tried: Just some light googling. I could imagine parsing the .classpath file myself, but it's not done in 5 minutes, so I'm asking if there's an existing solution.
I am afraid you won't find much help. It is not obvious what problem you want to solve here. Most developers prefer to base their build on a build tools rather than expect that they will replicated an IDE setup everywhere.
As for Eclipse 3.7.2: I am not sure why you want to stick with that but gradle eclipse generates files that work with this version.

How to create a build job for a simple java project

I am very new to Jenkins. I have gone throught the tutorial of jenkins and I want to create a build job for simple java project. I know how to create a freestylebuild but I dont see any connection between the build and the project. Whats happening exactly. I have my project in eclipse and how can i create a build to the project. How do i know that it is the exact build for this project.
Can anyone please help me.
the best thing to do would be to move your build to some standard command line tool, like ant, maven, ivy, gradle etc and then you can reuse the same build from your IDE and on jenkins. note that this doesnt mean giving up using your IDE - many IDEs can import these types of projects directly and give you all the benefits youre used to in an IDE. it simply means that you get a build thats "portable" and not tied down to the specific IDE your using.
personally i think maven is best supported in this regard, but its mostly a matter of personal preference.

Organizing Eclipse Workspace

I love being organized, and I hate having all my java projects in eclipse right in the workspace. It makes it very cluttered, and I wanted a more organized approach, where I have folders in my workspace for different kinds of projects. However, folders can only be added into other folders, and not the workspace itself. Also, I wanted a way to be able to put classes into just any folder, and not just the src folder in a project. I love eclipse, but I really want the way to organize my programs to be a little more flexible. Does anyone know how I can do this?
I think what is organized to 1 person is not the same for another. I have found some of these techniques helpful maybe they will help you
Group projects to working sets so you do not see the full workspace
You can keep sources in different folders add those source folders in the build path
Use tools like Collabnet that integrates with your version control repository and issue management systems like JIRA and at given point in time you can view only the files that are relevant to the issue you are working with.
Know your keyboard shortcuts very well
For what I understand, you are formulating two expectations:
Have a clear directory structure for your projects, independent from the IDE;
Have a clear workspace organization, which reflects the underlying structure of your projects.
There is something you did not mention, which is the build facility for your project. I guess you are compiling and running your projects from within Eclipse? If not, or if you are willing to compile, test, deploy and run your project besides your Eclipse IDE, you can have a look to full-featured tool like Maven.
The point is that even if you do not want to build your project outside of the IDE, this tool will save you so much time that it is even worth to use it only to have a clear, proper, conventional and understandable directory structure as you seem to expect. On the other hand, the problem is that such a tool addresses issues that are far beyond your own requirements, which may render it overkill to use for the sole purpose exposed above.
Maven is a perfect tool for those who like to be organized. One of its core concept is convention over configuration.
This means, for instance, that if you follow Maven conventions for your projects, the simple command
mvn eclipse:eclipse
will generate for each of your them a corresponding Eclipse project, which you will be able to configure, generate and clean from outside Eclipse.

Categories

Resources