Does Tomcat 7.x require me to set any environment variables? - servlets

I am currently reading Head First: Servlet and JSP. They want me to use Tomcat 5.5 (which is almost outdated). Instead I downloaded Tomcat 7.x.
Now, I was following their instructions on writing the first servlet but I think I will have to set some paths. I have set the path for jdk's bin directory so I can compile Java programs from command line, if I want to.
Does Tomcat require me to set any environment variables ?
If so, which? And how ?
Path to my Tomcat home looks like this: D:\Program Files\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35
Operating System: Windows 7 Home Premium 32 bit

You should only need JAVA_HOME to be set. Look in catalina.bat.

Given that you are on Windows, the file you need to look at is catalina.bat, not catalina.sh which is specific to Unix and Unix-like systems. If you are on cygwin, ignore my advice here and go with catalina.sh.

You need to set classpaths to your servlet-api, jsp-api, el-api, commons-beanutils, then you need to set ant_home, set tomcat_home and catalina_home
For example:
c:/apache-tomcat-7.0.27/run.bat:
set JAVA_HOME=c:\Program Files\Java\jdk1.7.0_07
set PATH="c:\Program Files\Java\jdk1.7.0_07";%PATH%
set CLASSPATH=.;C:\apache-tomcat-7.0.27\lib\servlet-api.jar;C:\apache-tomcat-7.0.27\lib\jsp-api.jar;C:\apache-tomcat-7.0.27\lib\el-api.jar;C:\apache-tomcat-7.0.27\lib\commons-beanutils-1.8.0-BETA
set ANT_HOME=c:\apache-tomcat-7.0.27
set TOMCAT_HOME=C:\apache-tomcat-7.0.27
set CATALINA_HOME=C:\apache-tomcat-7.0.27
C:\apache-tomcat-7.0.27\bin\startup.bat
Another method is to install NetBeans IDE and it will do everything for you- you just click RUN to run your Project

Related

wsl: sbt, ivy configuration

I have sbt installed on my windows machine, and I have set SBT_OPTS with:
-Dsbt.ivy.home=C:/var/.ivy2
-Dsbt.global.base=C:/var/.sbt/
-Dsbt.repository.config=C:/var/.sbt/repositories
I want to have similar setup in WSL, but am not able to find where in wsl are these configured.
Where do I need to look for it in WSL to set in SBT_OPTS?
I don't use SBT, so I could be way off base here, but it appears from this answer that SBT_OPTS is simply an environment variable. Typically you will simply configure that in Linux (and WSL) by either:
One-time:
export SBT_OPTS="-D/home/username/.ivy2 ..."
Or so that it loads automatically by placing the same line in your ~/.bash_profile
Of course, you'll need to set all the paths to their WSL/Linux locations.

'geckodriver' executable needs to be in PATH on Mac with Eclipse RED

I've been trying to automate some basic stuff with Robotframework. Here is my configuration.
Python - 2.7.10
MAC High Sierra 10.13.2
Eclipse Oxygen with RED Editor
I've downloaded Geckodriver executable and put in under several places including usr/local/bin, folder on desktop
Here is what i've tried
Setup FFDriver Set Environment Variable webdriver.gecko.driver Users/[my username]/Desktop/geckodriver
Setup FFDriver Set Environment Variable webdriver.gecko.driver usr/local/bin/geckodriver
and my test
open browser http://www.google.com firefox
I've added usr/local/bin in PATH as well and still getting "geckodriver executable needs to be in PATH" error. The same happens with Chromedriver too. I am sure I must be missing something trivial here, can someone help me out please?
Launching the eclipse from command prompt, has fixed this issue. Yes, the PATH is not being inherited when launched from desktop icon.
when you use Python. the best shortcut you can do is, put you 'geckodriver.exe' file in pythons script folder. and set the Script folder path in you system path. this will resolve your problem.

Symfony using Mac OS X

