Work with docker and IDE - java

To share installation, we decided to work with docker. For each project, global dependencies are installed inside the container.
We are developping with Python (and Java, but at this time, let's speak about Python only ;) )
Working with Vim (for example), I want to use code completion, but because the entire libs are installed in container, my vim installation on host cannot access them. This is true with Java, Javascript, and so on and it's absolutly normal...
But is there any solution to be able to work with container, getting access to libs for IDE, without to install IDE in the container itself ?

But is there any solution to be able to work with container, getting
access to libs for IDE, without to install IDE in the container itself
?
The trick is to run your IDE from the container. Your IDE is installed on your host, you just run it in the container.
For this to work, you need an IDE container that has:
all the system requirements your IDE needs
can display GUI applications
has a volume mounted on the location of your IDE on your host
An example of all this with a well known Python IDE instead of vim is discussed here:
Warning: this has been validated on Ubuntu 14.04 only.
PyCharm Docker Integration

Why don't you checkout the official image for python?
https://registry.hub.docker.com/_/python/
It doesn't provide exactly what you're looking for but it supports a workflow where the container is built the same way as it should be run on your development machine (dependencies listed in the "requirements.txt" and downloaded using pip).
Hope this helps.

You may also try using cloud-based IDEs like eclipse che or cloud9.
It has support for docker and runs in a browser.
Update:
I just found out that eclipse che and cloud9 are not mature enough to run java apps, so you might want to try Intellij: https://github.com/marioluan/java-data-structures

Related

Run Java based Application on mac without having to install Java on it but using bundled JRE instead

I have Java-Maven project made on Eclipse RCP. The project runs fine using Java on the system. But I don't want the client to have to install Java to run that project. So, I have put jdk inside folder, removed Java from the system and played a little with its info.plist file. But everytime I try to run it, it asks to install Java.
I am pretty sure I am making mistakes in info.plist but there might be something else I am missing.
PS - deployment in windows using bundled java works fine.
It seems eclipse on Mac requires a full JDK, so I don't know if having a full JDK (in place of a JRE..) depoyed in your bundle under "<eclipse install dir>/jre"will do the job (To be tested)
Ref: https://wiki.eclipse.org/Eclipse/Installation
If not, you can still bundle your app with a full JDK somewhere under your"<eclipse install dir>" and referencejavawin eclipse.ini, The"-vm"stanza accepts relative paths tojavaw
Ref: https://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse

Multiple applications and plugins for docker build?

So I am relatively new to Docker and I was wondering if there is a way with either docker-compose or cloud-cli to create a Java environment with different plugins and other software needed for an application?
For example, I would like to start with configuring Eclipse, Java, Tomcat, and Maven together as one environment natively. And if so could you explain and maybe show an example of how to do this? I am on a Windows 10 machine.
Thanks in advance.
You can totally do that using Docker-compose for java, tomcat and maven.
For eclipse it will be kinda problematic since it's a graphical application, but you still can do it using volumes.
You could also consider using Vagrant if it's for a development environment.

Eclipse plugin compiled in linux work on windows?

I have developed an eclipse plugin, which is compiled linux using maven Tycho plugin. But for some reason, I am not able to see the plugin in the eclipse running on windows. I am not finding anything in the log file.
As I am new to plugin development, Is there any difference does a cross platform compiled plugin would cause?
One dilemma I have in my mind is that, Does it really matter if I use windows based eclipse installation on linux, (as it is just a zip, extract it and use it) machine for compiling and building my plugin? Well, to me it appears that it does matters. I should use linux based eclipse for compiling a plugin in linux operating system.
But isn't this what is against java principle? Compile and Run anywhere?
as far as I know, if you are using UI stuff inside that plugin then you have to export it for multiple OSes ... and you need some libraries from eclipse website to export your application in linux...
If you are exporting only the plugin then you need nothing... OSGI takes care of everything
Some of the Eclipse packages are system dependent. To take one example, org.eclipse.core.resources.win32.x86 would work only on a 32 bit Windows workstation.
Check your plug-in and see if you have any of these system dependent Eclipse packages.
If you do, you have to export your plug-in with the appropriate Eclipse packages for each of the environments you want your plug-in to run.
Write once, run anywhere is a myth. Ask any Android programmer. :-)

