aspose file tools*
The moose likes Beginning Java and the fly likes Getting an error while compiling javac code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Getting an error while compiling javac code" Watch "Getting an error while compiling javac code" New topic
Author

Getting an error while compiling javac code

Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi All,


I want to compile below java class.




But when i tried to execute commnad javac HelloAction.java i am getting below errore.

HelloAction.java:3 package com.opensymphony.xwork2 does not exists.

Could anyone please let me know how to compile above class.

Thanks in Advance.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Could this be a class path issue? Is your com.opensymphony.xwork2.Action class or Jar on the classpath? This relates to your other thread I believe and you may want to post links in both threads to both threads.
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi Pete,

Thanks for reply.
This class uses an inbuilt xwork-2.0.6jar file for Struts framework, but the problem is to just compile java file and not related to Struts framework.

It would be great if could let me know how to set jar file in classpath?

Thanks in Advance.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Jay Shukla wrote:Hi Pete,
It would be great if could let me know how to set jar file in classpath?


The Sun tutorials will tell you how to do this in a general sense, but (as per your other thread), I believe that you're using Eclipse, and if so, you'll need to set your project's build path in Eclipse. To do this, right click on your project, click on Properties, then Java Build Path, then the Libraries tab.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I think you should take a step back: you're plunging in to deep waters if you can't even get something to compile. This is very basic stuff--get a handle on that first.
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Thanks David for your suggestion.

I am standing near the pond of deep water and will jump as soon as i will get this java file compiled.

Its not that i just post this problem in forum and sitting for reply only.
Even before i post this question i have browsed some 7 link about setting classpath and tried them also. But i am getting an error so i though something is going wrong to which i am doing and hence tried to find what is going wrong here and that is the reason i posted this question.

Thanks.
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi David,

I just now tried one more time and i got succeded in compiling the class file.

Thanks.

 
Don't get me started about those stupid light bulbs.
 
subject: Getting an error while compiling javac code