Java Forum / General / February 2004
visual j++ and javax?
lallous - 26 Jan 2004 15:09 GMT Hello,
I installed VJ++ 6, but I am unable to compile the programs I used to using JDK's javac.
It seems javax.* is unknown although I have the j2re1.4.2_01 installed.
Even tried to add to my project this class path:D:\Program Files\Java\j2re1.4.2_01\lib but also VJ cannot compile my application.
Can someone please give me help, or a step by step solution on how to fix that and get VJ compile my programs that use javax?
(I am new to java)
-- Elias
Christophe Vanfleteren - 26 Jan 2004 15:13 GMT > Hello, > [quoted text clipped - 14 lines] > -- > Elias Don't use visual j++, it is discontinued by Microsoft and never supported anything else than jdk1.1.
Use Netbeans (netbeans.org) or Eclipse (eclipse.org) if you want a nice, free IDE, or JBuilder or Idea if you're willing to pay for one.
 Signature Kind regards, Christophe Vanfleteren
lallous - 26 Jan 2004 15:40 GMT I downloaded NetBeans and it is so slowwwwww comparing to VJ when it comes to compiling, debugging and editing!
Any suggestions?
-- Elias
> > Hello, > > [quoted text clipped - 24 lines] > Kind regards, > Christophe Vanfleteren Mark Preston - 27 Jan 2004 18:21 GMT >I downloaded NetBeans and it is so slowwwwww comparing to VJ when it comes >to compiling, debugging and editing! > >Any suggestions? Yup - get used to it, or try another IDE. Whatever you do, don't go back to J++ (not if you want to be using Java).
JayDay - 28 Jan 2004 16:24 GMT Mark Preston <usenet@noemailaddress.co.uk> schreef op Tue, 27 Jan 2004 18:21:13 +0000:
>> I downloaded NetBeans and it is so slowwwwww comparing to VJ when it >> comes [quoted text clipped - 4 lines] > Yup - get used to it, or try another IDE. Whatever you do, don't go > back to J++ (not if you want to be using Java). Buy some memory, I work with netbeans on an old 350Mhz machine and 250Mb memory.
lallous - 29 Jan 2004 06:27 GMT > Mark Preston <usenet@noemailaddress.co.uk> schreef op Tue, 27 Jan 2004 > 18:21:13 +0000: [quoted text clipped - 10 lines] > Buy some memory, I work with netbeans on an old 350Mhz machine and 250Mb > memory. Already have 768MB and 2GHz and it is still slow...the editor, the compilation and debugging...(it takes more than 5 secs to respond to every action).
-- Elias
Jon A. Cruz - 08 Feb 2004 00:26 GMT > Already have 768MB and 2GHz and it is still slow...the editor, the > compilation and debugging...(it takes more than 5 secs to respond to > every action). I'm using eclipse regularly on a 386MB 0.5GHz machine with no problems. You should look into that and/or Emacs+JDEE
http://www.eclipse.org
http://www.gnu.org/software/emacs/emacs.html http://www.gnu.org/software/emacs/windows/ntemacs.html
http://jdee.sunsite.dk/rootpage.html
Mickey Segal - 26 Jan 2004 15:31 GMT > It seems javax.* is unknown although I have the j2re1.4.2_01 > installed. I've used the javax.servlet.* classes with VJ++ as described at http://segal.org/java/servlets/start.html
lallous - 26 Jan 2004 15:41 GMT Hello,
[quote] For each project, set the classpath inside VJ++ using Project | ProjectName Properties | Classpath and select "All Configurations" from the Configuration choice and use the New button to add c:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar to the classpath. [/quote]
Is that all? I tried that by pointing to rt.jar but it didn't work. What I did is extracting the rt.jar file and recompressing it using zip format. Now I can apparently compile the application, but when I run it, I get: ERROR: Unable to locate system class: java/lang/Object
Any thoughts?
-- Elias
> > It seems javax.* is unknown although I have the j2re1.4.2_01 > > installed. > > I've used the javax.servlet.* classes with VJ++ as described at > http://segal.org/java/servlets/start.html Chris Smith - 26 Jan 2004 15:57 GMT > Is that all? I tried that by pointing to rt.jar but it didn't work. > What I did is extracting the rt.jar file and recompressing it using zip [quoted text clipped - 3 lines] > > Any thoughts? Elias,
There's a very large difference between telling VJ++ to use the servlet API classes and telling VJ++ to use the core API from a JDK. The JDK core API has a couple of issues that probably won't apply to a packaging of the servlet API. Specifically:
1. They are likely to be compiled to a newer version of the class file format than VJ++ is able to support.
2. They reference native code, which is not picked up by VJ++.
3. Even if you were to specify the native libraries from the JRE as well, VJ++ doesn't support the native interface used by the core API from Sun's reference implementation.
So, basically, if you want to reliably compile modern Java applications in Visual J++, you *must* convince it to build your applications using the compiler from the Sun implementation, and run them using the Sun virtual machine. Again, I don't know if that's possible; but it would be required to get a sane development environment out of VJ++.
 Signature www.designacourse.com The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Mickey Segal - 27 Jan 2004 00:16 GMT > There's a very large difference between telling VJ++ to use the servlet > API classes and telling VJ++ to use the core API from a JDK. The JDK [quoted text clipped - 15 lines] > virtual machine. Again, I don't know if that's possible; but it would > be required to get a sane development environment out of VJ++. Chris Smith's answer points to problems in some cases, but for servlets it has seemed that all you need is to use the servlets.jar file. The same approach also worked for JavaMail. I've been able to debug these servlets, though I have never tried debugging into the servlet or JavaMail code itself, only into my code. I have not tried other javax components.
