Commandline installation of AspectJ - aspectj

I would like to install AspectJ from within a shell script. However, the installation document has instructions only for GUI based installer. Is there a way to install AspectJ from commandline?
http://www.eclipse.org/aspectj/downloads.php#install

I think if you ensure a directory exists you can use java -jar:
mkdir ~/aspectj182
java -jar aspectj-1.8.2.jar -to ~/aspectj182

Related

How to run eclipse luna mac os with java 7

i need to execute a ant script inside eclipse luna using java 7.
The problem is that if i try to change the path with jenv or try to set JAVA_HOME inside eclipse the ant script inside eclipse is always executed with java 6.
The OS is macOS Sierra.
I have to use eclipse.ini ?
Thanks
Assuming you are running the Ant script the normal way you can configure this in the configuration for the script.
Open the External Tools Configuration dialog using 'Run > External Tools > External Tools Configuration...'.
Find your script in the 'Ant Build' section and then look at the 'JRE' tab where you can set the JRE/JDK to anything you have told Eclipse about.

Eclipse (No JVM was found)

Eclipse gave me an error specifying that no JRE is installed while I was trying to configure Erlide in eclipse.
I added path to erlang directory in 'System Variables'. Then I installed erlang plugin for eclipse, added erlang installation directory path in Eclipse preferences and restarted Eclipse.
After restarting eclipse started giving me error about JRE.
Below steps might help you to solve your problem.
Install JDK and JRE - Here are step by step Instructions OR ANOTHER
Verify you setup JAVA_HOME and JRE_HOME and PATH into environment variable.
You can also investigate your Java version via Command Prompt:
Open a Command Prompt (Navigate to “Start” => “Run” and type “cmd”)
Then enter the following command:
java –version
If you don't see your java version you have to follow step 1 carefully again
Installed eclipse/ if already installed open the same. Here are step by step Instructions
NOTE: Make sure that you have same bits for both JDK and EClipse (32 or 64). One way is to verify in your ini file.
To develop a Java program, you need a JDK not only a JRE.
Do you have a JDK installed? Have you tried to run jar, $ set | grep "JAVA_HOME" (Linux) or C:\> set | find "JAVA_HOME" (Windows) in your command prompt to see if you have Java configured in your machine?
Once you install your JDK you need to set this environment variable.
Maybe Earlide is not compatible with your JDK 1.8, can you try with jdk 1.6

Where is mvn.exe when using embedded maven 3 in eclipse indigo?

I'm using the Indigo Release of eclipse. When I check Window -> Preferences, Maven -> Installations, it confirms that it's using the Embedded (3.0.2/...) installation of Maven.
I want to be able to run maven commands from the command line (Windows Powershell), but when I type, e.g.,
PS C:\> mvn
no executable is found. I did a search for "mvn.exe" and found no results.
I suppose I could install a stand-alone version of Maven 3 and add that to my PATH, but I'd prefer to be using the same Maven installation for command line tasks as well as IDE (eclipse) tasks.
So, where is the embedded maven's mvn.exe hiding?
The simple answer is, cause it's embedded in Eclipse so you can't call it from console. If you like to do this you have to install Maven yourself.
There is no mvn.exe at all. The Maven distro comes with batch or shell scripts. Eclipse runs an embedded version which is called through an API.
remember, embedded maven is not configured to work out of eclipse environment (and terminal usage is out of STS usage).
we have to install maven.
and also note, there is no "mvn.exe"
follow the following to setup maven to work from terminal.
maven download link is here
download latest maven from here
extract it where ever you want.
i extracted as below (see the bin,boot,conf,... folders are shown below as in the image):
as this maven download is extracted from zip file (it is not setup), you will have to add this extracted path to "PATH" variable in windows environment.
follow this to set environment path:
now "mvn" command must work.
in my case, i use STS (spring tool suite)
and i had to restart STS for "mvn" to work in terminal in sts.
check it out with eclipse.

problem running eclipse on ubuntu?

