I've set up Eclipse in Ubuntu 10.04. I currently have the OpenJDK JRE installed but don't have the JDK needed to compile.
However, the code written Eclipse still compiles. Is this a standard compiler included in Eclipse? I've searched through the package manager and don't seem to have any of the JDKs installed...
Note: running 'javac' in the terminal doesn't work.
If you download Eclipse from eclipse.org, it will bring everything it needs to work with it.
Eclipse is designed to be a standalone package which only minimally uses the components of the system on which it runs. This helps to provide the same experience everywhere.
On the down side, it makes Eclipse larger and more RAM-hungry, and also makes keeping Eclipse up-to-date a separate chore from keeping the rest of your system current.
You can see what Eclipse is using by going into your project build settings. It may be using its built-in compiler, which lets it easily highlight errors, rapidly do incremental builds, and such.
For what it's worth, the Java compiler included in Eclipse is a derivative of IBM's jikes compiler. It's not really so important what brand it is; what's important is that it is an incremental compiler; it sort of keeps your whole program inside itself and if you change a class (maybe even just a method) it will re-compile just the bit of code you've changed.
If you look at NetBeans, when you save a changed file it will call up an ant task to re-compile (via the JDK) at least the class you changed, maybe more. When your classes start to get bigger, you'll find (or at least I did) that this takes up a lot of time; I'm very happy with Eclipse (and IBM) for doing things the way they do. Without the external compilation step, code changes take place a lot more quickly.
Yes, the compiler has some differences compared to the "standard" compilers by Sun Oracle and OpenJDK. But I've never experienced a problem as a result. Still, for production use I'd recommend formally compiling using ant or maven and the JDK. Just to be on the safe side.
Eclipse, like unfortunately most substantial applications that require a JRE/JDK to run include it in the distribution.
For a good time on Lucid Lynx:
$ locate javac
You'll need to another source to the repository. Run the following commands.
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
There's a package for eclipse called eclipse and the java compiler (javac) is in sun-java6-jdk
Install it with sudo apt-get install sun-java6-jdk or sudo apt-get install eclipse
Eclipse does come with its own compiler, but I wouldn't recommend using it for distribution of source code. I'm not intimately familiar with it, but I've been told that it doesn't perform optimizations as well as other compilers and there are some known bugs in it. I can't dig up anything that supports this, but I do like the idea of building using the same JDK/compiler and running on the same JVM that your users are.
I would suggest obtaining the Sun JDK for Linux. You should be able to get it from the Synaptic Package Manager if you open the universe repositories.
Related
I haven't found one to install Eclipse 4.2 Juno. Default Ubuntu repositories (I'm using Ubuntu 10.04) suggest me the archaic Galileo version. And I found the Eclipse's page on Launchpad which was updated in 2009.
I can, of course, simply download the archive with all the files from http://www.eclipse.org/downloads/, but that's not Debian way, is it? I mean, no automatic updates and other aptitude-managed cool things.
So, is there any repository that maintains the most recent version of Eclipse?
I think it is unlikely that you will find a newer package for Lucid. People tend to create packages for newer versions of Ubuntu.
If it's not possible to upgrade Ubuntu, what you could try is to make your own package but you would still not get automatic upgrades. From a quick look, it looks like that Juno needs some libraries to build that could be newer than the versions you have in your system, so this may end up being quite difficult. It could possibly be the reason why it is not available for Lucid in the first place.
If Juno works in your system, the quick and dirty solution is to first create a temporary folder, e.g. eclipse_3.8.0 and then do the following:
mkdir /path/to/eclipse_3.8.0/DEBIAN
mkdir /path/to/eclipse_3.8.0/opt
tar xzvf eclipse-juno.tar.gz -C /path/to/eclipse_3.8.0/opt
dpkg-deb -b --no-check /path/to/eclipse_3.8.0
This will create a deb package that installs eclipse in /opt/eclipse. You may want to put a control file inside the DEBIAN folder to add a description, dependencies, etc.
If you still want to give building a try, from the official ubuntu launchpad page for eclipse you can download the source files and especially the control files stored in the xxx.debian.tar.gz file. Take a look at the Debian wiki for some tips on how to build. Precise has the Indigo SR2 version and Quantal seems to have Juno.
On my development machine, I have JDK 1.7 installed, but we are packaging software for use with Java 1.5 and 1.6. It's easy to set the -source and -target options so that the syntax is forced to be a particular version, and the output class is interpretable by a particular VM. But there are other version-isms that are biting me, like the 2-argument constructor AssertionError(String, Throwable) and various other subtle changes.
The one solution I know of is to install every different JDK (1.5, 1.6, 1.7) so that Eclipse can exactly match the execution environment for me. Is there any other way to detect these problems? Bonus points if it's an Eclipse or Maven tool.
How about the Codehaus anmial-sniffer maven plugin? I haven't had reason to try it yet, but thought it looked interesting.
does this tool help? It's command line, I have seen people using it to detect java7 being used.
I'm sorry for a pretty vague title, didn't want to turn it into a paragraph.
So, I am using Eclipse Platform 3.7.1 (the one with absolutely no plugin preinstalled), the latest version so far, and I have discovered that by taking advantage of its -configuration option, I can choose which plugins are running and which are not. It was going well enough until I started installing the plugins.
But allow me to explain my setup first, I am using Ubuntu linux by the way. Using only one eclipse installation, my installation is arranged in the following order:
Installation:
~/bin/opt/eclipse
eclipse (executable binary)
~/bin/eclipse -> opt/eclipse/eclipse
Configurations:
~/.eclipse/configuration
web-php
android
java
Installing JDT and ADT while running eclipse and using the android configuration directory posed no problems. So I moved on to the php configuration and tried to install PDT (the JDT and ADT plugins were not activated here, so far so good). The problems came along after the installation, not only was I not able to use PDT, I noticed in the Installation Details that JDT, ADT, PDT were installed but not activated. Instead, they were all activated in the android configuration. To make it worse, when I chose the Java configuration, I could not even use JDT.
My expectations however were when using:
eclipse -configuration ~/.eclipse/configuration/android
was that only the JDT and ADT were activated and when using:
eclipse -configuration ~/.eclipse/configuration/web-php
only the PDT is activated
Regarding the java configuration however, it's probably another problem altogether but if there was help on how to activate a plugin installed from another configuration, I'd deeply appreciate it.
Also, see Single Eclipse install with multiple Configurations and Workspaces
In a p2 world there are extra steps to isolate bundles from each other. You need not just a different configuration directory, but a different p2 profile.
Have a look at the config.ihi in each of your configurations. There are two ways that Eclipse identifies the plugins to use, the ..updateconfigurator, which simply uses all of the plugins in the plugins folder, and the ..simpleconfigurator which uses the bundles.info file in that's in the org.eclipse.equinox.simpleconfigurator folder (which is maintained by the p2 installer). Make sure this file is what you expect.
And also, you might want to start with the -clean option if you are using the updateconfigurator to have it rescan all of the plugins (otherwise it remembers in some hidden cache).
Make sure when you installed everything that you had your -configuration set to the right place for the different things you installed.
I hope some of this points you in the right direction.
I need to install several plugins to an eclipse that is running on a remote 64bit Linux machine.
I tried copying the neccesary plugins to the plugins and feature folder on the remote machine but it did not seem to work.
The approach I wanted to try out now was setting up a new Eclipse installation with all plugins and replacing the whole eclipse folder.
But as I am doing this I realized that I have to use a 32 bit Linux and Eclipse. Is it possible to install 32bit Eclipse and just move the plugins and features to the remote machine?
Do I need to consider other things?
Can you recommend any other approach that would help me?
UPDATE:
The problem is that I cannot just start eclipse on the remote machine. I can access it via ssh but not run eclipse and install plugins via the wizards.
I also have no 64bit linux to prepare a complete eclipse that I can simply copy.
So what I meant is that I have to prepare either an eclipse installation or maybe just plugin folder and move that from my 32bit architecture to the 64bit one.
I can download the current eclipse folder but I cannot run it. When I try to start it with ubuntu nothing happens. I believe it is because its a 64bit version and I got 32 bit architecture.
Don't do this. Not only are there are a number of plugins with native-compiled fragments (different for 32-bit vs 64-bit), but in recent versions, Eclipse will not even register features and plugins that are simply dropped in. You should install plugins explicitly unless you are moving the entire installation between machines with compatible architectures.
You can't run a 64bit binary on a 32bit system without some kind of virtualization software that does a complete CPU emulation. VMWare, VirtualPC, etc... don't do this. They virtualize the system, but not the CPU.
The other way around: a 32bit binary on a 64bit cpu, is generally possible, if the OS (and processor) supports such things.
I think this is feasible.
The architecture should not be the problem. Unless the plugins contain DLLs or .so libraries invoked through JNI but there are very few examples (swt is one example but there are very few of them).
As a matter of fact, the reason why you have OS/arch/GUI specific versions of eclipse is not the java code but the native launcher (eclipse.exe on windows and SWT), all the rest can go bck and forth from one machine to the other, regardless of the arch, the os or the wondows manager.
However, dropping jars in the plugin directory of eclipse is not the recommended way of installing plugins any more (since 3.3 ?). It might work but there is no guarantee.
To install the missing plugins you should download them from eclipse itself (help => install new software...). If you tell us the specific plugins you have problem with, we might be able to help you more precisely.
The best way to go forward is to list all the plugins on the source machine (either from eclipse (help => about) and look at names having specific hints at arch/os/gui. All these cannot be copied over. All the rest should be safe.
As I said, beware of swt. Subclipse has a JNI dependent configuration if you decide to use JavaHL. And there are also "false" plugins such as xmlSpy etc who are noting more than JNI adapters but these are not mainstream.
I'm trying to learn to use glassfish for the first time. My IDE is netbeans and I've installed the glassfish plugin for netbeans. I opened up synaptics package manager and typed in glassfish. My choices were
imqv2
glassfish-activaton
glassfish-mail
glassfish-appserv
glassfish-toplink-essentials
glassfish-jmac-api
glassfish-javaee
I'm not sure what is in each package, or which package are needed. I can't seem to find anything that tells me anything descriptive about these packages.
I've seen a lot of tutorials on how to install glassfish, but I'd prefer to use apt-get / synaptics to install glassfish so that syntactics can take care of updating.
To strictly answer your question, I think that a typical install would at least include glassfish-appserv, glassfish-javaee, glassfish-toplink-essentials (for JPA).
But for development, I'd warmly recommend to use GlassFish v3 (because of the session preservation across deployments feature, to maximize productivity) and to install it manually in your home directory. Download the self-extracting installer file from here.
Do you want to run the latest and greatest software? It looks like Synaptic has Glassfish version 2 which is an entire major version out of date.
Just for the record: I love Ubuntu and their (well, Debian's) package management system. However, for any Java applications, I prefer to do manual installations. So, my Maven, Eclipse, Tomcat, Glassfish, etc. were all done through manual installs for the newest version... and because sudo apt-get install winds up throwing the app in some weird place and can have unexpected behavior.
Here is how you can do a manual install...
Download Glassfish: wget http://download.java.net/glassfish/v3/nightly/latest-glassfish.zip
Extract the archive anywhere on your filesystem
Inside your IDE such as Netbeans or Eclipse, setup a new server and point it at where you extracted the file
It's also useful to add a new environment variable to ~/.bashrc file, which will make it easier to start the server from the command-line, e.g. $GLASSFISH_HOME/bin/asadmin start-domain domain1
Another cool thing to try, if you're into maven, is to use the maven-embedded-glassfish-plugin. It's a clean way to get a web app up and running and not need to manually install glassfish and not even have to use an IDE.
You might also try asking this question at superuser.com if you really want to get it working with Synaptic.
i dont know if this here is still open...
but if you know how to handle shell commands on ubuntu then you might find this here helpful:
http://www.nabisoft.com/tutorials/glassfish/installing-glassfish-311-on-ubuntu