Solved

jre/jar/class and win2k/nt

Posted on 2001-08-14
12
311 Views
Last Modified: 2013-11-23
hi, I developed a small java program with jdk1.3.1 in my development machine. which runs my program nicely using c:>java myclass command.

now I have a win2k server. I want to move/deploy/run(whatever the term is) my program in that server.

the win2k server doesn't have any java development stuff installed. maybe the one with win2k, but that is it.

how do I run myclass in this server?

I have downloaded jre, but didn't install yet.

not to offend people, but I do prefer outline, step by step explanaition/instruction. easy to read and yes, understand.

thanks
0
Comment
Question by:chrislee8
  • 7
  • 4
12 Comments
 
LVL 3

Expert Comment

by:black
Comment Utility
1. well first you need to install the JRE
2. let's say you installed it into
C:\jre
then your PATH environment variable should have an entry into the bin directory:
PATH=%PATH%;C:\jre\bin
this let's you type in java command line.
3. Set the CLASSPATH variable to point to either the JAR file if you have your classes in a jar:
CLASSPATH=%CLASSPATH%;C:\myapp.jar
or if you have it in the directory structure
CLASSPATH=%CLASSPATH%;C:\myclasses
4. Go to command line and run it
C:>java myClass args
0
 

Author Comment

by:chrislee8
Comment Utility
do I really need the jar file in the server or just the myclass.class file?

my program is just one class file, not multiple class files.

thanks
0
 
LVL 3

Expert Comment

by:black
Comment Utility
you can have either, the jar file is just an archive containing the classes you just need one of them
if you have a single class file just copy that across.
point your classpath at you classes directory. For example if you have a class called MyClass in the my.app package. You would have
C:\classes\my\app\MyClass.class
and you CLASSPATH would point to the classes directory:
CLASSPATH=%CLASSPATH%;C:\classes
and you would run your class by:
C:>java my.app.MyClass args
0
 

Author Comment

by:chrislee8
Comment Utility
i forgot to tell:

i do c:>java myclass.class, it says not such internal command found.

does the java.exe(i guess) come with the jre?
or what is wrong?

thanks
0
 
LVL 3

Expert Comment

by:black
Comment Utility
yes it does, type in
C:>set
and it will print out your environment variables, make sure the directory you have the java.exe file is an entry in the PATH variable.
0
 

Author Comment

by:chrislee8
Comment Utility
I did a search on java.exe file, nothing came up, I downloaded the jre1.1.x for win32 version.
no it doesn't have the java.exe file anywhere.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:chrislee8
Comment Utility
i tried installing jre1.1.x for win32 on two servers, I did a search on java.exe file. nothing came up.

what is wrong???

aarrrhhhhhhhhhhhhhhh, frigging javasoft doesn't provide any help and ****!!!!!

sorry i need to vent a little bit.
0
 

Author Comment

by:chrislee8
Comment Utility
i just found out that java.exe only comes with the jdk!!!
hey, what is going on?
again, my server doesn't have jdk installed, and i don't plan to neither because I won't do development work on my server. the development work is done on a workstation.

I need the server to run my java application though, so I think I need jre.

but i don't know the rest.
how do I run my java app(only one class) on my server? it is win2kAS.

I relied on your guys' advise, please don't give out incorrect information.
0
 
LVL 1

Accepted Solution

by:
ny971181 earned 50 total points
Comment Utility
well, do this:

you have jre installed right, then you should have jre.exe command file.

c:>jre -cp (your class' path) (your class name)

the java.exe doesn't come with the jre, it comes with the jdk only.
jre comes with the jre(of course right?).

actually, javasoft does have the jre usage example. but I agree that they don't organize well(easy) enough for beginners.

good luck.
0
 

Author Comment

by:chrislee8
Comment Utility
it works, thanks

thank you for your time too, black.
0
 
LVL 3

Expert Comment

by:black
Comment Utility
I assumed you have a recent or at least Java 2, JRE and not a a 1.1.x version and my instructions were based on that that. And considering you said:
"I developed a small java program with jdk1.3.1"
I assumed you had jre 1.3 at least (the same one that I have) and I can assure you that it doesn't have a jre.exe.
If you developed in 1.3.1 I'm not sure why you would run in 1.1.x
here are some links to the jre 1.3 docs and downloads:
http://java.sun.com/j2se/1.3/runtime.html
http://java.sun.com/j2se/1.3/jre/download-windows.html
This is for 1.3.1, if you developed on it you should run on it too.
0
 

Author Comment

by:chrislee8
Comment Utility
black,

i just downloaded the jre1.3.1, it does have java.exe.

it is my fault that I didn't mention the version of jre first, but if I knew it, I would have done it too.

hehe. sorry. Thanks for your time and effort, have a nice night.

sorry didn't award you the points. my bad.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now