Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with packages using Forte

 
Suvrat Joshi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write some very basic Servlets and ran into some package related issues with Forte. Any help would be appreciated.
I have 2 classes in the same package. I DO NOT have the package qualifier for both the classes. Class 2 instantiates Class 1. Class 1 compiles fine. Class 2 gives an error saying cannot find Type in import statement -- hinting that it could not locate Class 1, when both are in the same package.
However, it works if I do the following.
Go to the Projects tab.
Add the 2 files, Class 1 and Class 2.
Do a build project. I get the compiled Class files for both the
Classes.
I go back to the FileSystems tab and try to compile the classes, they dont compile!! Lastly, if I hover my mouse on Class 1 or 2, I get the ballon "invalid Package Declaration"
How do I resolve this error?
 
nik tilly
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can only tell you how to resolve the "invalid package declaration", three months after you posted this. Packages will only be recognized in forte if you mount them at the root point so if you have a class with package declaration com.foo.me at location somedir/com/foo/me , mount the directory at the somedir point and it should work.
 
Sreenivasa Majji
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Forte has an excellent support group. Please post your questions at http://forte.sun.com/cgi-bin/WebX/ You will get the answer(s) not only from Sun people but a whole group of community.

------------------
/Sreenivasa Kumar Majji
Sun Certified Java Programmer
http://www.geocities.com/skmajji/Main.html
 
Manoj Keswani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forte(tm) for java(tm), release 2.0 IDE problem: "invalid package declaration"
Hello Java expert,
Textbook
---------------
Advanced java 2 platform how to program

Problem
---------------
Forte(tm) for java(tm), release 2.0 IDE problem:
"invalid package declaration" tooltip on the animationwindow.java
Code snippet:
C:\forte4j\development\examples\chapters\ch06\fig06_34\animationwindow.java
Package com.deitel.advjhtp1.beans;

Specification information:
-------------------------------------
Forte(tm) for java(tm), release 2.0, community edition (build 1160)
System :
Microsoft windows xp
Professional
Version 2002
55274 -640-0000356 -23840
Computer :
Amd athlon (tm)=20
1.84 ghz
768 mb of ram
Directory mounted:
C:\forte4j\development\examples\chapters\ch06\fig06_34
Compiler used: external compiler. (the -d option is specified for this compiler).
I've deleted the internal compiler (cause I can just create a new one)
Output
---------------
- within the IDE, it compiles and runs properly (the class files are created at fig06_34, but I need them created in com\deitel\advjhtp1\beans)
- the command prompt it compiles and runs properly (class files are created at com\deitel\advjhtp1\beans)
- within the IDE I can type "package com" (followed by dot) and it brings up the next folder "deitel", advjhtp1, and then beans.
Solution required
--------------------------
Java files stay in folder: fig06_34, and the classes get compiled to the package declared in them (com\deitel\advjhtp1\beans).
What do I change in the IDE to make it understand the package declared is correct?
Thank you,
Manoj keswani
Manoj91@hotmail.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic