Results 1 to 10 of 10
- 09-25-2008, 05:50 AM #1
- 09-25-2008, 06:03 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
To run a simple Java application you only need a main method, that's it. Better to more descriptive in your question.
- 09-25-2008, 06:59 AM #3
Sorry, I mean what I need to set in environment (variables).
- 09-25-2008, 08:17 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ah, I got the point. You want to set the class path.
Actually you can do it in two ways.
1) If you are working on command prompt, you can set the class path at the time of working on with Java applications. But this is not a good choice actually, reason is that each time you start work need to set the class path.
Say you install Java in following path,
What you have to do is, change your directory to the working folder and then typeC:\Java
Actually path to the bin folder, it can be differ depends on your JDK version and installation path. To check class path setting is fine, type javac and see what the result is.path=C:\Java\jdk1.5\bin
2) On Environment Variables, on Path variable of User Variables at the class path to the end of it.
- 09-25-2008, 10:18 AM #5
Member
- Join Date
- Sep 2008
- Posts
- 17
- Rep Power
- 0
2 variable needed PATH and CLASSPATH
In PATH add path of bin directory of java
path=C:\Program Files\Java\jdk1.5.0_06\bin;
IN CLASSPATH add psth of lib directory of java
classpath=C:\Program Files\Java\jdk1.5.0_06\lib;Sagar Birari
Development & Technical Blog
- 09-25-2008, 10:28 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
May be you have to add CLASSPATH additionally.
- 09-25-2008, 04:14 PM #7
You don't NEED to set any environment variables to run a java program. You can always specify full paths to the command and the full classpath on the commandline.
Setting the environment variables shortens what you have to type in, prevents typos on long paths and can make it easier. However, forgotten settings for the classpath can come back to bite you.
- 09-26-2008, 03:20 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yes, that's my first option. ;) But the worst thing there is each time you have to set the path. You can do it in many ways. Simple way I use is,
according to my installation.working_folder>path=C:\Java\jdk1.5\bin\
And also if you want you can edit the autoexec.bat file. So need to worry about the class path when you running application again.
- 09-26-2008, 06:56 AM #9
Thanks to All for giving information :)
- 09-26-2008, 03:14 PM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Is that what you really expecting?
Similar Threads
-
Help with muliplying two variables
By michael.dunkling in forum New To JavaReplies: 12Last Post: 07-18-2008, 09:22 PM -
Collecton of Variables
By c26354 in forum New To JavaReplies: 12Last Post: 06-30-2008, 03:09 PM -
Variables
By mew in forum New To JavaReplies: 3Last Post: 12-11-2007, 12:44 PM -
variables-methods
By Warren in forum New To JavaReplies: 1Last Post: 11-28-2007, 04:14 PM -
Saving Variables
By Fish in forum New To JavaReplies: 6Last Post: 06-25-2007, 08:20 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks