[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Setting J2EE_HOME JAVA_HOME?

Posted on 2004-09-16
13
Medium Priority
?
3,764 Views
Last Modified: 2010-08-05
Hello,

I installed, the standard development kit at  c:\jdk1.4\ and the j2ee at c:\j2ee1.3\  

The bin directory of these are c:\jdk1.4\bin and c:\j2ee1.3\bin

I am using win98, and was trying to set the J2EE_HOME, and JAVA_HOME variable in the autoexec.bat

Could anyone advice if this autoexec looks correct?

Thank you

rem TShoot: @PATH C:\PROGRA~1\MICROS~5;%PATH%
SET SBPCI=C:\SBPCI
SET BLASTER=A220 I7 D1 H7 P330 T6
SET SNDSCAPE=C:\WINDOWS
REM [Header]

REM [CD-ROM Drive]

REM [Display]

REM [Sound, MIDI, or Video Capture Card]

REM [Mouse]

REM [Miscellaneous]


mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi)
mode con codepage select=850
keyb uk,,C:\WINDOWS\COMMAND\keyboard.sys



SET CLASSPATH=.; C:\jdk1.4\jre\lib\j2ee.jar;

PATH C:\PROGRA~1\MICROS~5;%PATH%;"C:\Program Files\Mts; C:\jdk1.4\bin;"

SET PATH=%PATH%;c:\jdk1.4\bin;c:\j2ee1.3\bin;
SET J2EE_HOME=c:\j2ee1.3
0
Comment
Question by:AntoniRyszard
13 Comments
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12077875
SET J2EE_HOME=c:\jjdk1.4 would be better as j2ee.jar is also in jdk1.4 path
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12078459
SET JAVA_HOME=c:\jdk1.4
SET J2EE_HOME=c:\j2ee1.3

SET PATH=%PATH%;%JAVA_HOME%\bin;%J2EE_HOME%\bin
0
 

Expert Comment

by:Emilda
ID: 12080797
>PATH C:\PROGRA~1\MICROS~5;%PATH%;"C:\Program Files\Mts; C:\jdk1.4\bin;"

>SET PATH=%PATH%;c:\jdk1.4\bin;c:\j2ee1.3\bin;
>SET J2EE_HOME=c:\j2ee1.3

Path to jdk1.4\bin is already set in the first line shown so you don't need  to set it again in the second line as shown.

Cleaner way of doing is as shown by CEHJ. The advantage is that as and when you change your Java version you just need to change the setting of JAVA_HOME or J2EE_HOME to point to the new location and no need to change the PATH setting.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:AntoniRyszard
ID: 12084171
I corrected the autoexec.bat and the error Out of environment space is now gone.

But when I tried to start the j2ee, these error messages where displayed. Could anyone advise a possible reason or solution to these?

Thank you

C:\j2ee1.3\bin>j2ee -verbose
Bad command or file name
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Syntax error
Syntax error
Syntax error
Out of environment space
Bad command or file name
C:\j2ee1.3\bin>
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 12084229
0
 

Author Comment

by:AntoniRyszard
ID: 12084843
Thank you, the Out of environment space errors have gone. And I am just l left with these.

Any thoughts?

C:\j2ee1.3\bin>j2ee -verbose
Bad command or file name
Syntax error
Syntax error
Syntax error
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/enterprise/se
rver/J2EEServer
C:\j2ee1.3\bin>
0
 

Author Comment

by:AntoniRyszard
ID: 12084868
At the moment I have not installed a application server, suchas tomcat. Could any of the errors be related to this?

Thank you
0
 

Author Comment

by:AntoniRyszard
ID: 12085146
One of the forums on the internet said the j2ee 1.3 could not be run under win98.

And only version 1.2 does.

Does any know if this is correct?

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12085357
>>j2ee -verbose

What is that - a batch file or a program?
0
 

Author Comment

by:AntoniRyszard
ID: 12085420
j2ee is a bat file located in the j2ee1.3\bin directory, on the web they seem to use -verbose to start this.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12085601
Can you post it? You're probably right about missing installed components btw
0
 

Author Comment

by:AntoniRyszard
ID: 12085687
Below is the j2ee.bat contents, though when I run the deplaytool or any .bat file in the j2ee1.3\bin directory they all give this error. Do you know at all wher I could download j2ee1.2?

Thank you

Bad command or file name
Syntax error
Syntax error
Syntax error
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/enterprise/se
rver/J2EEServer


@echo off

REM
REM Copyright 2002 Sun Microsystems, Inc. All rights reserved.
REM SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
REM

rem
rem Set JAVA_HOME and J2EE_HOME before running this script.
rem
rem set JAVA_HOME to the path where you have Java 2 (JDK1.2) installed.
rem
rem set J2EE_HOME to the path where you have installed this package (EJB server).
rem

if not "%J2EE_HOME%" == "" goto CONT0
echo ERROR: Set J2EE_HOME before running this script.
goto END
:CONT0

if EXIST "%J2EE_HOME%\bin\setenv.bat" goto CONT1
echo ERROR: Set J2EE_HOME to the path of a valid j2sdkee.
goto END
:CONT1

call %J2EE_HOME%\bin\setenv.bat

if not "%JAVA_HOME%" == "" goto CONT2
echo ERROR: Set JAVA_HOME before running this script.
goto END
:CONT2

if EXIST "%JAVA_HOME%\bin\java.exe" goto CONT3
echo ERROR: Set JAVA_HOME to the path of a valid jdk.
goto END
:CONT3


rem @echo on
%JAVA_COMMAND% %LISTEN_OPTIONS% -Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter -Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl -Djms.home=%JMS_HOME% -Dcom.sun.jms.service.jdbc.dbpath=%JMS_DB_PATH% -Djms.properties=%J2EE_HOME%\config\jms_service.properties -Djava.security.policy==%J2EE_HOME%\lib\security\server.policy -Djava.security.auth.login.config=%J2EE_HOME%\lib\security\serverlogin.config -Dcom.sun.enterprise.home=%J2EE_HOME% -classpath %CPATH% com.sun.enterprise.server.J2EEServer %*

:END
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12193192
:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
A solution for Fortify Path Manipulation.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month18 days, 13 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question