Relocate eclipse.ini - macos

Is there a way to build an RCP application an relocate the eclipse.ini in a different location from where the eclipse.exe is located?
The Eclipse Product wizard only provides a "Root directory" where all files are exported to. It seems eclipse.exe has something built into it to look in the same directory for the ini parameters.

You can override where Eclipse looks for the eclipse.ini using the --launcher.ini command line argument to eclipse.
So if you do:
/path/to/eclipse -data /path/to/workspace
then it will use /path/to/eclipse.ini (on linux/win) and /path/Eclipse/eclipse.ini (on osx), if you want it to read a different file, do this:
/path/to/eclipse --launcher.ini /anotherpath/to/eclipse.ini -data /path/to/workspace
will cause eclipse to read /anotherpath/to/eclipse.ini instead of the default.
See Eclipse Help on the launcher command line arguments.

Related

how to specify the gradle local.properties path in command line param?

I hope to build my android app in both windows and WSL(win10's ubuntu),
but with the same local.properties file, it can't provide different style of path corresponding to each OS.
so I want to have two local.properties for each other and specify one in command line param, how could this be done?

How can I make “gradle --console=rich” the default?

Along the lines of this answer (which works for me, BTW) and the javadocs, I tried
gradle.startParameter.consoleOutput = org.gradle.api.logging.configuration.ConsoleOutput.Rich
in my ~/.gradle/init.gradle. However, I still need --console=rich to get color output. Why?
Tested with Gradle 2.14.1 and 3.2.1.
Terminal is cygwin urxvt with TERM variable set to rxvt-unicode-256color.
Since Gradle 4.3 you can use org.gradle.console property in gradle.properties:
org.gradle.console=rich
A new console verbose mode will print outcomes of all tasks (like UP-TO-DATE) like Gradle 3.5 and earlier did. You can set this via --console=verbose or by a new Gradle property org.gradle.console=(plain rich verbose).
I am not sure if you can force the rich console from a gradle script, as the detection happens likely before the script is interpreted.
NativeServices class provides the integration with the console. If you look at the source code, there are two messages possibly printed in log:
Native-platform terminal integration is not available. Continuing with fallback.
Unable to load from native-platform backed ConsoleDetector. Continuing with fallback.
The latter might give you more information why. Try running the gradle script with --debug. You will likely find out that you are missing a native library that is either not available in cygwin or it is, but is not on library path.
I believe it works when you specify the rich console from the command line, because gradle forces the colours even though the console doesn't indicate it supports them.
Does it work if you don't use the cygwin console in Windows native command line or maybe GitBash?
There is a workaround how you can make this work. You can create an alias in cygwin that will always add the --console=rich.
If you are using gradle wrapper, you can edit the gradlew script and add the command line parameter. To make it automated, you can change the wrapper task to alter your script in the doLast part.
Create a file called gradle.properties inside your ~/.gradle/ folder.
Inside gradle.properties, add the line org.gradle.console=rich.
Each builds will run under --console=rich automatically because the new gradle.properties will be merged with the gradle.properties of your project.
If your project's gradle.properties contains the same tag as the local file, your project's will be used overriding the local file's
If you are on Linux/Mac set
alias gradle='gradle --console rich'
in your ~/.bashrc.
In Gradle Wrapper, add the following line:
org.gradle.console=rich
to ./gradle.properties in the root folder, where the gradlew script is located.

How to modify the Netbeans Application Configuration?

I have a Maven Netbeans Application I want to modify its configuration. What do I need to do to change startup parameters from the conf file like: default_options?
I have to manually do it but would like to make it part of the build process.
You will have to create a netbeans.conf file in your nbm-application project and point the nbm-maven-plugin to it's location - please see http://mojo.codehaus.org/nbm-maven/nbm-maven-plugin/cluster-app-mojo.html#etcConfFile
Create your own ProjectName.conf, for example from default ProjectName.conf file.
Next place it in nbproject folder.
And add to project.conf line like this:
app.conf=nbproject/ProjectName.conf
Support for Custom Configuration Files in NetBeans

Ant set platforms.JDK_1.6.home without parameter

I'm having a problem trying to run ant on a windows machine. I get the following error:
BUILD FAILED
C:\Users\USER\testing\mercurial\project\NetbeansProject\nbproject\build-impl.xml:111: The J2SE Platform is not correctly set up.
Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files.
Either open the project in the IDE and setup the Platform with the same name or add it manually.
For example like this:
ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.JDK_1.6.home" in a .properties file)
or ant -Dplatforms.JDK_1.6.home=<path_to_JDK_home> jar (where no properties file is used)
If I execute ant -Dplatforms.JDK_1.6.home=%JAVA_HOME% it executes fine, but, is there some way to avoid adding this parameter every time I need to build a program?
I don't think it's possible to set ant properties outside of command line or properties files loaded explicitly by the build script.
If you are looking for a less verbose way to launch ant, try using either a wrapper .bat file, or assigning an alias doskey ant=ant "-Dplatforms.JDK_1.6.home=%JAVA_HOME%"

Open jar file with cmd

I have a jar file named "adventure.jar". When you run it through the cmd with java -jar adventure.jar it works fine. However, I am testing opening the file on a new computer, and I am encountering a problem. This computer doesn't have the java command in the command prompt. It defiantly has Java installed, but maybe just not the JDK? Anyway, my goal is to make the jar file run from cmd when double clicked, without the need of commands (is that even possible?). The jar is already executable, but it doesn't execute from the command prompt like I need. Any help would be appreciated.
EDIT: If there is a way to do this through an exe or batch file I'd be fine with that, too.
Sounds like your PATH env. variable doesn't have Java in it. You can add it by following Oracle's tutorial
Adding Java to your PATH Environment variable.
Usually it's something like ;C:\Program Files\Java\jre7\bin
To your second question - yes it's possible.
Open up notepad, then type java -jar adventure.jar then save it as launch.bat or something. then you are able to double click that batch file, which will run your java archive.
Open command prompt
Go to the folde where jar file is located
Run
unzip test.jar
here test.jar is name of the jar file.
This command will unzip all the file into that folder
First, try start adventure.jar from Command Prompt. If that does not work, locate java.exe (on my computer, C:\Program Files\Java\jre7\bin) and either use the full path in Command Prompt, or add the path to the folder containing java.exe to your PATH environment variable. To add the path, click Start Menu, right-click Computer, click Properties, click Advanced System Settings, click Environment Variables, then find PATH under System Variables and click Edit, and add the path (example: add the following onto the end of PATH: ;C:\Program Files\Java\jre7\bin and don't forget the semicolon!)
Hope it helps.

Resources