Sun One Studio 5 - External compiler CLASSPATH Setting

Hi

I am using Sun One Studio 5.

When I try to set the Classpath in the tools->options->Building->Compiler Types->External Compiler Expert Tab the Compiler seems to ignore it.

So I set the classpath directly on the command line for external compiler. Even then it does not recognize the classpath.

Is there anything I am missing?

thanks

Sri

[402 byte] By [702525] at [2007-11-25 10:24:31]
# 1
Hi There,All you'll need to do is to mount all the jars, folders in the IDEs explorer window that you want in your classpath.The ide ignores your classpath setting but adds everything you have mounted to its classpath.Kishore
Kishore Mandyam at 2007-7-1 20:40:11 > top of Java-index,Development Tools,Java Tools...
# 2

Thanks ! Mounting the jar file as a file system works.

However, how does one do a couple of things in Sun One Studio

Know the JDK version it is using by default .

Set a new JDK

The documentation talks about {jdk.home} but how does one set it?

thank again

Sri

702525 at 2007-7-1 20:40:11 > top of Java-index,Development Tools,Java Tools...
# 3

There are two ways to tell the IDE what JDK to use.

1. Edit <install-dir>/bin/ide.cfg and add a line like this

-jdkhome c:\j2sdk1.4.2

Replace c:\j2sdk1.4.2 with the path to your JDK

2. Pass the -jdkhome argument in the startup command, such as

runide.sh -jdkhome c:\j2sdk1.4.2

To find out what JDK the IDE is using choose Help > About and click the Detail tab.

> However, how does one do a couple of things in Sun

> One Studio

>

> Know the JDK version it is using by default .

> Set a new JDK

jetsons at 2007-7-1 20:40:11 > top of Java-index,Development Tools,Java Tools...
# 4

Thanks! I was able to launch my application from with in the IDE.

However, my breakpoints do not work. I have explicitly added -g option to the javac compiler. The application runs past them. Any pointers?

Also, when I launch my application I have certain parameters that I would like to pass to it such as -s -v etc. I could only set the Main Project class. Where can I set these?

All your replies are really appreciated..

thanks

Sri

702525 at 2007-7-1 20:40:11 > top of Java-index,Development Tools,Java Tools...
# 5

You should not need to worry about adding -g to the javac compiler. This article might help you get started with using the IDEs debugger: http://usersguide.netbeans.org/gwd/gwd_debug.html

For passing parameters to a Java application, see the online help topic titled "Specifying Arguments for Program Execution" (Use the search window to find the topic or look in Core IDE Help > Compiling and Running Java Programs > Setting Run Arguments.

The short answer is choose select the runnable object in the Explorer and then choose Build > Set Arguments from the main window.

> However, my breakpoints do not work. I have

> explicitly added -g option to the javac compiler. The

> application runs past them. Any pointers?

>

> Also, when I launch my application I have certain

> parameters that I would like to pass to it such as -s

> -v etc. I could only set the Main Project class.

> Where can I set these?

>

> All your replies are really appreciated..

> thanks

> Sri

jetsons at 2007-7-1 20:40:11 > top of Java-index,Development Tools,Java Tools...
# 6

I tried this and it did not work.

For instance I have files in folders/packages three levels deep.

folder1

folder 2

folder 3

If I mount c:\folder1\folder2\folder3, it will compile the contents of folder 3.

If I mount c:\folder1\folder2 that references exception classes in folder 3, it does not compile. It give me a package not found error.

If I mount c:\

It find them all, but them I get all the others folder in my tree that I don't want to see.

artfuldodger at 2007-7-1 20:40:11 > top of Java-index,Development Tools,Java Tools...
# 7

Sounds like you just need to separate your java source from your "miscellaneous" files. The proper way to do this would be to create a "src" directory that contains all your java source files and optionally the compiled .class files unless you are targeting your compile to go to another directory, like a "build" dir.

So if you have this:

src/folder1/folder2/folder3

then you would mount the src folder and all should be fine. Java classes in the src folder (package) are in the "default" package.

In the latest version of Studio & NB, you create a new Java project and it sets up this file structure for you. Feel "free" to upgrade now that it is "free" ;)

cvconover at 2007-7-1 20:40:11 > top of Java-index,Development Tools,Java Tools...