• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to run a j2ee program?

 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
I just start on j2ee. I followed the instruction on sun web page. I had installed Ant and some tutorial example. And I also set some environment variables: JAVA_HOME, J2EE_HOME, ANT_HOME. I also set the path to include JDK, j2ee, ant bin and lib. But I still can't start a program.
Could anyone walk me through the process? I need some detail information.
Thanks a lot!
Don
 
v velus
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any error?.Like classdefnotfound,bad command or invalid j2ee path.
Any have click dos properties and increase the enviroment memory to 4096.
 
Scott Huddleston
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you set up the app servers environment properly the application would be started by typing the URL of your server followed by the virtual path to your application as set in the app server's console or xml configuration file. The address should look something like: "http://locahost:8080/myapp/index.jsp".
Make sure you've configured everything properly and that you've restarted the app server after changing any configuration.
Good luck,
Scott
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply!
The error message I got is as below. I type 'j2ee' under a random directory. To my understanding, if it was installed properly, server should be started. By the way, I have succesfully installed Tomcat.
Don
============================================================
C:\My Documents\Certification\SCJD\scjd\starting>j2ee
Syntax error
Syntax error
Syntax error
Java 2 Enterprise Edition Server
Options:
-verbose Redirect all logging output to the current shell.
-help Print this help message.
-version Print the version.
-stop Stop the J2EE server.
C:\My Documents\Certification\SCJD\scjd\starting>
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
After read a post, I did some change to setenv.bat. Now what I got is as below. But I think root cause likely is this file.
Don
===============================================================
C:\j2sdkee1.3>J2EE
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-hotspot to select the "hotspot" VM
-server to select the "server" VM
-classic to select the "classic" VM
If present, the option to select the VM must be first.
The default VM is -hotspot.
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name

Java 2 Enterprise Edition Server
Options:
-verbose Redirect all logging output to the current shell.
-help Print this help message.
-version Print the version.
-stop Stop the J2EE server.
C:\j2sdkee1.3>
 
Craig Berry
Author
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds to me like your PATH environment isn't set correctly. Why don't you just try running j2ee.bar from within the %J2EE_HOME%\bin directory that way you are guaranteed to run it.
------------------
Craig Berry
Author of Professional EJB
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if path variable itself is missing like might be unknowingly deleted, then can we create system path variable again.
 
syed adnan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your command is not proper use:
j2ee -verbose
if it gives some error then set j2ee_home, java_home
if error are remaining then stop some services of your system because it is possible these services may use the same port in which your server goes to execute.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!