Does having multiple instances of GAE SDK on your machine cause conflicts?

I would like to install both the Google-Eclipse plugin (which I believe also install the GAE SDK) for my Eclipse instance, so that I may take advantage of a lot of the IDE tools and features it comes with, and also so that I can run my app from inside Eclipse.
I would also like to install just the pure GAE SDK so that I can run my app outside of Eclipse on my regular system.
Because the GAE SDK is a diverse and complex beast, I am worried about having two instances of the GAE SDK installed on the same machine (setting conflicting ENV VARs, trying to open the same port number, etc.).
Obviously, I would take care to never be running the 2 GAE dev servers (1 that ships with the Eclipse plugin, and the other that ships with the pure SDK) at the same time, but that might not guarantee that I have 0 conflicts.
I would also be fine with just installing the Eclipse plugin if there was a way to configure the GAE SDK that it ships with to run both from Eclipse as well as the bash shell. That would probably be the easiest but I don't believe this is possible to do.
Any thoughts as to what my options are here? Thanks in advance!
You can do that by having a single SDK installed and using it for both Eclipse and also for bash shell.You can do that by following the steps below:
Download a Suitable GAE SDK from here and install it.
Open Eclipse and Select Help->Install new software.
In work with box enter the url as http://dl.google.com/eclipse/plugin/4.2 and from the list of available softwares select only "Google Plugin for Eclipse" software and select any other required plugin but not the SDKs. Keep it unchecked!
After installing the selected plugins, in Window->Preferences->Google->AppEngine click on add and then select the installation directory as the directory from step 1 and give a suitable name. Make it as default.
Now you are good to go.If you need to run from shell, invoke dev_appserver from the installation directory. Or if you want to run from from eclipse just run it from there.

Which Eclipse IDE version to choose?

How do I find which Eclipse version I have on my Ubuntu system?
This is what "About Eclipse SDK" says.
Eclipse SDK
Version: 3.5.2
Build id: M20100211-1343
I am not sure if its the Eclipse IDE for Java Developers or the Eclipse Classic version.
What I would like to do is use Eclipse for
Java based Web Application Development
Ant Builds
Deploy using Tomcat
including HTML, CSS Editing
Please help me decide which version I should choose? I would like to upgrade my Eclipse setup from whatever version it is now to a version that supports all the above. Should I go for Eclipse IDE for Java EE Developers?
Should I download a totally new version from Eclipse site or can I just ADD necessary features/plugins to my current Eclipse setup.
Please suggest.
See Compare Eclipse Packages for a nice chart
What I would like to do is use Eclipse for (...)
The Eclipse IDE for Java EE Developers allows to do what you're asking for out of the box.
Should I download a totally new version from Eclipse site or can I just ADD necessary features/plugins to my current Eclipse setup.
Both would work, although it would be simpler to just get directly the Eclipse IDE for Java EE Developers (especially if you don't know exactly what plugin(s) you're looking for). Personally, I don't use the version you can get from the repository but download Eclipse from the official website and install it in user mode.
If you are using Eclipse for only Enterprise Development, then as everybody has recommended I would use the Eclipse Java EE version. If you plan on occasionally using it for other development purposes then I would consider downloading a separate classic version as well.
The reason for this is that everybody is well aware of eclipse's plugin capabilities. Unfortunately, Eclipse can get bogged down with too many plugins or add on tools. What I have experienced is that if you are using it for Enterprise Development(J2EE) it might be a good idea to keep that as a separate environment then your other Java Development. That way you can download the plugins,tools,libraries,etc for your enterprise development, and you can use your classic version for any other development you might need.
The downside is you will have two versions, but this is not a problem granted you do not run them simultaneously.
If you want to play with Web development, then the Eclipse java EE for Developers is for you. It is shipped with components to make Java Enterprise applications to create Enterprise Applications (and bundle it in an Enterprise ARchiver, known as EAR file or Web ARchive, known as WAR file).
The default Eclipse shipping with Ubuntu is the Classic version, and you can add more plugins.
I would recommend, however, to download th eJEE version manually and unzip it and run. Then you have a local installation outside the system files.

Categories

Resources