Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-21-2003, 11:25 AM   #1 (permalink)
jacl35
Registered User
 
Join Date: Feb 2003
Location: florida
Posts: 1
jacl35 is on a distinguished road
Send a message via ICQ to jacl35
Question Need help from the very start

Hi;

I just downloaded Java a few days ago and read all I could on setting the path and classpath.

I am a bit confused on setting the classpath for classes.
one place said I had to set it as

classpath=c:\j2sdk1.4.1_01\lib\classes.zip

I am confused since the ending part of this path does not exist in the lib folder or any zip file for that matter.

when I downloaded "helloworld test file" put it in its ownfolder
and set the classpath to that folder

At c prompt I type

javac HelloWorldApp.java

It opens my windows pop up for "choose the program I would like to open this file or application with"

I've tried everything I could read about setting the paths
etc but nothing is working.

Can someone head me in the right direction please?

Thank you for helping a newbie : )
Jack
Florida:rock:
jacl35 is offline   Reply With Quote
Old 03-07-2003, 03:07 PM   #2 (permalink)
jrz
Registered User
 
jrz's Avatar
 
Join Date: Mar 2003
Posts: 1
jrz is on a distinguished road
you don't really have to set any classpaths, just the path to the java executables. and be in the same directory as your source file.

path should be like
set PATH=%PATH%;c:\j2sdk1.4.1_01\bin or whatever the path is for your install ^_^
jrz is offline   Reply With Quote
Old 03-08-2003, 06:53 PM   #3 (permalink)
jeffro
Person of interest
 
jeffro's Avatar
 
Join Date: Mar 2003
Location: New Jersey
Posts: 102
jeffro is on a distinguished road
Classpath and Java

Setting your classpath is really only important when you want to start using methods that other people have created before you. Usually they come as .jar files. I keep all my jars in one place to make them easier to find.

For example all my jars are in /home/jeffro/java/jars (or say c:/jars, on a windows machine) Then when ever I add a jar to the jars directory I just add it to my classpath like so:

classpath=/home/jeffro/java/jars/other.jar:/home/jeffro/java/jars/cool.jar
[or if you want to get all snazzy]
classpath="/home/jeffro/java/jars/other.jar"
classpath="$classpath:/home/jeffro/java/cool.jar"
etc...

Then I can use all the methods that are in that jar like they were part of my own code. (note, on a windows machine, you would seperate the paths to your jars with a semicolon rather than a colon)

If you open up a jar (you can use most any archive program, TAR or WinRar would do the trick). You can see the directory structure you would indicate in your import statement. For example in my cool.jar there is a method called stringUtils that I want to use so would just put:

import path.to.stringUtils;

Then I can access all of the methods in stringUtils. The path.to is indicated by the directory structure in the jar so the actual path to stringUtils would be (from when you first open the jar) /path/to/stringUtils.class

It sounds like alot of work but when you start writing really big programs its nice to be able to use a methods other people have written to save time.

jeffro
__________________
Jeffro
Linux counter#:213782
GnuPG ID: 406238E7
jeffro is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP console exits once i start program fuzzybunny3 Standard C, C++ 3 10-24-2004 08:10 PM
Best place to start journeyman Lounge 33 03-18-2004 11:01 PM
MDI Application Size on Start Up sde Java 2 03-12-2004 05:57 AM
Where Do You Recommend To Start? goldmonkee Standard C, C++ 6 03-11-2003 10:23 PM
Alright Im here! Someone tell me,,, is this the language I wanna start with? TVance Standard C, C++ 5 12-27-2002 03:05 PM


All times are GMT -8. The time now is 09:30 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting