Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Nancy Zhang

Greenhorn
+ Follow
since Jan 07, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nancy Zhang

Yeah! this one is cool! will use it. Thanks.
15 years ago
Great thanks, fred rosenberger, it works! The only thing needs attention is that there is no whitespace between 2 and >, otherwise, java command argument error.
Thanks again!
15 years ago
This is a question about command line usage rather than Java code.

I'm trying to direct compile-error message to a txt file using this command: javac *.java >result.txt. But it seems only messages delivered by Java statement System.out.XXX could be put into target txt file. For error messages delivered by System.err.XXX, it could only be displayed on the screen, and cannot be put into txt file.

Is there a command or argument I could use to direct compile time err msg into a txt file?

Thanks.
15 years ago
last sentense: index = m.group().start(); got compile-time error. It seems m.group() returns a string, so start() cannot be used on that string.
15 years ago
Given a pattern, e.g. with regular expression "\\s/\\*@.+@\\*/\\s", and a string, is there a way to get the index of the first occurrance of this pattern in the string? It seems indexOf() in String class can only deal with concrete str as parameter, rather than a regular expression or a pattern.
Thanks,
15 years ago
Great thanks!
It's X terminal, and installer for solaris sparc has been installed successful minutes ago. : )
After preparing all environment, now comes my old question: when I try to compile java source (unzipped from src.zip) with this command:javac -d ./classes `find ./src -name '*.java'`, like what you said days ago, it cannot complete without error msg, because there are dependencies on other code which isn't provided in the source. I checked JDK distribution, there are some under /lib/ and some under /jre/lib/. But I can't tell which ones are useful here. Should I include all of them in -classpath option? or maybe only one or two are necessary?
15 years ago
oh, yeah, you're right. it's solaris sparc. the workstation uses linux, but all things are actually installed on back solaris platform.
15 years ago
I downloaded JDK 5.0 update 1 linux self-extracting file: jdk-1_5_0_01-linux-i586.bin, and use chmod to make it executable. But after I run jdk-1_5_0_01-linux-i586.bin and say 'yes' to the license agreement question, I got the following error msg:
usage: tail [+/-[n][lbc][f]] [file]
tail [+/-[n][l][r|f]] [file]
jdk-1_5_0_01-linux-i586.bin: test: argument expected

I checked installation instructions from sun web site, and it doesn't mention anything about argument. Since it's my first time installing Java on linux platform, really don't know what else I should do to make the installation successful.

Thanks.
15 years ago
I downloaded JDK 5.0 update 1 linux self-extracting file: jdk-1_5_0_01-linux-i586.bin, and use chmod to make it executable. But after I run jdk-1_5_0_01-linux-i586.bin and say 'yes' to the license agreement question, I got the following error msg:
usage: tail [+/-[n][lbc][f]] [file]
tail [+/-[n][l][r|f]] [file]
jdk-1_5_0_01-linux-i586.bin: test: argument expected

I checked installation instructions from sun web site, and it doesn't mention anything about argument. Since it's my first time installing Java on linux platform, really don't know what else I should do to make the installation successful.

Thanks.
15 years ago
I noticed that there's a "windows build instructions" file under root dir of JDK source, it seems tons of work and tools needed. So I decided to use pure source code from src.zip instead.
Thanks for you all.
15 years ago
The reason why I try to compile JDK source is:

My program uses JDK source as test suite, does some modification on those Java source codes and generates very similar source files with same file names and hierarchy, let's call them NEW source. Now my target is to make sure these NEW source are compilable.

So, how to compile these JDK source?

Thanks.
15 years ago
hmmm, unforturnately JDK source is part of my test suite. And my program is expected to parse Java source codes first before doing other processing. For those "precompile purpose code", my parser can't process them correctly following standard Java grammar. Since those files are not real java file, I think I'd better find a way to exclude them. It's good there are only 7 such files in JDK source. And they have common part in file name, so...

Thanks very much for your help. Now I know what those files are and there's nothing wrong with my parser.
15 years ago
Is there a way to recognize/distinguish such type of file from normal Java source code when my code trying to process ".java" files?
15 years ago
The following is part of Java code from a JDK src file ByteBufferAs-X-Buffer.java:
---------------------------
/*
* @(#)ByteBufferAs-X-Buffer.java1.17 04/05/03
*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/

#warn This file is preprocessed before being compiled

package java.nio;


class ByteBufferAs$Type$Buffer$RW$$BO$// package-private
extends {#if[ro]?ByteBufferAs}$Type$Buffer{#if[ro]?$BO$}
{

#if[rw]

protected final ByteBuffer bb;
protected final int offset;

#end[rw]
...
...
---------------------------

I never seen such use of # in Java code before, e.g. #warn, #if, #end. I'm wondering where can I find more info about # usage in Java code?

Thanks.
15 years ago