I am trying to start a project using Symfony on a Mac Sierra.
I installed Symfony successfully, but I get this warning:
We selected the timezone 'UTC' for now, but please set date.timezone
to select your timezone. in
phar:///usr/local/bin/symfony/src/Symfony/Installer/NewCommand.php on
line 283 ✕ Symfony 3.2.1 was successfully installed but your system
doesn't meet its
technical requirements! Fix the following issues before executing
your Symfony application: * date.timezone setting must be set
> Set the "date.timezone" setting in php.ini* (like Europe/Paris).
I tried to change php.ini with brackets editor on the created project on folders:
project/vendor/doctrine/cache/test/travis/php.ini
project/vendor/doctrine/doctrine-cache-bundle/test/travis/php.ini
Didn't help.
As I read Symfony has built-in Apache Server.
Those php.ini files are totally unrelated to what you have to do.
Open up the Terminal and type php -i | grep "php.ini". That should reveal the location of the php.ini which is used by PHP in console mode.
XAMPP is known for using different php.ini file for the server. In order to find the the one used by the XAMPP, run a sample php file with phpinfo() from browser.
Also, note that Symonfy itself does not have the built-in server. In merely used the one PHP provided from version 5.4 and on.
Hope this helps...
I am Mac user, so , in Finder you need to go to /private/etc, find php.ini.default,
Yo need to copy that file to the desktop. To edit you need to unlock the document. Just click Unlock if asked. Rename to php.ini, set the date.timezone=Europe/YourCountry and do not forget to erase the semicolon before.And finally save it and put it back to etc.
Watch: https://www.youtube.com/watch?v=Wb6Fh-B3W-o

Where is Meteor installed on Windows?

Hi I've just installed Meteor on Windows 7. Using the command prompt I was hoping I'd just type meteor but that's not working (not recognized). Do I need to set PATH?
Thanks
Simon
C:\Users\yourUserName\AppData\Local\.meteor\
You can also set that in your PATH when it is missing there.
On windows its installed here
C:\Users\<username>\AppData\Local\.meteor
but meteor command does not work sometime. To make meteor command working you need to modify path variables as follows.
Automatically set Path (after installation)
C:\Users\<username>\AppData\Local\.meteor\
Modification (remove backslash)
C:\Users\<username>\AppData\Local\.meteor

Where is the Rserve Config file located on Windows?

I'm using a Windows 7 x64 machine with R-3.1.0. I installed the Rserve package through Rstudio.
The start of Rserve is successful with the following code in Rstudio:
library(Rserve)
Rserve()
I got the following output:
Starting Rserve...
"C:\R\R-31~1.0\library\Rserve\libs\x64\Rserve.exe"
My problem is that I couldn't locate the configuration file. Apparently it can't be "/etc/Rserv.conf".
I did come across a webpage saying that the config file is Rserv.cfg in the working directory (unless changed at compile-time). But which working directory? I have checked the working directory of the current R project as well as the Rserve library directory, but it was not there...Could someone help me with this please? Thank you.
Rserve does not automatically come with a config file, you must make one. Best steps for doing so:
Navigate to the file where you just installed Rserve.exe (C:\R\R-31~1.0\library\Rserve\libs\x64\R, based on the message you copied here)
Find Rserve.exe, Reserve_d.exe, and Rserve.dll there. Copy these files.
Navigate to where R.dll is on your computer. This is probably C:\Program Files\R\R-3.1.3\bin\x64, but may be different depending on where you installed R to.
Copy the 3 files mentioned above to this location.
Create a text file here named "Rserv.cfg" with the arguments you are looking for, such as port 6312 or library(mvoutlier). Yes, I know that this is different from the documentation, but if you start Rserve_d.exe you will see that this is the file it is looking for. I have not had success naming it anything else.
You can start Rserve by specifying the location of the config file. In R instead of just Rserve() try the following:
Rserve(args="--RS-conf C:\\folder\\Rserv.cfg")
If path is more complicated you need to massage it a little bit:
Rserve(args="--RS-conf C:\\PROGRA~1\\R\\R-215~1.2\\library\\Rserve\\Rserv.cfg")
Look in the $RHOME/bin directory
If you can't find it here is a different way to approach it:
Download Rserve at [http://rforge.net/snapshot/Rserve_.tar.gz], and save it in your desired directory
Run R CMD INSTALL Rserve_.tar.gz
This allows you to leave Rserve where you want it.
After looking at the Rserve source code and making some test I found that on Windows platform Rserve try to load the configuration file from the current working directory. Also pay attention because on Windows the file name is RServ.cfg and not Rserv.conf as documented.
The current working directory depends of the process, for example using RStudio by default it is your Documents and Settings folder:
C:\Users\[username]\Documents
but can be changed in the "Global Options" of the IDE
So you can create an "RServ.cfg" text file in that directory with your needed options and starting RServe in the usual way in RStudio
Rserve()
will load your configuration.

Resources