Tony Morris - 27 Jan 2004 00:27 GMT Simply put, VJ++ is to Java as Rice cookies are to typewriters.
They are completely different entities (despite what Microsoft tells you) with very superficial similarities.
 Signature Tony Morris (BInfTech, Cert 3 I.T., SCJP[1.4], SCJD) Software Engineer IBM Australia - Tivoli Security Software (2003 VTR1000F)
> > There's a very large difference between telling VJ++ to use the servlet > > API classes and telling VJ++ to use the core API from a JDK. The JDK [quoted text clipped - 21 lines] > though I have never tried debugging into the servlet or JavaMail code > itself, only into my code. I have not tried other javax components. Chris Smith - 27 Jan 2004 01:44 GMT > Simply put, > VJ++ is to Java [quoted text clipped - 3 lines] > They are completely different entities (despite what Microsoft tells you) > with very superficial similarities. I wouldn't go nearly that far. They are *almost* identical. It's the "almost" part, though, that gets you.
In fact, I'd say that the inability to mix and match core APIs is unrelated to the incompatibility of VJ++ and Java. If you don't believe me, try mixing the core runtime Java classes from Kaffe or GNU Classpath with the Sun J2RE. Let us know how it goes! (Or, for a shorter version of the same, check out Intel's ORP mailing list and look for the difficulties they've had getting ORP and Classpath to work together.)
 Signature www.designacourse.com The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Tony Morris - 27 Jan 2004 01:56 GMT Ok, I admit, there's a slight exaggeration.
There's a reason why Microsoft had it's arse sued by claiming (and therefore, misleading) that VJ++ is Java.
 Signature Tony Morris (BInfTech, Cert 3 I.T., SCJP[1.4], SCJD) Software Engineer IBM Australia - Tivoli Security Software (2003 VTR1000F)
> > Simply put, > > VJ++ is to Java [quoted text clipped - 13 lines] > of the same, check out Intel's ORP mailing list and look for the > difficulties they've had getting ORP and Classpath to work together.) Chris Smith - 27 Jan 2004 00:49 GMT > Chris Smith's answer points to problems in some cases, but for servlets it > has seemed that all you need is to use the servlets.jar file. The same > approach also worked for JavaMail. I've been able to debug these servlets, > though I have never tried debugging into the servlet or JavaMail code > itself, only into my code. I have not tried other javax components. Specifically, I'm pointing to problems with trying to replace the entire core API used by Microsoft's compiler. The servlet API (and, quite likely, JavaMail and many other extensions) work mainly because they are implemented in Java, without having recourse to native code. That won't be true of a lot of the core API additions post-1.2. For example, the version of Swing from Java 1.2 uses native code extensively in an implementation of FileSystemView; javax.sound is entirely a bridge to native code; etc.
It's those APIs that are implemented in native code, then, that really can't be made to work with Microsoft's J++ compiler or runtime. Many of the standard extensions are don't fall into that category, and while you still may run into problems with the Microsoft VM failing to recognize newer versions of the class file format, there's nevertheless a pretty good chance that those extensions will work just fine.
The OP, though, very clearly wants to replace the entire core API, which is squarely in the "not possible" category.
 Signature www.designacourse.com The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Mickey Segal - 27 Jan 2004 02:01 GMT > The OP, though, very clearly wants to replace the entire core API, which > is squarely in the "not possible" category. It is good to clarify the details so people know what will work. The VJ++ environment can work nicely for Java 1.1 if you turn off the Microsoft-specific stuff in the IDE. For people who are keeping their code in a form that will run on all Java 1.1 environments and using only some basic server-side features such as servlets, sticking with VJ++ would make sense. I wouldn't recommend VJ++ to a new user, but to an existing user who is committed to supporting the Microsoft JVM for the next few years it can make a lot of sense to stick with VJ++ if they are already familiar with it.