I downloaded eclipse on ubuntu. But when I run it it show following error.
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/awan/eclipse/jre/bin/java
java in your current PATH
Can someone help me to solve this. I don't have experience about this on ubuntu.
thanks
You need to install either the openjdk-7-jre or oracle-java7-jre package.
sudo apt-get install openjdk-7-jre
Note that openjdk-7-jre is easier to install, because it's available via the standard Ubuntu repository, whereas you have to build oracle-java7-jre yourself using java-package.
If you allready installed java** you need to add the Java-Path to your eclipse.ini
in my case it's located at:
/usr/lib/eclipse/eclipse.ini
there you need to add direct under the "openFile" statement, where you replace the path with your java path:
-vm
/usr/lib/jvm/java-7-openjdk/bin/java //!replace with your path to java!
** check wether java is installed by typing the commands
java -version
or
javac -version
If you are sure that java is installed, but it's not found you may have multiple versions installed, check that by:
sudo update-alternatives --config java
and select installation first
I solved it by created a symbolic link java in /usr/bin that points to the VM.
Steps :
Downloaded the appropriate version of Oracle's JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp
extract it to any folder. For example :
tar zxvf ~/Downloads/jdk-8u5-linux-x64.tar.gz ~/DEV
create symbolic link with name java :
cd /usr/bin
ln -s ~/DEV/jdk1.8.0_05/bin/java java
You need to add the JDK to your PATH.
This link should help you get started.
You need to install the JDK or OpenJDK (Eclipse only officially supports the former, but the latter mostly works).
I solved this error message by adding jre path in to eclipse.ini.To solve the error like this,your machine should have java installed.
In my setup eclipse.ini is in
eclipse-jee-mars-linux-gtk-x86_64-5.0.0/eclipse folder.
Add,
-vm /home/user/Documents/Softwares/jdk-8u202-linux-x64/jdk1.8.0_202/jre/bin
at the top of the file.
In here /home/user/Documents/Softwares/jdk-8u202-linux-x64/jdk1.8.0_202 is my JAVA_HOME
For me, directing JDK path to -vm didn't work.I had to put the jre/bin path which is inside jdk folder.
You need to have a Java environment that can execute the Java instructions in Eclipse for it to run.
Install a suitable Java package in the package manager, and try again. Note that Eclipse does not require a JDK, a JRE is enough.
I tried editing .profile, .bashrc, to no avail. (I'm trying to use eclipse by clicking an icon, NOT by executing it from a bash shell).
SOLUTION: I copied my /home/denise/jdk1.7.0_25/jre to
/home/denise/dev//jre
which is a stupid solution because it defeats the purpose of having a .profile or .bashrc.
and no, there was no .pam_environment file
peace!
I had similar problem. It solved after, I have download JRE from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
and put it in the path of eclipse as shown below -
abc#ubuntu:~/Downloads/eclipse$ ls
about_files
configuration
eclipse.ini
icon.xpm
p2
about.html
dropins
epl-v10.html
jre
plugins
artifacts.xml
eclipse
features
notice.html
readme
I hope it helps.
First of all you need to set your JAVA path in .bashrc file.
goto cd ~
open .bashrc,vi .bashrc
add a line at the end export path="path/to dir:$path"
do source .bashrc for changes to take effect.
Then open your eclipse.ini file(if you want to locate eclipse.ini do whereis eclipse).
open eclipse.ini,then add a line
-vm
"path/to/bin/of/open-jdk"
Just copy jre and paste in eclipse folder that's it. After this just click on eclipse icon to launch eclipse. Thanks.
artifacts.xml
configuration
dropins
eclipse
eclipse.ini
features
icon.xpm
jre
p2
plugins
readme

How install multiple JDK on Windows?

I want to install JDK 1.5 and 1.6 on XP, is it possible? how to do it
Also, I am using Eclipse how to setup using different JDK for different projects?
thanks.
You may install different JDKs easily: just specify different folders.
You can setup the installed JDKs in Eclipse Window/Preferences/Installed JREs
You can pick the JDK and Java version for every single project in Project/Properties/Java Compiler
I have solved this by creating batch files for different Java versions.
I have installed the Java versions I need to have
Whenever, I need to use Java I run the appropriate batch file and set the environment variables to work with that Java version.
Java 8.bat
#echo off
echo Setting JAVA_HOME
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
echo setting PATH
set PATH=%JAVA_HOME%\bin;%PATH%
echo Display java version
java -version
Java 10.bat
#echo off
echo Setting JAVA_HOME
set JAVA_HOME=C:\Program Files\Java\jdk-10.0.2
echo setting PATH
set PATH=%JAVA_HOME%\bin;%PATH%
echo Display java version
java -version
Why? There is an option (can't remember where exactly - right-click on your project) that allows you to set the target JDK level. I use this when developing GWT applications.
Try using sdkman. Even though the installing on Windows is a bit 'tricky' but there are several options.
https://sdkman.io/install
There was a big mess with different incompatible JDK and JRE from 90s when Java was created and still this problem exists.
The main rule is when you type in console:
java -version
and
javac -version
the result should be the same then you sure both JRE and JDK (JSDK) are compatible, so when you compile you can rut it without any problems.
JAVA_HOME and PATH are essential for many console applications
and some GUI tools might use those variables as well but often is possible to alter default settings in GUI application instead of messing with environment variables. Also CLASSPATH still sometimes are used as well, however better use ANT as compiler than javac directly.
You can install multiple JDK and JRE but each one should to have its own separate folder, the default should be usually ok.
Worth mentioning that every JDK have JRE included and it instal in separate folder and as separate APP in Windows Control Panel -> Applications to be more confusing, so basically developer will never have to download and install JRE. Do not use Java update application which might cause problems after update some apps might not work, just do it manually.