How to run eclipse luna mac os with java 7 - eclipse

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.

Related

Building Netbeans from Apache Ant

I've never used Ant to build software. But, according the the instructions in the picture
I can build NetBeans using Ant.
My question is how do I proceed? I have NetBeans downloaded and the JDK.
Should I use a command window from Windows OR does Ant have its own Command Window.
If so, how do I open this command window so I can build NetBeans?

Debug in Eclipse while running from command line ubuntu

Is there a way I can debug my application (using breakpoints in eclipse) while running it from command line (ubuntu)? I'm using Eclipse Kepler version on Ubuntu 12.04LTS.
I know there's something like attach to process in .net, was wondering if eclipse has some such setup.
Thanks,
Is your application written in C or in Java?
If your application is in C and you are using CDT, you can attach to existing project by:
Run your application from terminal.
In Eclipse CDT, go to main menu "Run"->"Debug Configurations...", double-click "C/C++ Attach to Application" and press "Debug" (you should not need to specify executable and/or project).
For Java applications, see this

ANT script error after installing newer version of JDK on my system

After installing the newer version of the JDK 6 (1.6.0_41) from 1.6.0_37, I went into Eclipse and updated the Installed JREs in the Java section under the preferences menu. I then went into my ANT script to test some changes I made and when I tried to run the ANT script I got this error:
Specified VM install not found: type Standard VM, name jdk1.6.0_37
The specified VM is not the jdk1.6.0_41. This has also been updated in the PATH and JAVA_HOME environment variables.
Any suggestions as to WHERE else to make a change so that ANT sees this?
Here is the error I'm getting:
Thanks.
After additional hunting around in Eclipse, I found in the ANT view an External Configuration Tools option when right clicking my Ant script name and under the JRE tab is where the setting was. I changed the setting to use the same JRE as the workspace and then all was fine.
Just in case anyone else ran into this same problem I thought it might be helpful to post my findings.
Ant won't mind the new jdk version as long as its name stays unchanged under Preferences / Java / Installed JREs.

How do I run an eclipse project without eclipse?

I want to send my project I made in eclipse to others, so I tried running the project in my workspace. But I don't have a software to run it.(besides eclipse) What software should I use?
I don't have a software to run it.(besides eclipse) What software should I use?
You should use Java. Eclipse is just an IDE, so it doesn't run your Java programs. Java does. Export your program as a JAR, and if you have Java installed, you can run the JAR by double-clicking on it, or by running it from the command line:
java -jar file.jar
First Step
Second Step
Third step
voilĂ !

Get Eclipse IDE to show version of Java RE it's using

I've just installed proper JRE rather than the OpenJDK, I was wondering if there is an easy way to find out which RE Eclipse is using? Maybe in a help menu or something.
Thanks
Go to Window > Preferences > Java > Installed JREs. The checked JRE is the one which Eclipse uses by default. This JRE is used to compile and run the code.
The JRE used by Eclipse to run itself is the either the one specified in the eclipse.ini or the java executable in your system path. From the Eclipse docs:
Find the JVM
If a JVM is installed in the eclipse/jre directory, Eclipse will use
it; otherwise the launcher will consult the eclipse.ini file and the
system path variable. Eclipse DOES NOT consult the JAVA_HOME
environment variable.
To explicitly specify a JVM of your choice, you can use the -vm
command line argument:
eclipse -vm c:\jre\bin\javaw.exe ''start Java by executing the specified java executable
eclipse -vm c:\jre\bin\client\jvm.dll ''start Java by loading the jvm in the eclipse process
If you want to know what JDK is being used to execute Eclipse: Help, About Eclipse SDK, Installation Details, tab Configuration
Sure. Go to Window/Preferences/Installed JREs, then choose one that you prefer.
You can also choose JRE on project level. Open project properties and choose "Java compiler". Then you can configure different JRE for specific project.
I assume you want to know which version Eclipse uses to execute itself.
It would simply run with the same JRE that would execute when you issue java from command line.
You can modify -vm param in your eclipse.ini file to run with some other JRE e.g.:
-vm
c:/Java/jdk1.6.0_16/bin