Chris Smith - 26 Jan 2004 15:32 GMT > I installed VJ++ 6, but I am unable to compile the programs I used to > using JDK's javac. I'm not sure if that's possible.
Even if it is, though it's you choice in the end, I'd strongly recommend that you *not* use VJ++ 6 to write Java applications. It's not intended to develop in Java, and the differences between Java and Microsoft's Java 1.1-like language J++ are substantial enough that you're almost certain to run into problems. At the very least, it would be annoying to have to ignore the red underlines from the incremental error checker in VJ++ when it flags perfectly valid Java code as illegal.
There are much better development environments for Java available; both free (Eclipse, for example), and commercially (IntelliJ IDEA, for one).
Nevertheless, one thing sticks out.
> Even tried to add to my project this class path:D:\Program > Files\Java\j2re1.4.2_01\lib but also VJ cannot compile my application. There are no class files anywhere inside the J2RE's lib/ directory, so adding that to your classpath is completely useless. In fact, if your intent is to compile Java code with 'javac' (instead of compiling J++ code with the internal compiler) you don't need to add *anything* to the classpath at all. Take out everything there. It sounds like you haven't succeeded in convincing VJ++ to use 'javac' at all, yet.
[The other option, trying to get the J++ compiler to compile with references to the Java class library, is fraught with so many difficulties that it's likely to be just plain impossible.]
 Signature www.designacourse.com The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
lallous - 26 Jan 2004 15:55 GMT Hello,
> > I installed VJ++ 6, but I am unable to compile the programs I used to > > using JDK's javac. [quoted text clipped - 8 lines] > to have to ignore the red underlines from the incremental error checker > in VJ++ when it flags perfectly valid Java code as illegal. I am just a newbie, so I never encountered yet a legal code that is treated as illegal!
> There are much better development environments for Java available; both > free (Eclipse, for example), and commercially (IntelliJ IDEA, for one). [quoted text clipped - 10 lines] > classpath at all. Take out everything there. It sounds like you > haven't succeeded in convincing VJ++ to use 'javac' at all, yet. Not that I want to have 'javac' compile the code, I want VJ to compile and *debug* the code too.
> [The other option, trying to get the J++ compiler to compile with > references to the Java class library, is fraught with so many > difficulties that it's likely to be just plain impossible.] Look at my reply to "Mickey". I managed to get VJ compile w/ the javax.* from the JDK, however when I run:
ERROR: Unable to locate system class: java/lang/Object
I have the feeling that this error exists because of the confusion between the JDK's java/lang/Object and VJ's old java/lang/Object.
Now, I am unable to have VJ run w/ no default packages enabled...perhaps when only the rt.zip is there the program would run.
The other problem is: I also want to *debug* using VJ, is that possible?
> -- > www.designacourse.com > The Easiest Way to Train Anyone... Anywhere. > > Chris Smith - Lead Software Developer/Technical Trainer > MindIQ Corporation -- Elias
Chris Smith - 26 Jan 2004 16:21 GMT > Not that I want to have 'javac' compile the code, I want VJ to compile and > *debug* the code too. And I wrote:
> > [The other option, trying to get the J++ compiler to compile with > > references to the Java class library, is fraught with so many > > difficulties that it's likely to be just plain impossible.]
> Look at my reply to "Mickey". > I managed to get VJ compile w/ the javax.* from the JDK, however when I run: > > ERROR: Unable to locate system class: java/lang/Object Yep, I saw that, and even responded to it. Perhaps you won't like the contents of my response, but they are true. You can *not* do what you're trying to do.
> The other problem is: I also want to *debug* using VJ, is that possible? That may actually be easier than anything else. I'm not aware of major changes in how debugging works between Microsoft's J++ interpreter and Sun's Java interpreter. That's not to say these changes don't exist, but at least I'm not aware of their existence.
 Signature www.designacourse.com The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Andrew Thompson - 26 Jan 2004 18:50 GMT "lallous" ...
| "Chris Smith" ... | > > I installed VJ++ 6, but I am unable to compile the programs I used to | > > using JDK's javac. | > | > I'm not sure if that's possible. ...
| > ....At the very least, it would be annoying | > to have to ignore the red underlines from the incremental error checker | > in VJ++ when it flags perfectly valid Java code as illegal.
| I am just a newbie, so I never encountered yet a legal code that is treated | as illegal! He, he, he... '..just a newbie..'?
When you state that you have never seen a mixture of Java and MS F/U, that qualifies you as still in the womb.
Stop wasting your time (and our bandwidth) and get yourself a non MS Java editor.
Eclipse, IntelliJ, Netbeans, Textpad...
-- Andrew Thompson * http://www.PhySci.org/ PhySci software suite * http://www.1point1C.org/ 1.1C - Superluminal! * http://www.AThompson.info/andrew/ personal site
Larry Coon - 26 Jan 2004 17:21 GMT > I installed VJ++ 6, but I am unable to compile the programs I used to > using JDK's javac. I'm just echoing what others have already written. You are in EXACTLY the same position I was in -- I already owned and was familiar with Visual Studio, and preferred to try to get Visual J++ running for learning Java.
In the beginning I ran into the same problems as you.
In the middle I used VJ++ as an editor only, and compiled from the command prompt using javac.
In the end I switched to Eclipse, and haven't looked back. I will note (as you did) that VJ++ is faster. I got used to it. The pros vastly outweigh that one con.
Louis M - 29 Jan 2004 12:07 GMT > Hello, > [quoted text clipped - 14 lines] > -- > Elias Visual J++ is not Java. Unless you are supporting jdk1.1 code that was built using VJ++ and never intend to upgrade that application (god help you) then you are walking down the path of Doom. Eclipse.org. Netbeans.org.
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|