I'm making a GWT app with roo (new to me) and it's late at night so I'm clearly missing something but I just created a new project folder and am trying to run roo.bat (works fine when I execute the bin directory) but it won't go. I keep getting this error:
C:\springsource\spring-roo-1.1.4.RELEASE\newProject> ../bin/roo.bat
'..' is not recognized as an internal or external command,
operable program or batch file.
Am I on crazy pills? I guess this is more of a windows command line issue but it should work (on Vista btw). Is there something about Roo.bat that won't let itself be executed from another directory or something weird?
Try this if helps:
http://www.youtube.com/watch?v=PJe7NHbZeUw
Go to Start, My Computer, right click, Properties, Advanced Definitions, Environment Variables.
In User Variables, create JAVA_HOME, ROO_HOME, MAVEN_HOME and the path should be the installation of those apps.
Then in System Variables add also the path of roo, maven and Java separated by semicolon ;.
Then go to start menu, type cmd, place it on desktop, like C:\Users\Martinho\Desktop
type mkdir myApp then enter
cd myApp
finally type roo.
There it is roo shell
Hope this helps.
Don't create your projects within the Roo installation. Instead, set an environment variable as ROO_HOME which points to the Roo installation, and add %ROO_HOME%/bin to your system path.
This makes it possible to run Roo console from any location.
Related
I am using a the NetBeans 7.x IDE. I have a Netbeans Application module. I use the Build and the Run buttons from the IDE. The module runs just fine when I press Run Project or F6 button. I like to run
this from the command line. Since everything was build automatically for
me I have no idea where things are or how to run it. There are several jar files in the project/build/public-package-jars. Is there a way to see what command and options the Run Project is using ?
Go to the root of the application (or wherever there is a build.xml file) on the command line and run ant -p. That will list all of the available options for building and running the application.
I am working on an eclipse RCP product on windows which internally uses some native binaries (dlls) located in a folder called "bin" which would be available as a part of the product.
I need to make sure that the folder "bin" is present in the PATH when the product.exe file is executed. Is there a clean way to make sure that the folder "bin" is added to PATH when the eclipse RCP product is launched?
I don't want to write any script or batch file that updates the PATH and then calls the product.exe. I also don't want to update the environment variable through the windows UI or command prompt.
I know that when we try to run my product from the eclipse IDE environment, there is an option in the run-configuration, wherein one can configure Environment variables on the Environment tab. I can append the "bin" folder to the PATH by creating a new environment variable called "Path" whose value is C:\EclipseRCPProduct\bin;${env_var:PATH}.
However - I would like to do the same when I run my product directly from the Product.exe which is generated. Does anyone have any idea regarding this?
Also - if anyone has any idea regarding the eclipse code which processes the information specified on the Environment tab of the run configuration, it would be great. I could try playing around with the code to see if I could get it to work when the product is launched from outside eclipse IDE - via the generated RCP product.exe
I don't think there's a way to define system environment variables within the launcher.
The following bug seems to request just that
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286463
In the above mentioned bug, a .bat is attached to achieve your goal.
That said, why do the native binaries have to be located in a bin folder?
I.e. why are they not included in a plugin/fragment?
I am trying to run a .jar file that I have created using either the command line and double clicking. The Jar makes a JFrame GUI with button, text, labels etc.. It should display this window.
I have checked and the file is associated with javaw.exe in the correct directly. I have also tried via the command like using java -jar filename.jar and it just paused for a split second and then moves to the next line, no errors.
I have also run javafix which also hasn't helped.
I have reinstalled JRE and JKE and still no luck, the file was created in Netbeans and compiles without problem.
I am using this Netbeans tutorial: Introduction to GUI Building.
Any suggestions? I'm Stumped.
The best I can tell is to Press Win + R and type regedit.exe, Press Enter.
In your Registry Editor Window, Expand HKEY_CURRENT_USER->Software->Microsoft->Windows->CurrentVersion->Explorer->FileExts
Delete the entry or Key Name .jar from the list. Do check the version used by your NetBeans and the one on your classpath. Hopefully they both are same versions, it can be one of the reasons too, for .jar not working. Now again try to run your .jar file. That might help it to run again.
Regards
When i run ant through Eclipse some targets build fine, but ones that need a specific environment variable i.e. SOME_SDK that i set in my .profile file won't work. Even if i try to echo out ${env.JAVA_HOME}, Ant through eclipse will just print out that string. But if i run ant through the terminal (i.e. ant sometarget), it will find JAVA_HOME and SOME_SDK and echo those paths out. Ive checked eclipse that it's pointing to the same ant that is in my environment path (/usr/share/java/ant-1.8.1). Any ideas?
Thanks
When you open a terminal, the environment variables in your .profile get loaded. When you start Eclipse via the windowing system it is not being run under your user account, so your .profile is not available to Eclipse at runtime.
At least that's the case on my linux machine and I'm guessing its the same on a Mac. I put the environment variables that Eclipse needs to see in the /etc/profile file, which gets loaded at system startup.
You can specify variables in your Ant run configuration (Run As > Ant Build... > Environment tab).
I'm thinking that the Eclipse IDE environment handling is a bit spoiled, at least in *nix environments. Although similar to Kevin's case, what I'm finding is that although I do create a separate run profile and -successfully - run the test/install goals (maven instead of ant here, but that's negligible noise), and specify the JAVA_HOME environment variable for that run profile, the project does not validate the POM file.
All I'm left with is two separate choices:
use the /etc/profile approach, or
Edit eclipse.ini file including the system property there.
I think the latter is a cleaner workaround since it affects a configuration file that is only for the problematic application after all. Nevertheless, Eclipse should use the variables found in the user's path and leave us at ease to produce :)
What you need to do is remove the java.exe from c:\Windows\System32.
The reason is, in your %PATH% environment variable, it includes c:\Windows\System32, which has a java.exe file. If you run c:> java -version from a command prompt, you'll see that the version you're running does not match the jdk version.
Once you've done this, you will need to add: %JAVA_HOME%/bin to the %PATH% environment variable, so you can execute the java.exe from the jdk when running apps. Be sure to restart any application (including the command prompt) before expecting it to pick up the change.
Add this line to ~/.bashrc (or you can use another profile file):
alias start-eclipse='open /Applications/eclipse/Eclipse.app'
(Don't forget to run source ~/.bashrc)
If you run start-eclipse from the command line, all environment variables will be picked up. This way, you only need to maintain a single set of environment variables across both command-line and eclipse environments.
NOTE: Stolen from Chris Fegley's answer at Launch mac eclipse with environment variables set
In my current project settings, I have configured Eclipse to place the compiled .class files in the /bin directory.
My puzzle is that, when I run the application via the IDE and get it to print the current working directory (System.out.println(System.getProperty("user.dir")) I expect the console output to be /bin - instead the value printed is the projectRoot folder (without the /bin suffix).
If I were to navigate to the /bin folder directly, and execute my java class, the current working directory is printed as I expect it to be. What I would like is the Eclipse IDE to behave similarly.
Any ideas as to why I am observing this disparity? I have gone through many project build settings, but cannot seem to find anything that would cause this anomaly.
Kind regards,
Dinuk
In Eclipse, the working directory defaults to the project directory.
You can change this in the run properties
(Project->Properties->Run/DebugSettings->Edit->Arguments tab, at the bottom of the page).
Edit: Actually, the easiest way to get to it is Run->Open Run Dialog->Arguments tab.
It's been a while since I used Eclipse.
From an example of Eclipse Setup New Project
alt text http://apps.sourceforge.net/mediawiki/sprite2d/nfs/project/s/sp/sprite2d/a/ae/EclipseNewProjectDebugArguments.jpg