Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » stand alone java class and the class path
stand alone java class and the class path [message #507179] Tue, 12 January 2010 01:43 Go to next message
Eclipse UserFriend
Hi,
I have a simple Java project in Eclipse environment. The project has it's class path,
that contains a jar file that I need to use.
The project runs perfect in the Eclipse.
Now, I need to take the main class out of my project, to function alone in another environment.
My problem is that out of the environment, I don't know how the class should know that classpath.
I moved that jar to the same folder that the class located in, but I don't know how to tell it that the jar is there.
My goal is to run my standalone class from another java class.
I'm afraid that examples in command environment wouldn't help me.

Thanks a lot for any help !
Re: stand alone java class and the class path [message #507225 is a reply to message #507179] Tue, 12 January 2010 09:41 Go to previous message
Eclipse UserFriend
Your class should be able to find material from the jar file if that jar
file is also on the class path. One way to do so is to add it to the
-classpath parameter when invoking java.

Cheers,

Steffen

On 12/01/2010 06:43, moshi wrote:
> Hi,
> I have a simple Java project in Eclipse environment. The project has
> it's class path,
> that contains a jar file that I need to use.
> The project runs perfect in the Eclipse.
> Now, I need to take the main class out of my project, to function
> alone in another environment.
> My problem is that out of the environment, I don't know how the class
> should know that classpath.
> I moved that jar to the same folder that the class located in, but I
> don't know how to tell it that the jar is there.
> My goal is to run my standalone class from another java class. I'm
> afraid that examples in command environment wouldn't help me.
>
> Thanks a lot for any help !
Re: stand alone java class and the class path [message #507228 is a reply to message #507225] Tue, 12 January 2010 04:57 Go to previous message
Eclipse UserFriend
Hi ,
I found the solution of what I was looking for.
I want to write it down for the other people who will face with it in the future.
So it's very simple - in the app.config file in your .net project you
have entries to describe the class path. There you can insert anything
you want to be inside the class path.
Thanks for those who tried to help.
Previous Topic:Absent Line Number Information
Next Topic:Setting Ant to "Run the the same JRE as the workspace" as the default
Goto Forum:
  


Current Time: Fri Mar 21 11:09:56 EDT 2025

Powered by FUDForum. Page generated in 0.03530 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top