• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

compiling and running java file in Jbuilder

hi experts,

I am using Jbuilder IDE . I have one java file which i have to "make" and then "run". I have some system.out.println() statements in the java file which i want to display in the console. Right now , i am using build.xml to compile the entire project. but i do not want to use use build.xml .any sugessions?

thanks
0
jaggernat
Asked:
jaggernat
  • 3
  • 2
  • 2
  • +2
3 Solutions
 
StillUnAwareCommented:
Is it OK to use command line? If yes, then simply

javac ?.java
java ?
0
 
jaggernatAuthor Commented:
i have bunch of other files which i am importing in my java file . so when i do javac  abc.java  , its not able to find those
imported files from command prompt


0
 
StillUnAwareCommented:
then add the directories where they are along with any additiona; libraries to the classpath:

javac -cp dir;../lib.jar ?.java
java -cp dir;../lib.jar ?

this includes a directory 'dir' and a library '../lib.jar' into the search path. Just edit it for Your needs and You'll have it. For more javac and java options simply read the docs:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#basic
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!

 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
Just set the Classpath to point to those other .java files which are required for compilation.

use SET CLASSPATH = %CLASSPATH%;.;[the location where your java files are located.]

check out this link.

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html
0
 
StillUnAwareCommented:
Another solution to permanently set the classpath is to set it in here

Start->Settings->Control Panel->System->Advanced->Environment Variables->

in either panel select new and create a 'CLASSPATH' variable or edit existing one.
0
 
Manikandan ThiagarajanSenior consultantCommented:
http://mindprod.com/jgloss/classpath.html

this link could be help you for setting classpath
0
 
Manikandan ThiagarajanSenior consultantCommented:
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> I have some system.out.println() statements in the java file which i want to display in the console.

Use a logging component like log4J.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Oh, sorry :) I thought you said you had some statements but you did not want to display them.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now