visual j++ and javax?

L

lallous

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)
 
C

Christophe Vanfleteren

lallous said:
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)

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.
 
C

Chris Smith

lallous said:
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.]

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
L

lallous

I downloaded NetBeans and it is so slowwwwww comparing to VJ when it comes
to compiling, debugging and editing!

Any suggestions?
 
L

lallous

Hello,

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.

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?
 
L

lallous

Hello,

Chris Smith said:
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.
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).

Nevertheless, one thing sticks out.


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.
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?
 
C

Chris Smith

lallous said:
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,

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++.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
C

Chris Smith

lallous said:
Not that I want to have 'javac' compile the code, I want VJ to compile and
*debug* the code too.
And said:
[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.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
L

Larry Coon

lallous said:
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.
 
A

Andrew Thompson

"lallous" ...
| "Chris Smith" ...
| > lallous wrote:
| > > 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...
 
M

Mickey Segal

Chris Smith said:
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++.

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.
 
T

Tony Morris

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.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
 
C

Chris Smith

Mickey said:
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.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
C

Chris Smith

Tony said:
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.

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.)

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
T

Tony Morris

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.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
 
M

Mickey Segal

Chris Smith said:
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.
 
M

Mark Preston

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).
 
J

JayDay

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.
 
L

lallous

JayDay said:
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top